Skip to content

Commit 36a7f50

Browse files
authored
Merge pull request #9 from Azure/simon/replace-cert-manager
feat: remove cert-manager dependency
2 parents 3d6c100 + 73d647e commit 36a7f50

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+318
-599
lines changed

Makefile

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ test: manifests generate envtest go-junit-report gocov gocov-xml ## Run tests an
116116
# Prometheus and CertManager and Jaeger are installed by default if they not
117117
# already installed. Skip install with:
118118
# - SKIP_INSTALL_PROMETHEUS=true
119-
# - SKIP_INSTALL_CERT_MANAGER=true
120119
# To avoid uninstalling everything after the tests, use:
121120
# - SKIP_UNINSTALL=true
122121
.PHONY: e2e
@@ -432,7 +431,6 @@ ENVTEST_VERSION ?= release-0.19
432431
KIND_VERSION ?= v0.25.0
433432
GOLANGCI_LINT_VERSION ?= v2.1.6
434433
GO_JUNIT_REPORT_VERSION ?= v2.1.0
435-
CERT_MANAGER_VERSION ?= 1.12.12-5
436434
PROMETHEUS_VERSION ?= v0.77.1
437435
JAEGER_VERSION ?= v1.62.0
438436
GINKGO_VERSION ?= v2.23.3
@@ -499,16 +497,6 @@ set-docker-pipeline-variables: # Echos variables used to pass information to doc
499497
@echo "##vso[task.setvariable variable=build_date;isOutput=true]$$( date -u +%Y-%m-%dT%H:%M:%SZ )"
500498
@echo "##vso[task.setvariable variable=git_revision;isOutput=true]$$( git rev-parse HEAD )"
501499

502-
CERT_MANAGER_CHART="oci://mcr.microsoft.com/azurelinux/helm/cert-manager"
503-
.PHONY: cert-manager
504-
cert-manager: helm ## Install cert-manager into the current cluster.
505-
$(HELM) install cert-manager $(CERT_MANAGER_CHART) --version $(CERT_MANAGER_VERSION) \
506-
--set cert-manager.installCRDs=true --namespace cert-manager --create-namespace --wait --debug --atomic
507-
508-
.PHONY: cert-manager-uninstall
509-
cert-manager-uninstall: helm ## Uninstall cert-manager from the current cluster.
510-
$(HELM) uninstall cert-manager --namespace cert-manager --wait --debug --ignore-not-found
511-
512500
.PHONY: kyverno
513501
kyverno: helm ## Install kyverno into the current cluster.
514502
$(HELM) repo add kyverno https://kyverno.github.io/kyverno/

api/v1alpha1/clusterconfig_types.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ type ClusterConfig struct {
3232
// Version is the semver version of the Helm chart that installed this
3333
// configuration.
3434
Version string `json:"version,omitempty"`
35-
// Enable the PVC webhook, to enforce generic ephemeral volumes only unless
36-
// pvc annotations for persistent storage are set.
37-
EnforceEphemeralPVC *bool `json:"enforceEphemeralPVC,omitempty"`
38-
// EnforceHyperconvergedWithWebhook enables the webhook that enforces
39-
// hyperconverged mode for the Local CSI Driver.
40-
EnforceHyperconvergedWithWebhook *bool `json:"enforceHyperconvergedWithWebhook,omitempty"`
4135
}
4236

