Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ echo 'running helm unittest...'
helm unittest .

echo 'running helm schema generate...'
helm schema -f values.yaml -o values.schema.json
helm schema -f values.yaml -o values.schema.json
git add values.schema.json
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,11 @@ CRDs are located in `chart/crds/` and are installed automatically. The API group
| `metricsService.ports[0].targetPort` | Container target port | `8443` |
| `metricsService.ports[0].protocol` | Protocol | `TCP` |

### Webhook Service
### Webhooks

| Parameter | Description | Default |
|-----------|-------------|---------|
| `webhooks.enabled` | Enable or disable all Kubernetes admission webhook resources (ValidatingWebhookConfiguration, webhook Service, TLS Certificate, Issuer, and NetworkPolicy). Also sets the `ENABLE_WEBHOOKS` env var on the controller. | `true` |
| `webhookService.type` | Service type for the webhook endpoint | `ClusterIP` |
| `webhookService.ports[0].port` | Service port | `443` |
| `webhookService.ports[0].targetPort` | Container target port | `9443` |
Expand Down
2 changes: 2 additions & 0 deletions templates/allow-webhook-traffic.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.webhooks.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand All @@ -19,3 +20,4 @@ spec:
control-plane: controller-manager
policyTypes:
- Ingress
{{- end }}
8 changes: 8 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ spec:
value: {{ .Values.controllerManager.appCredentialsSecretNamespace | default .Release.Namespace | quote }}
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ quote .Values.kubernetesClusterDomain }}
- name: ENABLE_WEBHOOKS
value: {{ .Values.webhooks.enabled | quote }}
envFrom:
- configMapRef:
name: {{ include "git-hubby.fullname" . }}-envs
Expand All @@ -54,10 +56,12 @@ spec:
initialDelaySeconds: 15
periodSeconds: 20
name: manager
{{- if .Values.webhooks.enabled }}
ports:
- containerPort: 9443
name: webhook-server
protocol: TCP
{{- end }}
readinessProbe:
httpGet:
path: /readyz
Expand All @@ -68,10 +72,12 @@ spec:
}}
securityContext: {{- toYaml .Values.controllerManager.manager.containerSecurityContext
| nindent 10 }}
{{- if .Values.webhooks.enabled }}
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: webhook-certs
readOnly: true
{{- end }}
nodeSelector: {{- toYaml .Values.controllerManager.nodeSelector | nindent 8 }}
securityContext: {{- toYaml .Values.controllerManager.podSecurityContext | nindent
8 }}
Expand All @@ -92,7 +98,9 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.webhooks.enabled }}
volumes:
- name: webhook-certs
secret:
secretName: webhook-server-certificate
{{- end }}
2 changes: 2 additions & 0 deletions templates/selfsigned-issuer.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.webhooks.enabled }}
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
Expand All @@ -6,3 +7,4 @@ metadata:
{{- include "git-hubby.labels" . | nindent 4 }}
spec:
selfSigned: {}
{{- end }}
2 changes: 2 additions & 0 deletions templates/serving-cert.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.webhooks.enabled }}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand Down Expand Up @@ -30,4 +31,5 @@ spec:
usages:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}

2 changes: 2 additions & 0 deletions templates/validating-webhook-configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.webhooks.enabled }}
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
Expand Down Expand Up @@ -49,3 +50,4 @@ webhooks:
resources:
- repositories
sideEffects: None
{{- end }}
2 changes: 2 additions & 0 deletions templates/webhook-service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.webhooks.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -11,3 +12,4 @@ spec:
{{- include "git-hubby.selectorLabels" . | nindent 4 }}
ports:
{{- .Values.webhookService.ports | toYaml | nindent 2 }}
{{- end }}
8 changes: 8 additions & 0 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,14 @@
"type": "string"
}
}
},
"webhooks": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
}
}
}
}
2 changes: 2 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
webhooks:
enabled: true
controllerManager:
podLabels: {}
watchedNamespaces:
Expand Down