-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(admission-controller,sysdig-deploy): add initial support for cert-manager #1791
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
{{- if .Values.webhook.ssl.certManager.enabled }} | ||
--- | ||
apiVersion: admissionregistration.k8s.io/v1 | ||
kind: ValidatingWebhookConfiguration | ||
metadata: | ||
annotations: | ||
cert-manager.io/inject-ca-from: {{ include "admissionController.namespace" . }}/{{ include "admissionController.webhook.fullname" . }} | ||
helm.sh/hook: "post-install, post-upgrade" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what the thinking is behind all the |
||
meta.helm.sh/release-name: {{ .Release.Name }} | ||
meta.helm.sh/release-namespace: {{ .Release.Namespace }} | ||
labels: | ||
app.kubernetes.io/managed-by: Helm | ||
name: {{ include "admissionController.webhook.fullname" . }} | ||
namespace: {{ include "admissionController.namespace" . }} | ||
{{- include "admissionController.webhookTemplate" . }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that I don't inject any |
||
{{- else }} | ||
{{/* | ||
We need to put all resources that need certificate or CA Bundle together, | ||
so the template is executed just once | ||
|
@@ -38,3 +54,4 @@ data: | |
tls.crt: {{ $certList._0 }} | ||
tls.key: {{ $certList._1 }} | ||
ca.crt: {{ $certList._2 }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{{- if .Values.webhook.ssl.certManager.enabled }} | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
labels: | ||
{{- include "admissionController.webhook.labels" . | nindent 4 }} | ||
name: {{ include "admissionController.webhook.fullname" . }} | ||
namespace: {{ include "admissionController.namespace" . }} | ||
spec: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a lot we could parameterize here, but I figure we should start simple and can always iterate. |
||
dnsNames: | ||
- {{ include "admissionController.webhook.fullname" . }} | ||
- {{ include "admissionController.webhook.fullname" . }}.{{ include "admissionController.namespace" . }}.svc | ||
issuerRef: | ||
{{- with .Values.webhook.ssl.certManager.issuer.group }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've deliberately done it this we so we can easily add a boolean parameter like |
||
group: {{ . }} | ||
{{- end }} | ||
{{- with .Values.webhook.ssl.certManager.issuer.kind }} | ||
kind: {{ . }} | ||
{{- end }} | ||
{{- with .Values.webhook.ssl.certManager.issuer.name }} | ||
name: {{ . }} | ||
{{- end }} | ||
secretName: {{ include "admissionController.webhook.fullname" . }}-tls | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ apiVersion: v2 | |
name: sysdig-deploy | ||
description: A chart with various Sysdig components for Kubernetes | ||
type: application | ||
version: 1.56.11 | ||
version: 1.57.0 | ||
maintainers: | ||
- name: AlbertoBarba | ||
email: [email protected] | ||
|
@@ -20,7 +20,7 @@ dependencies: | |
- name: admission-controller | ||
# repository: https://charts.sysdig.com | ||
repository: file://../admission-controller | ||
version: ~0.16.3 | ||
version: ~0.17.0 | ||
alias: admissionController | ||
condition: admissionController.enabled | ||
- name: agent | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the laziest way I could think of to avoid reimplementing this template.