deployment.yaml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ template "openshift-console-plugin.name" . }}
  5. namespace: {{ .Release.Namespace }}
  6. labels:
  7. {{- include "openshift-console-plugin.labels" . | nindent 4 }}
  8. app.openshift.io/runtime-namespace: {{ .Release.Namespace }}
  9. spec:
  10. replicas: {{ .Values.plugin.replicas }}
  11. selector:
  12. matchLabels:
  13. {{- include "openshift-console-plugin.selectorLabels" . | nindent 6 }}
  14. template:
  15. metadata:
  16. labels:
  17. {{- include "openshift-console-plugin.labels" . | nindent 8 }}
  18. spec:
  19. {{- with .Values.plugin.imagePullSecrets }}
  20. imagePullSecrets:
  21. {{- toYaml . | nindent 8 }}
  22. {{- end }}
  23. containers:
  24. - name: {{ template "openshift-console-plugin.name" . }}
  25. image: {{ required "Plugin image must be specified!" .Values.plugin.image }}
  26. ports:
  27. - containerPort: {{ .Values.plugin.port }}
  28. protocol: TCP
  29. imagePullPolicy: {{ .Values.plugin.imagePullPolicy }}
  30. {{- if and (.Values.plugin.securityContext.enabled) (.Values.plugin.containerSecurityContext) }}
  31. securityContext: {{ tpl (toYaml (omit .Values.plugin.containerSecurityContext "enabled")) $ | nindent 12 }}
  32. {{- end }}
  33. resources:
  34. {{- toYaml .Values.plugin.resources | nindent 12 }}
  35. volumeMounts:
  36. - name: {{ template "openshift-console-plugin.certificateSecret" . }}
  37. readOnly: true
  38. mountPath: /var/cert
  39. - name: nginx-conf
  40. readOnly: true
  41. mountPath: /etc/nginx/nginx.conf
  42. subPath: nginx.conf
  43. volumes:
  44. - name: {{ template "openshift-console-plugin.certificateSecret" . }}
  45. secret:
  46. secretName: {{ template "openshift-console-plugin.certificateSecret" . }}
  47. defaultMode: 420
  48. - name: nginx-conf
  49. configMap:
  50. name: {{ template "openshift-console-plugin.name" . }}
  51. defaultMode: 420
  52. restartPolicy: Always
  53. dnsPolicy: ClusterFirst
  54. {{- if and (.Values.plugin.securityContext.enabled) (.Values.plugin.podSecurityContext) }}
  55. securityContext: {{ tpl (toYaml (omit .Values.plugin.podSecurityContext "enabled")) $ | nindent 8 }}
  56. {{- end }}
  57. strategy:
  58. type: RollingUpdate
  59. rollingUpdate:
  60. maxUnavailable: 25%
  61. maxSurge: 25%