Karim:
Hi Team, I appreciate your input on the below. This is the pod defintion and looking at the definition it is using the default service account in the default namespace. The part that is doesn’t make sense to me is when I look at the token leveraging the kubectl describe secret and put it on the http://JWT.io|JWT.io website I can see some details of the token without any expiry vs if I run the command kubectl exec web-dashboard-767bc588bc-7rl29 – cat /var/run/secrets/kubernetes.io/serviceaccount/token & I put it in http://JWT.io|JWT.io I see expiry for the token. I am not able to make sense of it. Appreciate your input
- apiVersion: v1
kind: Pod
metadata:
creationTimestamp: "2022-09-29T18:10:09Z"
generateName: web-dashboard-767bc588bc-
labels:
name: web-dashboard
pod-template-hash: 767bc588bc
name: web-dashboard-767bc588bc-7rl29
namespace: default
ownerReferences:
- apiVersion: apps/v1
blockOwnerDeletion: true
controller: true
kind: ReplicaSet
name: web-dashboard-767bc588bc
uid: 7536e92e-2724-417a-bdc3-b755c4ac6482
resourceVersion: "2657"
uid: fd803b54-2c11-4d66-bfb1-856bd69d555d
spec:
containers:
- env:
- name: PYTHONUNBUFFERED
value: "1"
image: <http://gcr.io/kodekloud/customimage/my-kubernetes-dashboard|gcr.io/kodekloud/customimage/my-kubernetes-dashboard>
imagePullPolicy: Always
name: web-dashboard
ports:
- containerPort: 8080
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: kube-api-access-2jw8r
readOnly: true
dnsPolicy: ClusterFirst
enableServiceLinks: true
nodeName: controlplane
preemptionPolicy: PreemptLowerPriority
priority: 0
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: default
serviceAccountName: default
terminationGracePeriodSeconds: 30
tolerations:
- effect: NoExecute
key: <http://node.kubernetes.io/not-ready|node.kubernetes.io/not-ready>
operator: Exists
tolerationSeconds: 300
- effect: NoExecute
key: <http://node.kubernetes.io/unreachable|node.kubernetes.io/unreachable>
operator: Exists
tolerationSeconds: 300
volumes:
- name: kube-api-access-2jw8r
projected:
defaultMode: 420
sources:
- serviceAccountToken:
expirationSeconds: 3607
path: token
- configMap:
items:
- key: ca.crt
path: ca.crt
name: kube-root-ca.crt
- downwardAPI:
items:
- fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
path: namespace