Skip to content

Commit 34f9a39

Browse files
authored
Installing cert-manager as part of the deployment. (#359)
It is required for adding validation webhooks for example. Signed-off-by: Yoni Bettan <[email protected]>
1 parent fc5b78d commit 34f9a39

File tree

3 files changed

+71
-63
lines changed

3 files changed

+71
-63
lines changed

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ uninstall: manifests ## Uninstall CRDs from the K8s cluster specified in ~/.kube
177177

178178
KUSTOMIZE_CONFIG_DEFAULT ?= config/default
179179
KUSTOMIZE_CONFIG_HUB_DEFAULT ?= config/default-hub
180+
KUSTOMIZE_CONFIG_KMM ?= config/kmm
180181

181182
.PHONY: deploy
182183
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
@@ -192,6 +193,10 @@ deploy-hub: manifests kustomize ## Deploy controller to the K8s cluster specifie
192193
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
193194
kubectl delete -k $(KUSTOMIZE_CONFIG_DEFAULT) --ignore-not-found=$(ignore-not-found)
194195

196+
.PHONY: undeploy-kmm
197+
undeploy-kmm:
198+
kubectl delete -k $(KUSTOMIZE_CONFIG_KMM) --ignore-not-found=$(ignore-not-found)
199+
195200
.PHONY: undeploy-hub
196201
undeploy-hub: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
197202
kubectl delete -k $(KUSTOMIZE_CONFIG_HUB_DEFAULT) --ignore-not-found=$(ignore-not-found)

config/default/kustomization.yaml

+2-63
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,3 @@
1-
# Adds namespace to all resources.
2-
namespace: kmm-operator-system
3-
4-
# Value of this field is prepended to the
5-
# names of all resources, e.g. a deployment named
6-
# "wordpress" becomes "alices-wordpress".
7-
# Note that it should also match with the prefix (text before '-') of the namespace
8-
# field above.
9-
namePrefix: kmm-operator-
10-
11-
# Labels to add to all resources and selectors.
12-
#commonLabels:
13-
# someName: someValue
14-
151
bases:
16-
- ../crd
17-
- ../rbac
18-
- ../manager
19-
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
20-
# crd/kustomization.yaml
21-
#- ../webhook
22-
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
23-
#- ../certmanager
24-
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
25-
#- ../prometheus
26-
27-
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
28-
# crd/kustomization.yaml
29-
#- manager_webhook_patch.yaml
30-
31-
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
32-
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
33-
# 'CERTMANAGER' needs to be enabled to use ca injection
34-
#- webhookcainjection_patch.yaml
35-
36-
# the following config is for teaching kustomize how to do var substitution
37-
vars:
38-
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
39-
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
40-
# objref:
41-
# kind: Certificate
42-
# group: cert-manager.io
43-
# version: v1
44-
# name: serving-cert # this name should match the one in certificate.yaml
45-
# fieldref:
46-
# fieldpath: metadata.namespace
47-
#- name: CERTIFICATE_NAME
48-
# objref:
49-
# kind: Certificate
50-
# group: cert-manager.io
51-
# version: v1
52-
# name: serving-cert # this name should match the one in certificate.yaml
53-
#- name: SERVICE_NAMESPACE # namespace of the service
54-
# objref:
55-
# kind: Service
56-
# version: v1
57-
# name: webhook-service
58-
# fieldref:
59-
# fieldpath: metadata.namespace
60-
#- name: SERVICE_NAME
61-
# objref:
62-
# kind: Service
63-
# version: v1
64-
# name: webhook-service
2+
- https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.yaml
3+
- ../kmm

config/kmm/kustomization.yaml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Adds namespace to all resources.
2+
namespace: kmm-operator-system
3+
4+
# Value of this field is prepended to the
5+
# names of all resources, e.g. a deployment named
6+
# "wordpress" becomes "alices-wordpress".
7+
# Note that it should also match with the prefix (text before '-') of the namespace
8+
# field above.
9+
namePrefix: kmm-operator-
10+
11+
# Labels to add to all resources and selectors.
12+
#commonLabels:
13+
# someName: someValue
14+
15+
bases:
16+
- ../crd
17+
- ../rbac
18+
- ../manager
19+
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
20+
# crd/kustomization.yaml
21+
#- ../webhook
22+
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
23+
#- ../certmanager
24+
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
25+
#- ../prometheus
26+
27+
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
28+
# crd/kustomization.yaml
29+
#- manager_webhook_patch.yaml
30+
31+
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
32+
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
33+
# 'CERTMANAGER' needs to be enabled to use ca injection
34+
#- webhookcainjection_patch.yaml
35+
36+
# the following config is for teaching kustomize how to do var substitution
37+
vars:
38+
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
39+
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
40+
# objref:
41+
# kind: Certificate
42+
# group: cert-manager.io
43+
# version: v1
44+
# name: serving-cert # this name should match the one in certificate.yaml
45+
# fieldref:
46+
# fieldpath: metadata.namespace
47+
#- name: CERTIFICATE_NAME
48+
# objref:
49+
# kind: Certificate
50+
# group: cert-manager.io
51+
# version: v1
52+
# name: serving-cert # this name should match the one in certificate.yaml
53+
#- name: SERVICE_NAMESPACE # namespace of the service
54+
# objref:
55+
# kind: Service
56+
# version: v1
57+
# name: webhook-service
58+
# fieldref:
59+
# fieldpath: metadata.namespace
60+
#- name: SERVICE_NAME
61+
# objref:
62+
# kind: Service
63+
# version: v1
64+
# name: webhook-service

0 commit comments

Comments
 (0)