- Notifications
You must be signed in to change notification settings - Fork3.4k
Description
What happened (please include outputs or screenshots):
#2298 /#2303 implemented theprovideClusterInfo
.
It misses this part (fromhttps://kubernetes.io/docs/reference/config-api/client-authentication.v1/#client-authentication-k8s-io-v1-Cluster):
Config holds additional config data that is specific to the exec plugin with regards to the cluster being authenticated to.
This data is sourced from the clientcmd Cluster object's extensions[client.authentication.k8s.io/exec] field:
...
...
What you expected to happen:
client.authentication.k8s.io/exec
extension is set toExecCredentialSpec.Cluster.config
so thatgardenlogin can use it
How to reproduce it (as minimally and precisely as possible):
Unfortunately I only know how to reproduce it with aGardener Kubernetes setup.
Setup the KUBECONFIG environment:
gardenctl target --garden xxx --project xxx --shoot xxx
eval $(gardenctl kubectl-env zsh)
-> this sets KUBECONFIG to a file, that looks like this:https://github.com/gardener/gardenlogin/blob/42df32af80451062f81c015c5e89a109c821e463/README.md?plain=1#L86-L99
Then run following script:
fromkubernetesimportclient,config# Configs can be set in Configuration class directly or using helper utilityconfig.load_kube_config()v1=client.CoreV1Api()print("Listing pods with their IPs:")ret=v1.list_namespaced_pod(namespace="default",watch=False)foriinret.items:print("%s\t%s\t%s"% (i.status.pod_ip,i.metadata.namespace,i.metadata.name))
You'll get an error:
'ERROR:root:exec: process returned 1. Error: name must be specified. Hint: update kubectl in case you are using a version older than v1.20.0Usage: gardenlogin get-client-certificate [flags]Flags:...
Anything else we need to know?:
Environment:
- Kubernetes version (
kubectl version
): - OS (e.g., MacOS 10.13.6):
- Python version (
python --version
) - Python client version (
pip list | grep kubernetes
)