-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathmanagers.yaml
More file actions
141 lines (141 loc) · 4.19 KB
/
managers.yaml
File metadata and controls
141 lines (141 loc) · 4.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{{ range .ServiceOperators }}
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
control-plane: controller-manager
openstack.org/operator-name: {{ .Name }}
app.kubernetes.io/name: {{ .Name }}
name: {{ .Name }}-operator-controller-manager
namespace: {{ .Namespace }}
spec:
replicas: {{ .Deployment.Replicas }}
selector:
matchLabels:
control-plane: controller-manager
openstack.org/operator-name: {{ .Name }}
app.kubernetes.io/name: {{ .Name }}-operator
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: controller-manager
openstack.org/operator-name: {{ .Name }}
app.kubernetes.io/name: {{ .Name }}-operator
spec:
containers:
- args:
- --leader-elect
- --health-probe-bind-address=:8081
{{- if isEnvVarTrue .Deployment.Manager.Env "METRICS_CERTS" }}
- --metrics-bind-address=:8443
- --metrics-cert-path=/tmp/k8s-metrics-server/metrics-certs
{{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
- --webhook-cert-path=/tmp/k8s-webhook-server/serving-certs
{{- end }}
{{- else }}
- --metrics-bind-address=127.0.0.1:8080
{{- end }}
command:
- /manager
env:
{{- range .Deployment.Manager.Env }}
- name: '{{ .Name }}'
{{- if .Value }}
value: '{{ .Value }}'
{{- end }}
{{- if .ValueFrom }}
valueFrom:
{{- if .ValueFrom.FieldRef }}
fieldRef:
fieldPath: '{{ .ValueFrom.FieldRef.FieldPath }}'
{{- end }}
{{- if .ValueFrom.ConfigMapKeyRef }}
configMapKeyRef:
name: '{{ .ValueFrom.ConfigMapKeyRef.Name }}'
key: '{{ .ValueFrom.ConfigMapKeyRef.Key }}'
{{- end }}
{{- if .ValueFrom.SecretKeyRef }}
secretKeyRef:
name: '{{ .ValueFrom.SecretKeyRef.Name }}'
key: '{{ .ValueFrom.SecretKeyRef.Key }}'
{{- end }}
{{- end }}
{{- end }}
image: {{ .Deployment.Manager.Image }}
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
name: manager
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: {{ .Deployment.Manager.Resources.Limits.CPU }}
memory: {{ .Deployment.Manager.Resources.Limits.Memory }}
requests:
cpu: {{ .Deployment.Manager.Resources.Requests.CPU }}
memory: {{ .Deployment.Manager.Resources.Requests.Memory }}
securityContext:
allowPrivilegeEscalation: false
volumeMounts:
{{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
{{- end }}
{{- if isEnvVarTrue .Deployment.Manager.Env "METRICS_CERTS" }}
- mountPath: /tmp/k8s-metrics-server/metrics-certs
name: metrics-certs
readOnly: true
{{- end }}
securityContext:
runAsNonRoot: true
serviceAccountName: {{ .Name }}-operator-controller-manager
terminationGracePeriodSeconds: 10
tolerations:
{{- range .Deployment.Tolerations }}
- key: "{{ .Key }}"
{{- if .Operator }}
operator: "{{ .Operator }}"
{{- end }}
{{- if .Value }}
value: "{{ .Value }}"
{{- end }}
{{- if .Effect }}
effect: "{{ .Effect }}"
{{- end }}
{{- if .TolerationSeconds }}
tolerationSeconds: {{ .TolerationSeconds }}
{{- end }}
{{- end }}
volumes:
{{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
- name: cert
secret:
defaultMode: 420
secretName: {{ .Name }}-operator-webhook-server-cert
{{ end }}
{{- if isEnvVarTrue .Deployment.Manager.Env "METRICS_CERTS" }}
- name: metrics-certs
secret:
items:
- key: ca.crt
path: ca.crt
- key: tls.crt
path: tls.crt
- key: tls.key
path: tls.key
optional: false
secretName: {{ .Name }}-operator-metrics-server-cert
{{ end }}
---
{{ end }}