Skip to content

Commit

Permalink
More configuration options for the validatingwebhookconfiguration (#64)
Browse files Browse the repository at this point in the history
* chore: complete validatingwebhookconfiguration

The validating webhook configuration is missing some fields,
which are automatically completed by k8s. Those missing fields can sometimes mess up gitops operators, which strictly check which fields are present or not

Signed-off-by: Bruno Bressi <[email protected]>

* chore: added more fields & default values

Signed-off-by: Bruno Bressi <[email protected]>

* fix: readded objectSelector in the correct place

Signed-off-by: Bruno Bressi <[email protected]>

* chore: bumped to stable

Signed-off-by: Bruno Bressi <[email protected]>

* chore: removed unneeded docker variables

Signed-off-by: Bruno Bressi <[email protected]>

---------

Signed-off-by: Bruno Bressi <[email protected]>
  • Loading branch information
puffitos authored Nov 14, 2024
1 parent 4e18454 commit 712208a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# build stage
FROM golang:1.23 AS build-env
WORKDIR /app
COPY . /app
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,16 @@ e2e-cleanup:
@k3d cluster delete cosign-tests || echo "Deleting cosign tests k3d cluster failed. Continuing..."
@rm -f cosign.pub cosign.key second.pub second.key || echo "Removing files failed. Continuing..."
@echo "Done."

#############
### CHART ###
#############

.PHONY: chart-lint chart
chart-lint:
@echo "Linting chart..."
@helm lint chart

chart:
@echo "Packaging chart..."
@helm package chart
14 changes: 7 additions & 7 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apiVersion: v2
name: cosignwebhook
description: A Helm chart for Cosign Webhook Admission Controller
type: application
version: 4.1.0
version: 4.1.1
appVersion: "4.3.0"
maintainers:
- name: eumel8
email: [email protected]
url: https://www.telekom.com
- name: puffitos
email: [email protected]
url: https://www.telekom.com
- name: eumel8
email: [email protected]
url: https://www.telekom.com
- name: puffitos
email: [email protected]
url: https://www.telekom.com
5 changes: 5 additions & 0 deletions chart/templates/admission.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ webhooks:
- admissionReviewVersions:
- v1
name: {{ .Values.admission.webhook.name }}
matchPolicy: {{ .Values.admission.matchPolicy }}
namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
Expand All @@ -31,11 +32,15 @@ webhooks:
name: {{ include "cosignwebhook.fullname" . }}
namespace: {{ .Release.Namespace | default "default" }}
path: "/validate"
port: 443
caBundle: {{ $ca.Cert | b64enc }}
rules:
- operations: ["CREATE","UPDATE"]
apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
scope: "*"
objectSelector: {}
failurePolicy: {{ .Values.admission.failurePolicy }}
sideEffects: {{ .Values.admission.sideEffects }}
timeoutSeconds: {{ .Values.admission.timeoutSeconds }}
3 changes: 3 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ admission:
name: webhook.example.com
# list of excluded namespaces, comma-separated
# exclude: default, kube-system, cattle-system
exclude: ""
matchPolicy: Equivalent
timeoutSeconds: 10

podAnnotations: {}

Expand Down

0 comments on commit 712208a

Please sign in to comment.