-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathfull-cluster.yaml
458 lines (432 loc) · 11.4 KB
/
full-cluster.yaml
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
node_defaults:
keyfile: "/home/username/.ssh/id_rsa"
password: '{{ env.PASS }}' #Either keyfile or password can be used.
username: "centos"
vrrp_ips:
- hosts:
- name: k8s-lb-1
priority: 254
- name: k8s-lb-2
priority: 253
id: d8efc729e4
interface: eth0
ip: 192.168.0.250
password: 11a1aabe
router_id: '250'
nodes:
- name: "k8s-lb-1"
address: "10.101.0.1"
internal_address: "192.168.0.1"
roles: ["balancer"]
- name: "k8s-lb-2"
address: "10.101.0.2"
internal_address: "192.168.0.2"
roles: ["balancer"]
- name: "k8s-control-plane-1"
address: "10.101.0.3"
internal_address: "192.168.0.3"
roles: ["control-plane"]
- name: "k8s-control-plane-2"
address: "10.101.0.4"
internal_address: "192.168.0.4"
roles: ["control-plane"]
- name: "k8s-control-plane-3"
address: "10.101.0.5"
internal_address: "192.168.0.5"
roles: ["control-plane"]
- name: "k8s-worker-1"
address: "10.101.0.6"
internal_address: "192.168.0.6"
roles: ["worker"]
taints:
- "node-role.kubernetes.io/remove-example:NoSchedule-"
- "node-role.kubernetes.io/add-example=add-example:NoSchedule"
- name: "k8s-worker-2"
address: "10.101.0.7"
internal_address: "192.168.0.7"
roles: ["worker"]
labels:
netcracker-infra: infra
region: europe
- name: "k8s-worker-3"
address: "10.101.0.8"
internal_address: "192.168.0.8"
roles: ["worker"]
labels:
netcracker-infra: infra
region: asia
cluster_name: "k8s.example.com"
public_cluster_ip: "10.101.0.1"
services:
kubeadm:
kubernetesVersion: v1.24.2
controlPlaneEndpoint: 'k8s.example.com:6443'
imageRepository: artifactory.example.com:5443/registry.k8s.io
networking:
podSubnet: 10.30.0.0/24
serviceSubnet: 172.30.0.0/24
apiServer:
certSANs:
- 10.101.0.1
- 10.101.0.2
- 10.101.0.3
- 10.101.0.4
- 10.101.0.5
- 10.101.0.6
- 10.101.0.7
- 10.101.0.8
- 192.168.0.1
- 192.168.0.2
- 192.168.0.3
- 192.168.0.4
- 192.168.0.5
- 192.168.0.6
- 192.168.0.7
- 192.168.0.8
- k8s-lb-1
- k8s-lb-2
- k8s-control-plane-1
- k8s-control-plane-2
- k8s-control-plane-3
- k8s-worker-1
- k8s-worker-2
- k8s-worker-3
extraArgs:
enable-admission-plugins: NodeRestriction,PodNodeSelector
cri:
containerRuntime: docker
dockerConfig:
ipv6: True
log-driver: json-file
log-opts:
max-size: 128m
max-file: "5"
exec-opts:
- native.cgroupdriver=systemd
insecure-registries:
- artifactory.example.com:5443
registry-mirrors:
- https://artifactory.example.com:5443
resolv.conf:
search: default
nameservers:
- 1.1.1.1
- 1.0.0.1
- 2606:4700:4700::1111
- 2606:4700:4700::1001
etc_hosts:
1.1.1.1:
- example.com
ntp:
# For RHEL OS use chrony:
chrony:
servers:
- 0.de.pool.ntp.org iburst
- 1.de.pool.ntp.org iburst
makestep: 5 10
rtcsync: True
# For Debian OS use timesyncd. Uncomment and customize the following section:
# timesyncd:
# Time:
# NTP:
# - 0.de.pool.ntp.org
# - 1.de.pool.ntp.org
# FallbackNTP:
# - 2.de.pool.ntp.org
# - 3.de.pool.ntp.org
# RootDistanceMaxSec: 10
# PollIntervalMinSec: 64
# PollIntervalMaxSec: 1024
thirdparties:
/usr/bin/kubeadm:
source: 'https://example.com/kubernetes/v1.24.2/bin/linux/amd64/kubeadm'
sha1: e5cdfcda337a5c8d59035da9db0c2b02913271d1
groups:
- control-plane
- worker
/opt/cni/cni-plugins-linux.tgz:
source: 'https://example.com/cni-plugins/v0.8.3/cni-plugins-linux-amd64-v0.8.3.tgz'
sha1: f662ec5b648e114802276f8f353ad48a3376da47
unpack: '/opt/cni/bin'
group: control-plane
/usr/bin/calicoctl:
source: 'https://example.com/calico/v3.24.2/calicoctl-linux-amd64'
kernel_security:
# For RHEL OS use selinux:
selinux:
state: enforcing
policy: targeted
permissive:
- http_port_t
- http_cache_port_t
- commplex_main_port_t
# For Debian OS use apparmor:
apparmor:
complain:
- man_filter
disable:
- man_groff
modprobe:
# For RHEL OS:
rhel:
- br_netfilter
- ip_vs
- ip_vs_rr
- ip_vs_wrr
- ip_vs_sh
- ip6table_filter
- nf_conntrack_ipv6
- nf_nat_masquerade_ipv6
- nf_reject_ipv6
- nf_defrag_ipv6
# For Debian OS:
debian:
- br_netfilter
- ip_vs
- ip_vs_rr
- ip_vs_wrr
- ip_vs_sh
- ip6table_filter
- nf_conntrack
- nf_nat
- nf_reject_ipv6
- nf_defrag_ipv6
sysctl:
net.bridge.bridge-nf-call-iptables: 1
net.ipv4.ip_forward: 1
net.ipv4.ip_nonlocal_bind: 1
net.bridge.bridge-nf-call-ip6tables: 1
net.ipv6.conf.all.forwarding: 1
net.ipv6.ip_nonlocal_bind: 1
loadbalancer:
haproxy:
defaults:
timeout_connect: '10s'
timeout_client: '1m'
timeout_server: '1m'
timeout_tunnel: '60m'
timeout_client_fin: '1m'
maxconn: 10000
keep_configs_updated: True
packages:
package_manager:
replace-repositories: true
# For RHEL OS use yum-like format:
repositories:
centos-sclo-haproxy18:
name: "CentOS SCLO rh-haproxy18"
enabled: 1
gpgcheck: 0
baseurl: "http://mirror.centos.org/centos/7/sclo/x86_64/rh/rh-haproxy18/"
# For Debian OS use apt-like format:
# repositories:
# - "deb [arch=amd64 trusted=yes] http://example.com/deb/ubuntu/ focal main restricted"
associations:
haproxy:
executable_name: '/bin/haproxy'
package_name: 'haproxy'
service_name: 'haproxy'
config_location: '/etc/haproxy/haproxy.cfg'
docker:
package_name:
- 'docker-ce-19.03*'
- 'docker-ce-cli-19.03*'
install:
include:
- ethtool
- ebtables
- socat
- curl
- openssl
- unzip
- policycoreutils-python
rbac:
account_defaults:
namespace: kube-system
configs:
- apiVersion: v1
kind: ServiceAccount
metadata: {}
secrets: []
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata: {}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
subjects:
- kind: ServiceAccount
- apiVersion: v1
kind: Secret
metadata:
annotations: {}
type: kubernetes.io/service-account-token
accounts:
- name: superadmin
role: cluster-admin
- name: superadmin2
role: cluster-admin
namespace: kube-system
psp:
pod-security: enabled
oob-policies:
default: enabled
host-network: enabled
anyuid: enabled
custom-policies:
psp-list:
- apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: most-restricted-psp
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default'
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'runtime/default'
spec:
privileged: false
# Allow core volume types.
hostPID: false
hostIPC: false
hostNetwork: false
volumes:
- 'configMap'
- 'emptyDir'
- 'projected'
- 'secret'
- 'downwardAPI'
- 'persistentVolumeClaim'
fsGroup:
rule: 'MustRunAs'
ranges:
- min: 1
max: 65535
readOnlyRootFilesystem: true
runAsUser:
rule: 'MustRunAsNonRoot'
supplementalGroups:
rule: 'MustRunAs'
ranges:
- min: 1
max: 65535
runAsGroup:
rule: 'MustRunAs'
ranges:
- min: 1
max: 65535
allowPrivilegeEscalation: false
seLinux:
rule: 'RunAsAny'
requiredDropCapabilities:
- ALL
roles-list:
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: most-restricted-psp-cr
rules:
- apiGroups: ['policy']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- most-restricted-psp
bindings-list:
- kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: most-restricted-psp-crb
roleRef:
kind: ClusterRole
name: most-restricted-psp-cr
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
# it is possible to bind to non-existing SA in non-existing namespace
name: sa-name
namespace: sa-namespace
plugin_defaults:
installation:
registry: artifactory.example.com:5443
plugins:
calico:
install: true
version: v3.24.2
installation:
priority: 0
mode: ipip
crossSubnet: true
natOutgoing: true
mtu: 1440
typha:
enabled: false
replicas: 2
image: calico/typha:v3.24.2
nodeSelector:
kubernetes.io/os: linux
cni:
image: calico/cni:v3.24.2
node:
image: calico/node:v3.24.2
kube-controllers:
image: calico/kube-controllers:v3.24.2
nodeSelector:
kubernetes.io/os: linux
apiserver:
image: calico/apiserver:v3.24.2
enabled: true
nodeSelector:
kubernetes.io/os: linux
expect:
apiservice:
retries: 60
nginx-ingress-controller:
install: true
installation:
priority: 1
controller:
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.26.1
ssl:
enableSslPassthrough: false
default-certificate:
paths:
cert: /path/to/cert
key: /path/to/key
nodeSelector:
kubernetes.io/os: linux
kubernetes-dashboard:
install: true
installation:
priority: 2
hostname: 'dashboard.k8s.example.com'
dashboard:
image: kubernetesui/dashboard:v2.0.0-rc2
nodeSelector:
kubernetes.io/os: linux
metrics-scraper:
image: kubernetesui/metrics-scraper:v1.0.2
nodeSelector:
kubernetes.io/os: linux
ingress:
metadata:
name: kubernetes-dashboard
namespace: kubernetes-dashboard
annotations:
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/secure-backends: "true"
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
tls:
- hosts:
- '{{ plugins["kubernetes-dashboard"].hostname }}'
rules:
- host: '{{ plugins["kubernetes-dashboard"].hostname }}'
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: kubernetes-dashboard
port:
number: 443