geodesic
geodesic copied to clipboard
Feat: support tenant label in `eks-update-kubeconfig`
what
- Support optional tenant label in
eks-update-kubeconfig
why
-
null-label
supports an optionaltenant
label, howevereks-update-kubeconfig
does not. - Misc: add additional help documentation explaining how to have a single kubeconfig file with multiple contexts, rather than a separate file for each context.
references
- https://github.com/cloudposse/terraform-null-label/releases/tag/0.25.0
- requires https://github.com/cloudposse/atmos/pull/71
- https://github.com/cloudposse/atmos/releases/tag/v1.3.4
tests
NOTE: outdated, see comments below
with tenant label
eks-update-kubeconfig mgmt-uw2-sandbox
Updated context arn:aws:eks:us-west-2:[REDACTED]:cluster/[REDACTED]-mgmt-uw2-sandbox-eks-cluster in /conf/.kube/kubecfg.mgmt-uw2-sandbox-admin
without tenant label
eks-update-kubeconfig ue1-sandbox
Added new context arn:aws:eks:us-east-1:[REDACTED]:cluster/[REDACTED]-ue1-sandbox-eks-cluster to /conf/.kube/kubecfg.ue1-sandbox-admin
I need to reformat — some tabs / spaces inconsistencies in indentation
Tested this again in both an environment without a tenant
label and one with.
Updated and tested manually:
with atmos
$ eks-update-kubeconfig ue1-sandbox
WARNING:
The current version of atmos is 0.21.3 (a32a4a4), and the minimum version required to determine if the 'tenant' label
is being used is v1.3.4. Because of this, it is assumed 'tenant' is not used. If you would like to use the 'tenant' label,
update atmos to v1.3.4 or above.
Updated context arn:aws:eks:us-east-1:[REDACTED]:cluster/eg-ue1-sandbox-eks-cluster in /conf/.kube/kubecfg.ue1-sandbox-admin
$ eks-update-kubeconfig ue1-sandbox
WARNING:
The current version of atmos is 0.21.3 (a32a4a4), and the minimum version required to determine if the 'tenant' label
is being used is v1.3.4. Because of this, it is assumed 'tenant' is not used. If you would like to use the 'tenant' label,
update atmos to v1.3.4 or above.
Updated context arn:aws:eks:us-east-1:[REDACTED]:cluster/eg-ue1-sandbox-eks-cluster in /conf/.kube/kubecfg.ue1-sandbox-admin
with atmos >= 1.3.4 in environment without the tenant label
$ eks-update-kubeconfig ue1-sandbox
Updated context arn:aws:eks:us-east-1:[REDACTED]:cluster/eg-ue1-sandbox-eks-cluster in /conf/.kube/kubecfg.ue1-sandbox-admin
with atmos >= 1.3.4 in environment with the tenant label
$ eks-update-kubeconfig mgmt-uw2-sandbox
Updated context arn:aws:eks:us-west-2:[REDACTED]:cluster/eg-mgmt-uw2-sandbox-eks-cluster in /conf/.kube/kubecfg.mgmt-uw2-sandbox-admin
Closing as wontfix
not because we will not support tenant names in EKS clusters, but because we will address this eventually by moving the functionality to Atmos and until then by customizing the script per-organization as needed.