Allow kubernetes_service
to serve only dynamic kube cluster resources
#49332
Labels
kubernetes_service
to serve only dynamic kube cluster resources
#49332
Expected Behavior
Helm chart for
teleport-kube-agent
should support service dynamic clusters only.Teleport itself supports this already. A valid
kuberenetes_service
section doesn't needkube_cluster_name
orkubeconfig_file
if it has alabels
section. The chart should be able to produce ateleport.yaml
withlabels
only, if the user has that use case.Current Behavior
The
kube_cluster_name
is always set in theteleport.yaml
generated by the chart. In a case where a user has bothdiscovery_service
andkubernetes_service
, the discovery service can incorporate EKS tags into the labels of the dynamic cluster. If the dynamic object has the same name as thekube_cluster_name
, then the dynamic object will be skipped/ignored from the user's perspective.Use Case
For EKS auto-discovery, this can be confusing for the end-user:
actual output:
expected:
In this example, the
dev-eks-2
is running the discovery+kube agent. It haskubeClusterName: dev-eks-2
. The dynamic object fordev-eks-2
isn't loaded. If the dynamicdev-eks-2
object were loaded, it would show the AWS tag-derived labels.Workarounds
Instead of setting
kubeClusterName: dev-eks-2
in the helm values, an alternate name could be specified. Teleport RBAC could deny users from seeing the alternate name, allowing the discovered object to come through.Manually edit the generated ConfigMap to remove
kube_cluster_name
fromteleport.yaml
. TheMustMergeOverwrite
helm function that theteleport-kube-agent
chart uses to specifyteleport.yaml
overrides cannot remove the key fromkubernetes_service
.The text was updated successfully, but these errors were encountered: