Open hrmcardle0 opened 7 months ago
Page mentioned in issue: https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/ /language en
/retitle Outdated default service account token secret instructions in "Access Clusters Using the Kubernetes API' page
/sig auth
/kind bug /triage accepted /priority backlog
/assign
Hello @hrmcardle0. i've just tested the instructions on page https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/ with a 1.30 cluster and they seem to work...
kubectl version
Client Version: v1.30.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.0
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: default-token
annotations:
kubernetes.io/service-account.name: default
type: kubernetes.io/service-account-token
EOF
secret/default-token created
kubectl get secret default-token
NAME TYPE DATA AGE
default-token kubernetes.io/service-account-token 3 3m50s
TOKEN=$(kubectl get secret default-token -o jsonpath='{.data.token}' | base64 --decode)
curl -X GET $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
{
"kind": "APIVersions",
"versions": [
"v1"
],
"serverAddressByClientCIDRs": [
{
"clientCIDR": "0.0.0.0/0",
"serverAddress": "172.18.0.2:6443"
}
]
}%
Can you try again and provide the outputs of your commands? If these instructions still work, I think we could close this issue.
Thanks!
In the 'without kubectl proxy', the section on https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/:
Create a secret to hold a token for the default service account
kubectl apply -f - <<EOF apiVersion: v1 kind: Secret metadata: name: default-token annotations: kubernetes.io/service-account.name: default type: kubernetes.io/service-account-token EOF
This is apparently not a thing anymore since 1.22. I attempted it on v1.27 and despite there being no error message, the secret does not exist.