webhook-deployment.yaml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ include "external-secrets.fullname" . }}-webhook
  5. namespace: {{ .Release.Namespace | quote }}
  6. labels:
  7. {{- include "external-secrets-webhook.labels" . | nindent 4 }}
  8. {{- with .Values.webhook.deploymentAnnotations }}
  9. annotations:
  10. {{- toYaml . | nindent 4 }}
  11. {{- end }}
  12. spec:
  13. replicas: {{ .Values.webhook.replicaCount }}
  14. selector:
  15. matchLabels:
  16. {{- include "external-secrets-webhook.selectorLabels" . | nindent 6 }}
  17. template:
  18. metadata:
  19. {{- with .Values.webhook.podAnnotations }}
  20. annotations:
  21. {{- toYaml . | nindent 8 }}
  22. {{- end }}
  23. labels:
  24. {{- include "external-secrets-webhook.selectorLabels" . | nindent 8 }}
  25. {{- with .Values.webhook.podLabels }}
  26. {{- toYaml . | nindent 8 }}
  27. {{- end }}
  28. spec:
  29. {{- with .Values.webhook.imagePullSecrets }}
  30. imagePullSecrets:
  31. {{- toYaml . | nindent 8 }}
  32. {{- end }}
  33. serviceAccountName: {{ include "external-secrets-webhook.serviceAccountName" . }}
  34. {{- with .Values.webhook.podSecurityContext }}
  35. securityContext:
  36. {{- toYaml . | nindent 8 }}
  37. {{- end }}
  38. containers:
  39. - name: webhook
  40. {{- with .Values.webhook.securityContext }}
  41. securityContext:
  42. {{- toYaml . | nindent 12 }}
  43. {{- end }}
  44. image: "{{ .Values.webhook.image.repository }}:{{ .Values.webhook.image.tag | default .Chart.AppVersion }}"
  45. imagePullPolicy: {{ .Values.webhook.image.pullPolicy }}
  46. args:
  47. - webhook
  48. - --dns-name={{ include "external-secrets.fullname" . }}-webhook.{{ .Release.Namespace }}.svc
  49. - --cert-dir={{ .Values.webhook.certDir }}
  50. - --check-interval={{ .Values.webhook.certCheckInterval }}
  51. {{- range $key, $value := .Values.webhook.extraArgs }}
  52. {{- if $value }}
  53. - --{{ $key }}={{ $value }}
  54. {{- else }}
  55. - --{{ $key }}
  56. {{- end }}
  57. {{- end }}
  58. ports:
  59. - containerPort: {{ .Values.webhook.prometheus.service.port }}
  60. protocol: TCP
  61. name: metrics
  62. - containerPort: 9443
  63. protocol: TCP
  64. name: webhook
  65. readinessProbe:
  66. tcpSocket:
  67. port: 9443
  68. initialDelaySeconds: 20
  69. periodSeconds: 5
  70. {{- with .Values.webhook.extraEnv }}
  71. env:
  72. {{- toYaml . | nindent 12 }}
  73. {{- end }}
  74. {{- with .Values.webhook.resources }}
  75. resources:
  76. {{- toYaml . | nindent 12 }}
  77. {{- end }}
  78. volumeMounts:
  79. - name: certs
  80. mountPath: {{ .Values.webhook.certDir }}
  81. readOnly: true
  82. volumes:
  83. - name: certs
  84. secret:
  85. secretName: {{ include "external-secrets.fullname" . }}-webhook
  86. {{- with .Values.webhook.nodeSelector }}
  87. nodeSelector:
  88. {{- toYaml . | nindent 8 }}
  89. {{- end }}
  90. {{- with .Values.webhook.affinity }}
  91. affinity:
  92. {{- toYaml . | nindent 8 }}
  93. {{- end }}
  94. {{- with .Values.webhook.tolerations }}
  95. tolerations:
  96. {{- toYaml . | nindent 8 }}
  97. {{- end }}
  98. {{- if .Values.webhook.priorityClassName }}
  99. priorityClassName: {{ .Values.webhook.priorityClassName }}
  100. {{- end }}