validatingwebhook.yaml 2.8 KB

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