hub-of-hubs-spec-sync

module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2022 License: Apache-2.0

README

Hub-of-Hubs Spec Sync

Go Report Card Go Reference License

The spec sync component of Hub-of-Hubs.

Go to the Contributing guide to learn how to get involved.

Getting Started

Environment variables

The following environment variables are required for the most tasks below:

  • REGISTRY, for example docker.io/vadimeisenbergibm.
  • IMAGE_TAG, for example v0.1.0.

Build to run locally

make build

Run Locally

Disable the currently running controller in the cluster (if previously deployed):

kubectl scale deployment hub-of-hubs-spec-sync -n open-cluster-management --replicas 0

Set the following environment variables:

  • DATABASE_URL
  • WATCH_NAMESPACE
  • POD_NAMESPACE

Set the DATABASE_URL according to the PostgreSQL URL format: postgres://YourUserName:YourURLEscapedPassword@YourHostname:5432/YourDatabaseName?sslmode=verify-full&pool_max_conns=50.

❗ Remember to URL-escape the password, you can do it in bash:

python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])" 'YourPassword'

WATCH_NAMESPACE can be defined empty so the controller will watch all the namespaces.

POD_NAMESPACE should usually be open-cluster-management

./bin/hub-of-hubs-spec-sync --kubeconfig $TOP_HUB_CONFIG

Build image

make build-images

Deploy to a cluster

  1. Create a secret with your database url:

    kubectl create secret generic hub-of-hubs-database-secret -n open-cluster-management --from-literal=url=$DATABASE_URL
    
  2. Deploy the operator:

    COMPONENT=$(basename $(pwd)) envsubst < deploy/operator.yaml.template | kubectl apply -n open-cluster-management -f -
    

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL