Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
369 views
in Technique[技术] by (71.8m points)

kubernetes - Why doesn't the label "version" appear in running pod json?

kubectl get pod pod_name -n namespace_name -o json shows:

"labels": {
    "aadpodidbinding": "sa-customerxyz-uat-msi",
    "app": "cloudsitemanager",
    "customer": "customerxyz",
    "istio.io/rev": "default",
    "pod-template-hash": "b87d9fcbf",
    "security.istio.io/tlsMode": "istio",
    "service.istio.io/canonical-name": "cloudsitemanager",
    "service.istio.io/canonical-revision": "latest"
}

I am deploying with the following manifest yaml snippet:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: cloudsitemanager
  labels:
    app: cloudsitemanager
    customer: customerxyz
    version: 0.1.0-beta.201
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cloudsitemanager
      customer: customerxyz
  template:
    metadata:
      labels:
        app: cloudsitemanager
        customer: customerxyz
        version: 0.1.0-beta.201
        aadpodidbinding: sa-customerxyz-uat-msi

I expect to see 4 custom labels in the running pod manifest: app, customer, version, aadpodidbinding. However, I only see 3 of the custom labels. The label "version" does not show.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...