-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webhook): mutating webhook manifests (#12)
* feat(webhook): mutating webhook manifests * chore: version bump * inbound ports and merge conflicts * fix: annotations in the wrong place
- Loading branch information
1 parent
daa0b87
commit 430da7a
Showing
8 changed files
with
972 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
charts/account-operator/templates/webhook/mutation-webhook.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- if .Values.webhooks.enabled -}} | ||
apiVersion: admissionregistration.k8s.io/v1 | ||
kind: MutatingWebhookConfiguration | ||
metadata: | ||
name: {{ include "entity.name" . }}-mutating-webhook-configuration | ||
annotations: | ||
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "entity.name" . }}-serving-cert | ||
webhooks: | ||
- admissionReviewVersions: | ||
- v1 | ||
clientConfig: | ||
service: | ||
name: {{ include "entity.name" . }}-webhook | ||
namespace: {{ .Release.Namespace }} | ||
path: /mutate-core-openmfp-io-v1alpha1-account | ||
failurePolicy: Fail | ||
name: maccount.kb.io | ||
rules: | ||
- apiGroups: | ||
- core.openmfp.io | ||
apiVersions: | ||
- v1alpha1 | ||
operations: | ||
- CREATE | ||
resources: | ||
- accounts | ||
sideEffects: None | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{{- if .Values.webhooks.enabled -}} | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: {{ include "entity.name" . }}-selfsigned-issuer | ||
namespace: {{ .Release.namespace }} | ||
spec: | ||
selfSigned: {} | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: {{ include "entity.name" . }}-serving-cert | ||
namespace: {{ .Release.namespace }} | ||
spec: | ||
dnsNames: | ||
- {{ include "entity.name" . }}-webhook.{{ .Release.Namespace }}.svc | ||
- {{ include "entity.name" . }}-webhook.{{ .Release.Namespace }}.svc.cluster.local | ||
issuerRef: | ||
kind: Issuer | ||
name: selfsigned-issuer | ||
secretName: {{ include "entity.name" . }}-webhook-server-cert | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- if .Values.webhooks.enabled -}} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "entity.name" . }}-webhook | ||
namespace: system | ||
spec: | ||
ports: | ||
- port: 443 | ||
protocol: TCP | ||
targetPort: 9443 | ||
selector: | ||
service: {{ include "entity.name" . }} | ||
control-plane: controller-manager | ||
{{- end -}} |
Oops, something went wrong.