4337
func init() {

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{{- if or .Values.node.driver.webhooks.ephemeral.enabled .Values.node.driver.webhooks.hyperconverged.enabled }}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
name: {{ include "chart.fullname" . }}-certificate-role
6+
labels:
7+
{{- include "chart.labels" . | nindent 4 }}
8+
rules:
9+
- apiGroups:
10+
- ""
11+
resources:
12+
- secrets
13+
verbs:
14+
- get
15+
- list
16+
- patch
17+
- update
18+
- watch
19+
---
20+
apiVersion: rbac.authorization.k8s.io/v1
21+
kind: RoleBinding
22+
metadata:
23+
name: {{ include "chart.fullname" . }}-certificate-rolebinding
24+
labels:
25+
{{- include "chart.labels" . | nindent 4 }}
26+
roleRef:
27+
apiGroup: rbac.authorization.k8s.io
28+
kind: Role
29+
name: {{ include "chart.fullname" . }}-certificate-role
30+
subjects:
31+
- kind: ServiceAccount
32+
name: {{ include "chart.fullname" . }}-node
33+
namespace: '{{ .Release.Namespace }}'
34+
{{- end }}

charts/latest/templates/daemonset.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ spec:
3333
- linux
3434
containers:
3535
- args: {{- toYaml .Values.node.driver.args | nindent 8 }}
36+
{{- if or .Values.node.driver.webhooks.ephemeral.enabled .Values.node.driver.webhooks.hyperconverged.enabled }}
37+
- --webhook-service-name={{ include "chart.fullname" . }}-webhook-service
38+
{{- end }}
39+
{{- if .Values.node.driver.webhooks.ephemeral.enabled }}
40+
- --ephemeral-webhook-config={{ include "chart.fullname" . }}-ephemeral-webhook
41+
{{- end }}
42+
{{- if .Values.node.driver.webhooks.hyperconverged.enabled }}
43+
- --hyperconverged-webhook-config={{ include "chart.fullname" . }}-hyperconverged-webhook
44+
{{- end }}
45+
{{- if or .Values.node.driver.webhooks.ephemeral.enabled .Values.node.driver.webhooks.hyperconverged.enabled }}
46+
- --certificate-secret-name={{ include "chart.fullname" . }}-webhook-server-cert
47+
{{- end }}
3648
command:
3749
- /local-csi-driver
3850
env:
@@ -194,7 +206,7 @@ spec:
194206
volumes:
195207
- name: cert
196208
secret:
197-
secretName: webhook-server-cert
209+
secretName: {{ include "chart.fullname" . }}-webhook-server-cert
198210
- configMap:
199211
name: {{ include "chart.fullname" . }}-cluster-config
200212
name: cluster-config

charts/latest/templates/node-rbac.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,28 @@ rules:
9494
- patch
9595
- update
9696
- watch
97+
- apiGroups:
98+
- "admissionregistration.k8s.io"
99+
resources:
100+
- "validatingwebhookconfigurations"
101+
- "mutatingwebhookconfigurations"
102+
verbs:
103+
- "get"
104+
- "list"
105+
- "watch"
106+
- "update"
107+
- "patch"
108+
- apiGroups:
109+
- coordination.k8s.io
110+
resources:
111+
- leases
112+
verbs:
113+
- get
114+
- list
115+
- watch
116+
- create
117+
- update
118+
- patch
97119
---
98120
apiVersion: rbac.authorization.k8s.io/v1
99121
kind: ClusterRoleBinding

charts/latest/templates/selfsigned-issuer.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

charts/latest/templates/serving-cert.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

charts/latest/templates/pvc-create-webhook.yaml renamed to charts/latest/templates/webhook-config-ephemeral.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
{{- if .Values.node.driver.webhooks.ephemeral.enabled }}
12
apiVersion: admissionregistration.k8s.io/v1
23
kind: ValidatingWebhookConfiguration
34
metadata:
4-
name: {{ include "chart.fullname" . }}-pvc-create-webhook
5-
annotations:
6-
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "chart.fullname" . }}-serving-cert
5+
name: {{ include "chart.fullname" . }}-ephemeral-webhook
76
labels:
87
{{- include "chart.labels" . | nindent 4 }}
98
webhooks:
@@ -13,7 +12,7 @@ webhooks:
1312
service:
1413
name: {{ include "chart.fullname" . }}-webhook-service
1514
namespace: '{{ .Release.Namespace }}'
16-
path: /pvc-create
15+
path: /validate-pvc
1716
failurePolicy: Ignore
1817
name: pvc.acstor.azure.com
1918
rules:
@@ -27,3 +26,4 @@ webhooks:
2726
- persistentvolumeclaims
2827
scope: Namespaced
2928
sideEffects: None
29+
{{- end }}

charts/latest/templates/hyperconverged-webhook.yaml renamed to charts/latest/templates/webhook-config-hyperconverged.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
{{- if .Values.node.driver.webhooks.hyperconverged.enabled }}
12
apiVersion: admissionregistration.k8s.io/v1
23
kind: MutatingWebhookConfiguration
34
metadata:
45
name: {{ include "chart.fullname" . }}-hyperconverged-webhook
5-
annotations:
6-
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "chart.fullname" . }}-serving-cert
76
labels:
87
{{- include "chart.labels" . | nindent 4 }}
98
webhooks:
@@ -13,7 +12,7 @@ webhooks:
1312
service:
1413
name: {{ include "chart.fullname" . }}-webhook-service
1514
namespace: '{{ .Release.Namespace }}'
16-
path: /mutate-hyperconverged-pods
15+
path: /mutate-pod
1716
failurePolicy: Ignore
1817
name: hyperconverged.local.csi.azure.com
1918
rules:
@@ -26,3 +25,4 @@ webhooks:
2625
resources:
2726
- pods
2827
sideEffects: None
28+
{{- end }}

0 commit comments

Comments
 (0)