Skip to content

Commit e5964da

Browse files
authored
Add docs on getting a tenant cluster's kubeconfig (azimuth-cloud#155)
* Add docs on getting a tenant cluster's kubeconfig * Wording updates and code formatting
1 parent 7606ef0 commit e5964da

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/debugging/kubernetes.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,31 @@ kubectl -n capo-system logs deploy/capo-controller-manager
167167
kubectl -n capi-addon-system logs deploy/cluster-api-addon-provider
168168
```
169169

170+
## Accessing tenant clusters
171+
172+
The kubeconfigs for all tenant clusters are stored as secrets. First, you need
173+
to find the name and namespace of the cluster you want to debug. This can be
174+
seen from the list of clusters:
175+
176+
```command title="On the K3s node, targetting the HA cluster if deployed"
177+
$ kubectl get cluster -A
178+
```
179+
180+
Then, you can retrieve and decode the kubeconfig with the following:
181+
182+
```command title="On the K3s node, targetting the HA cluster if deployed"
183+
$ kubectl -n <namespace> get secret <clustername>-kubeconfig -o json | \
184+
jq -r '.data.value' | \
185+
base64 -d \
186+
> kubeconfig-tenant.yaml
187+
```
188+
189+
This can now be used by exporting the path to this file:
190+
191+
```command title="On the K3s node, targetting the HA cluster if deployed"
192+
$ export KUBECONFIG=kubeconfig-tenant.yaml
193+
```
194+
170195
## Zenith service issues
171196

172197
Zenith services are enabled on Kubernetes clusters using the

0 commit comments

Comments
 (0)