nginx-pod.yaml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # This is a Pod and not a Deployment because there is intended to only be one running
  2. apiVersion: apps/v1
  3. kind: Pod
  4. metadata:
  5. name: multus-validation-test-web-server
  6. labels:
  7. app: multus-validation-test-web-server
  8. app.kubernetes.io/name: "nginx"
  9. app.kubernetes.io/instance: "nginx" # there is only one instance
  10. app.kubernetes.io/component: "server"
  11. app.kubernetes.io/part-of: "multus-validation-test"
  12. app.kubernetes.io/managed-by: "rook-cli"
  13. annotations:
  14. k8s.v1.cni.cncf.io/networks: "{{ .NetworksAnnotationValue }}"
  15. spec:
  16. nodeSelector:
  17. {{- range $k, $v := .Placement.NodeSelector }}
  18. {{ $k }}: {{ $v }}
  19. {{- end }}
  20. tolerations:
  21. {{- range $idx, $toleration := .Placement.Tolerations }}
  22. - {{ $toleration.ToJSON }}
  23. {{- end }}
  24. securityContext:
  25. runAsNonRoot: true
  26. runAsUser: 101
  27. runAsGroup: 101
  28. seccompProfile:
  29. type: RuntimeDefault
  30. containers:
  31. - name: multus-validation-test-web-server
  32. image: "{{ .NginxImage }}"
  33. resources: {}
  34. ports:
  35. - containerPort: 8080
  36. readinessProbe:
  37. httpGet:
  38. port: 8080
  39. scheme: HTTP
  40. securityContext:
  41. allowPrivilegeEscalation: false
  42. capabilities:
  43. drop:
  44. - "ALL"
  45. volumeMounts:
  46. - name: var-cache-nginx
  47. mountPath: /var/cache/nginx
  48. - name: server-conf
  49. mountPath: /etc/nginx/conf.d
  50. - name: var-run
  51. mountPath: /var/run
  52. volumes:
  53. - name: var-cache-nginx
  54. emptyDir: {}
  55. - name: server-conf
  56. configMap:
  57. name: multus-validation-test-web-server-conf
  58. - name: var-run
  59. emptyDir: {}