geodesic icon indicating copy to clipboard operation
geodesic copied to clipboard

Feat: support tenant label in `eks-update-kubeconfig`

Open korenyoni opened this issue 3 years ago • 3 comments

what

  • Support optional tenant label in eks-update-kubeconfig

why

  • null-label supports an optional tenant label, however eks-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

korenyoni avatar Sep 20 '21 18:09 korenyoni

I need to reformat — some tabs / spaces inconsistencies in indentation

korenyoni avatar Sep 20 '21 18:09 korenyoni

Tested this again in both an environment without a tenant label and one with.

korenyoni avatar Oct 06 '21 13:10 korenyoni

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
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

korenyoni avatar Nov 04 '21 20:11 korenyoni

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.

Nuru avatar Jun 29 '23 07:06 Nuru