Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc/gardenctl config #163

Merged
merged 8 commits into from
Oct 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
not quite there yet
  • Loading branch information
etiennnr authored and petersutter committed Oct 21, 2022
commit 11139a97631e23aea3b82aa6473b9e752bb10cd4
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,19 @@ You can modify this file directly using the `gardenctl config` command. It allow
Example `config` command:
``` bash
# Adapt the path to your kubeconfig file for the garden cluster
export KUBECONFIG=~/relative/path/to/kubeconfig.yaml
export KUBECONFIG=~/relative/path/to/kubeconfig.yaml

# Fetch cluster-identity of garden cluster
CLUSTER_IDENTITY=$(kubectl -n kube-system get configmap cluster-identity -ojsonpath={.data.cluster-identity})
# Method 1 : Fetch cluster-identity of garden cluster from the configmap
❯ export CLUSTER_IDENTITY=$(kubectl -n kube-system get configmap cluster-identity -ojsonpath={.data.cluster-identity})
# OR
# Method 2 : If you don't have access to the kube-system namespace in the garden, the garden cluster-identity is also available in every shoot's
❯ export SHOOT_UID=$(kubectl get shoot -n garden-my-project my-shoot -ojsonpath={.metadata.uid})
❯ export PREFIX="shoot--my-project--my-shoot-$SHOOT_UID-"
❯ kubectl -n garden-my-project get shoot my-shoot -ojsonpath={.status.clusterIdentity}
❯ export CLUSTER_IDENTITY="landscape-dev" # difference between both

# Configure garden cluster
gardenctl config set-garden $CLUSTER_IDENTITY --kubeconfig $KUBECONFIG
gardenctl config set-garden $CLUSTER_IDENTITY --kubeconfig $KUBECONFIG
```
This command will create or update a garden with the provided identity and kubeconfig path of your garden cluster.

Expand Down