Welcome to the Linux Foundation Forum!

Section 7 page 7

Posts: 12
edited November 2023 in LFS258 Class Forum

template:spec:containers.0.name is not the leading stub of the pod name as outlined in the name element on page 7 in section 7:

The leading stub of the Pod names. A unique string will be appended.

See my example below:

  1. $ cat pod-name.yaml \
  2. && kubectl create -f pod-name.yaml \
  3. && sleep 30 \
  4. && kubectl get deployments.apps \
  5. && kubectl get pods
  6. apiVersion: apps/v1
  7. kind: Deployment
  8. metadata:
  9. labels:
  10. app: app-label
  11. name: deployment-name
  12. namespace: default
  13. spec:
  14. replicas: 1
  15. selector:
  16. matchLabels:
  17. app: app-label
  18. strategy:
  19. type: RollingUpdate
  20. template:
  21. metadata:
  22. labels:
  23. app: app-label
  24. spec:
  25. containers:
  26. - image: nginx
  27. imagePullPolicy: Always
  28. name: container-name
  29. ports:
  30. - containerPort: 80
  31. protocol: TCP
  32. resources: {}
  33. restartPolicy: Always
  34. deployment.apps/deployment-name created
  35. NAME READY UP-TO-DATE AVAILABLE AGE
  36. deployment-name 1/1 1 1 30s
  37. NAME READY STATUS RESTARTS AGE
  38. deployment-name-7fd486f7c5-dv9g4 1/1 Running 0 30s

The container name must be used for certain sub commands as parameter value for --container, e.g. kubectl logs or kubectl exec, if you have more than one container in your deployments containers element.

Please update or clarify the name element on page 7 in section 7.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training