validatingwebhook.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {{- if .Values.webhook.create }}
  2. apiVersion: admissionregistration.k8s.io/v1
  3. kind: ValidatingWebhookConfiguration
  4. metadata:
  5. name: secretstore-validate
  6. labels:
  7. external-secrets.io/component: webhook
  8. {{- with .Values.commonLabels }}
  9. {{ toYaml . | nindent 4 }}
  10. {{- end }}
  11. {{- if and .Values.webhook.certManager.enabled .Values.webhook.certManager.addInjectorAnnotationsFromSecret }}
  12. annotations:
  13. cert-manager.io/inject-ca-from-secret: {{ .Release.Namespace }}/{{ template "external-secrets-webhook.certSecretName" . }}
  14. {{- else if and .Values.webhook.certManager.enabled .Values.webhook.certManager.addInjectorAnnotations }}
  15. annotations:
  16. cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "external-secrets.fullname" . }}-webhook
  17. {{- end }}
  18. webhooks:
  19. - name: "validate.secretstore.external-secrets.io"
  20. rules:
  21. - apiGroups: ["external-secrets.io"]
  22. apiVersions: ["v1beta1"]
  23. operations: ["CREATE", "UPDATE", "DELETE"]
  24. resources: ["secretstores"]
  25. scope: "Namespaced"
  26. clientConfig:
  27. service:
  28. namespace: {{ .Release.Namespace | quote }}
  29. name: {{ include "external-secrets.fullname" . }}-webhook
  30. path: /validate-external-secrets-io-v1beta1-secretstore
  31. admissionReviewVersions: ["v1", "v1beta1"]
  32. sideEffects: None
  33. timeoutSeconds: 5
  34. - name: "validate.clustersecretstore.external-secrets.io"
  35. rules:
  36. - apiGroups: ["external-secrets.io"]
  37. apiVersions: ["v1beta1"]
  38. operations: ["CREATE", "UPDATE", "DELETE"]
  39. resources: ["clustersecretstores"]
  40. scope: "Cluster"
  41. clientConfig:
  42. service:
  43. namespace: {{ .Release.Namespace | quote }}
  44. name: {{ include "external-secrets.fullname" . }}-webhook
  45. path: /validate-external-secrets-io-v1beta1-clustersecretstore
  46. admissionReviewVersions: ["v1", "v1beta1"]
  47. sideEffects: None
  48. timeoutSeconds: 5
  49. ---
  50. apiVersion: admissionregistration.k8s.io/v1
  51. kind: ValidatingWebhookConfiguration
  52. metadata:
  53. name: externalsecret-validate
  54. labels:
  55. external-secrets.io/component: webhook
  56. {{- with .Values.commonLabels }}
  57. {{ toYaml . | nindent 4 }}
  58. {{- end }}
  59. {{- if and .Values.webhook.certManager.enabled .Values.webhook.certManager.addInjectorAnnotationsFromSecret }}
  60. annotations:
  61. cert-manager.io/inject-ca-from-secret: {{ .Release.Namespace }}/{{ template "external-secrets-webhook.certSecretName" . }}
  62. {{- else if and .Values.webhook.certManager.enabled .Values.webhook.certManager.addInjectorAnnotations }}
  63. annotations:
  64. cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "external-secrets.fullname" . }}-webhook
  65. {{- end }}
  66. webhooks:
  67. - name: "validate.externalsecret.external-secrets.io"
  68. rules:
  69. - apiGroups: ["external-secrets.io"]
  70. apiVersions: ["v1beta1"]
  71. operations: ["CREATE", "UPDATE", "DELETE"]
  72. resources: ["externalsecrets"]
  73. scope: "Namespaced"
  74. clientConfig:
  75. service:
  76. namespace: {{ .Release.Namespace | quote }}
  77. name: {{ include "external-secrets.fullname" . }}-webhook
  78. path: /validate-external-secrets-io-v1beta1-externalsecret
  79. admissionReviewVersions: ["v1", "v1beta1"]
  80. sideEffects: None
  81. timeoutSeconds: 5
  82. failurePolicy: {{ .Values.webhook.failurePolicy}}
  83. {{- end }}