Skip to content

Latest commit

 

History

History
123 lines (91 loc) · 7.48 KB

cluster.md

File metadata and controls

123 lines (91 loc) · 7.48 KB

Requesting a cluster:

  1. Clone the repo

    git clone git@github.com:weaveworks/clusters-config.git
  2. Run the request-cluster script

    make request-cluster ARGS="--team <TEAM_NAME> --cluster-name <CLUSTER_NAME> --weave-mode <WEAVE_MODE> --delete-after 10"

    Note: We recommend using make instead of using the script path.

    For more options see this section, or run

    make request-cluster ARGS="--help"
  3. Add and commit your cluster directory then push the new branch

  4. Wait until the cluster is provisioned. It might take around 20~30 minutes. You can check your provisioning job in the actions tab.

  5. Join #clusters-config slack channel to get notified once the cluster is provisioned!

Get kubeconfig file:

NOTE: You have to wait until the cluster is provisioned before you get the kubeconfig file, otherwise you may get an error like this: Error: cannot perform Kubernetes API operations on cluster <CLUSTER_NAME> in "eu-north-1" region due to status "CREATING"

eksctl utils write-kubeconfig --region eu-north-1 --cluster <CLUSTER_NAME> --kubeconfig=$HOME/.kube/config

Create kubeconfig for leaf clusters

If you used --weave-mode leaf, you would need to create a kubeconfig file to use it to connect the leaf cluster with you management cluster.

To create the kubeconfig file, connect to your leaf cluster then run the following command:

make leaf-kubeconfig

The command will create a serviceaccount with cluster-admin access, then generates the kubeconfig file. The path of the file will be printed out.

Deploy Specific Version of WGE:

By default, flux will deploy the latest version of WGE and will reconcile new versions once released. To deploy specific release, use the --weave-version option.

make request-cluster ARGS="--cluster-name <CLUSTER_NAME> --weave-mode enterprise --weave-version <WEAVE_VERSION> --team <TEAM_NAME>"

Develop and test your feature branch of WGE!

You can deploy WGE from a feature branch and renconcile changes automatically. Use --weave-branch option while you are requesting the cluster.

make request-cluster ARGS="--cluster-name <CLUSTER_NAME> --weave-mode enterprise --weave-branch <BRANCH_NAME> --team <TEAM_NAME>"

Develop and test your feature branch of gitops OSS!

You can deploy gitops OSS from a feature branch and renconcile changes automatically. Use --oss-tag option while you are requesting the cluster.

make request-cluster ARGS="--cluster-name <CLUSTER_NAME> --weave-mode core --oss-tag <OSS_TAG> --team <TEAM_NAME>"

Note: There is no automatic build for gitops OSS feature branches. You should buid the image on you local laptop, tag the image, then push it to weaveworks/gitops-oss-prs dockerhub repository.

Accessing UI:

Every provisioned cluster has a domain registered along with it and this domain points to the UI service. You can access the UI by accessing the domain: <cluster_name>.eng-sandbox.weave.works

Access the UI using one of the following users::

  1. Basic auth:

    username = wego-admin
    password = password

    User have admin permission to all namespaces.

  2. Dex OIDC users: The following static users are created by default:

    User password Permission gitops Rpac enterprise Rbac
    admin@test.invalid password full access to all resources wego-admin wego-admin + gitops-reader
    admin-apps@test.invalid password full access to apps namespace only wego-admin wego-admin + gitops-reader "apps namespace only"
    ro@test.invalid password read-only access to all namespaces wego-readonly-role wego-readonly-role
    ro-apps@test.invalid password read-only access to apps namespace wego-readonly-role "apps namespace only" wego-readonly-role "apps namespace only"

Pipeline Controller UI:

By default, we will expose a URL for the pipeline controller. You can access it by using the following domain: promotions-<cluster_name>.eng-sandbox.weave.works

Cluster TTL (time to live):

Every cluster created by the request-cluster script runs for 7 days by default, then it will be auto deleted. To define the TTL in days, use --delete-after option while requesting the cluster. If you already provisioned your cluster, you can extend TTL.

Join #clusters-config slack channel to get notifications before ttl ends!

Extending your cluster TTL:

You can extend your cluster TTL by running:

  make extend-ttl ARGS="--cluster-name <CLUSTER_NAME> --extend <NUMBER_OF_DAYS_TO_EXTEND>"

Request cluster options:

Option Default Required Description
--cluster-name Yes Cluster's Name. It should be unique
--cluster-version 1.23 No Kubernetes cluster version
--weave-mode core No Select between installing WGE, WG-Core, leaf-cluster or not install any (enterprise
----oss-tag No Select a specific tag of OSS (works only with --weave-mode=core)
--weave-version No Select a specific released version (works only with --weave-mode=enterprise)
--weave-branch No Select a specific git branch for installation (works only with --weave-mode=enterprise). Note: You can't use both --weave-branch and --weave-version
--enable-flagger false No Flagger will be installed on the cluster (only available when --weave-mode=enterprise
--enable-policies false No Default policies will be installed on the cluster (only available when --weave-mode=enterprise
--delete-after 7 No Cluster will be auto deleted after this number of days
--team Yes Engineering team name

What does request-cluster script do?

  1. Check if the cluster is created before.
  2. Create a branch for the cluster, the branch is prefixed with "cluster-". If the branch was created before, it will fail.
  3. Create the cluster directory eksctl-clusters/clusters/<CLUSTER_NAME>.
  4. Copy eksctl cluster-config-file with default values to eksctl-clusters/clusters/<CLUSTER_NAME>/eksctl-cluster.yaml.
  5. Copy cluster kustomization files to eksctl-clusters/clusters/<CLUSTER_NAME>.