Skip to content

Commit 3deb70f

Browse files
author
Mengqi Yu
committed
📖 update project deploy config
1 parent dcf0812 commit 3deb70f

10 files changed

+40
-73
lines changed

docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml

+10-7
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ bases:
1616
- ../crd
1717
- ../rbac
1818
- ../manager
19-
# - ../webhook
20-
# Comment the next line if you want to disable cert-manager
21-
# - ../certmanager
19+
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in crd/kustomization.yaml
20+
#- ../webhook
21+
# [CERTMANAGER] To enable cert-manager, uncomment next line. 'WEBHOOK' components are required.
22+
#- ../certmanager
2223

2324
patches:
2425
- manager_image_patch.yaml
@@ -33,8 +34,10 @@ patches:
3334
# manager_prometheus_metrics_patch.yaml should be enabled.
3435
#- manager_prometheus_metrics_patch.yaml
3536

36-
# Uncomment the following patch to enable the CA injection in the admission webhooks.
37-
#- webhookcainjection_patch.yaml
38-
39-
# Uncomment the following patch to enable the webhook for the manager.
37+
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in crd/kustomization.yaml
4038
#- manager_webhook_patch.yaml
39+
40+
# [CAINJECTION] Uncomment next line to enable the CA injection in the admission webhooks.
41+
# Uncomment 'CAINJECTION' in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
42+
# 'CERTMANAGER' needs to be enabled to use ca injection
43+
#- webhookcainjection_patch.yaml

docs/book/src/cronjob-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This patch inject a sidecar container which is a HTTP proxy for the controller manager,
22
# it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
33
apiVersion: apps/v1
4-
kind: StatefulSet
4+
kind: Deployment
55
metadata:
66
name: controller-manager
77
namespace: system

docs/book/src/cronjob-tutorial/testdata/project/config/default/manager_image_patch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: apps/v1
2-
kind: StatefulSet
2+
kind: Deployment
33
metadata:
44
name: controller-manager
55
namespace: system

docs/book/src/cronjob-tutorial/testdata/project/config/default/manager_prometheus_metrics_patch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This patch enables Prometheus scraping for the manager pod.
22
apiVersion: apps/v1
3-
kind: StatefulSet
3+
kind: Deployment
44
metadata:
55
name: controller-manager
66
namespace: system
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: apps/v1
2-
kind: StatefulSet
2+
kind: Deployment
33
metadata:
44
name: controller-manager
55
namespace: system
@@ -12,13 +12,12 @@ spec:
1212
- containerPort: 443
1313
name: webhook-server
1414
protocol: TCP
15-
---
16-
apiVersion: v1
17-
kind: Service
18-
metadata:
19-
name: webhook-service
20-
namespace: system
21-
spec:
22-
ports:
23-
- port: 443
24-
targetPort: 443
15+
volumeMounts:
16+
- mountPath: /tmp/k8s-webhook-server/serving-certs
17+
name: cert
18+
readOnly: true
19+
volumes:
20+
- name: cert
21+
secret:
22+
defaultMode: 420
23+
secretName: webhook-server-cert
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,2 @@
11
resources:
22
- manager.yaml
3-
4-
# the following config is for teaching kustomize how to do var substitution
5-
# vars:
6-
# - name: NAMESPACE
7-
# objref:
8-
# kind: Service
9-
# version: v1
10-
# name: webhook-service
11-
# fieldref:
12-
# fieldpath: metadata.namespace
13-
# - name: SERVICENAME
14-
# objref:
15-
# kind: Service
16-
# version: v1
17-
# name: webhook-service

docs/book/src/cronjob-tutorial/testdata/project/config/manager/manager.yaml

+3-36
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,31 @@ kind: Namespace
33
metadata:
44
labels:
55
control-plane: controller-manager
6-
controller-tools.k8s.io: "1.0"
76
name: system
87
---
9-
apiVersion: v1
10-
kind: Service
11-
metadata:
12-
name: controller-manager-service
13-
namespace: system
14-
labels:
15-
control-plane: controller-manager
16-
controller-tools.k8s.io: "1.0"
17-
spec:
18-
selector:
19-
control-plane: controller-manager
20-
controller-tools.k8s.io: "1.0"
21-
ports:
22-
- port: 443
23-
---
248
apiVersion: apps/v1
25-
kind: StatefulSet
9+
kind: Deployment
2610
metadata:
2711
name: controller-manager
2812
namespace: system
2913
labels:
3014
control-plane: controller-manager
31-
controller-tools.k8s.io: "1.0"
3215
spec:
3316
selector:
3417
matchLabels:
3518
control-plane: controller-manager
36-
controller-tools.k8s.io: "1.0"
37-
serviceName: controller-manager-service
3819
replicas: 1
39-
podManagementPolicy: Parallel
4020
template:
4121
metadata:
4222
labels:
4323
control-plane: controller-manager
44-
controller-tools.k8s.io: "1.0"
4524
spec:
4625
containers:
4726
- command:
4827
- /manager
28+
args:
29+
- --enable-leader-election
4930
image: controller:latest
50-
imagePullPolicy: Always
5131
name: manager
5232
resources:
5333
limits:
@@ -56,17 +36,4 @@ spec:
5636
requests:
5737
cpu: 100m
5838
memory: 20Mi
59-
ports:
60-
- containerPort: 9876
61-
name: webhook-server
62-
protocol: TCP
63-
volumeMounts:
64-
- mountPath: /tmp/cert
65-
name: cert
66-
readOnly: true
6739
terminationGracePeriodSeconds: 10
68-
volumes:
69-
- name: cert
70-
secret:
71-
defaultMode: 420
72-
secretName: webhook-server-secret
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
resources:
2-
- webhookmanifests.yaml # disabled till v2 has webhook support
2+
- manifests.yaml
3+
- service.yaml
34

45
configurations:
56
- kustomizeconfig.yaml

docs/book/src/cronjob-tutorial/testdata/project/config/webhook/manifests.yaml

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: webhook-service
6+
namespace: system
7+
spec:
8+
ports:
9+
- port: 443
10+
targetPort: 443
11+
selector:
12+
control-plane: controller-manager

0 commit comments

Comments
 (0)