forked from ytsaurus/ytsaurus-k8s-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcluster_v1_tls.yaml
591 lines (487 loc) · 14.4 KB
/
cluster_v1_tls.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
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
#
# This configuration is for experiments and is not suited to production as is.
#
# Documentation for YTsaurus specification:
# https://ytsaurus.tech/docs/en/admin-guide/prepare-spec
#
# Automatically generated reference for all supported options:
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#ytsaurusspec
#
# CA bundle management requires trust-manager:
# helm upgrade -i trust-manager jetstack/trust-manager --namespace cert-manager --wait
#
# How to access via yt cli:
# kubectl -n ytsaurus-dev get configmaps ytsaurus-ca-bundle -o jsonpath='{.data.ca\.crt}' > ytsaurus-ca-bundle.crt
# YT_CONFIG_PATCHES='{ proxy={ ca_bundle_path="ytsaurus-ca-bundle.crt" }; }'
# YT_PROXY="https://..."
# yt list /
#
apiVersion: v1
kind: Namespace
metadata:
name: ytsaurus-dev
---
apiVersion: cluster.ytsaurus.tech/v1
kind: Ytsaurus
metadata:
namespace: ytsaurus-dev
name: ytsaurus
spec:
# https://ytsaurus.tech/docs/en/admin-guide/releases#ytsaurus-server
# https://github.com/ytsaurus/ytsaurus/pkgs/container/ytsaurus
coreImage: ghcr.io/ytsaurus/ytsaurus:stable-23.2.0-relwithdebinfo
# Default "docker_image" for jobs
jobImage: mirror.gcr.io/library/python:3.12-slim
# https://github.com/ytsaurus/ytsaurus-ui/
uiImage: ghcr.io/ytsaurus/ui:stable
# Default "admin" password and token is "password".
adminCredentials:
name: ytsaurus-admin-credentials
configOverrides:
name: ytsaurus-config-overrides
# Allow prioritizing performance over data safety. Useful for tests and experiments.
ephemeralCluster: true
useIpv4: true
# useIpv6: true
# To run all components in host network you need at least max(instanceCount) worker nodes due to port clash.
# hostNetwork: true
# Install certificate for internal CA.
caBundle:
name: ytsaurus-ca-bundle
# Setup TLS for internal communications.
nativeTransport:
tlsSecret:
name: ytsaurus-native-cert
tlsRequired: true
tlsPeerAlternativeHostName: "ytsaurus-dev.svc.cluster.local"
ui:
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#uispec
instanceCount: 1
serviceType: NodePort
discovery:
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#discoveryspec
instanceCount: 1
# Make reusable loggers config with yaml anchor.
loggers: &loggers
- name: debug
compression: zstd
minLogLevel: debug
writerType: file
rotationPolicy: &rotationPolicy
maxTotalSizeToKeep: 1073741824 # 1GiB
rotationPeriodMilliseconds: 900000 # 15Min
maxSegmentCountToKeep: 1000
categoriesFilter:
type: exclude
values: [ "Bus", "Concurrency" ]
- name: info
minLogLevel: info
writerType: file
rotationPolicy: *rotationPolicy
- name: info-stderr
minLogLevel: info
writerType: stderr
locations:
- locationType: Logs
path: /yt/discovery-logs
volumeMounts:
- name: discovery-logs
mountPath: /yt/discovery-logs
volumeClaimTemplates:
- metadata:
name: discovery-logs
spec: &logsVolumeSpec
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Gi
primaryMasters:
# https://ytsaurus.tech/docs/en/admin-guide/components#master
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#mastersspec
instanceCount: 1
cellTag: 1
loggers: *loggers
locations:
- locationType: Logs
path: /yt/master-logs
- locationType: MasterChangelogs
path: /yt/master-data/master-changelogs
- locationType: MasterSnapshots
path: /yt/master-data/master-snapshots
volumeMounts:
- name: master-logs
mountPath: /yt/master-logs
- name: master-data
mountPath: /yt/master-data
volumeClaimTemplates:
- metadata:
name: master-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Gi
- metadata:
name: master-logs
spec: *logsVolumeSpec
httpProxies:
# https://ytsaurus.tech/docs/en/admin-guide/components#proxy
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#httpproxiesspec
- instanceCount: 1
loggers: *loggers
locations:
- locationType: Logs
path: /yt/http-proxy-logs
volumeMounts:
- name: http-proxy-logs
mountPath: /yt/http-proxy-logs
volumeClaimTemplates:
- metadata:
name: http-proxy-logs
spec: *logsVolumeSpec
serviceType: NodePort
# httpNodePort: ...
# httpsNodePort: ...
# Setup HTTPS protocol
transport:
disableHttp: true
httpsSecret:
name: ytsaurus-https-cert
rpcProxies:
# https://ytsaurus.tech/docs/en/admin-guide/components#proxy
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#rpcproxiesspec
- instanceCount: 1
loggers: *loggers
locations:
- locationType: Logs
path: /yt/rpc-proxy-logs
volumeMounts:
- name: rpc-proxy-logs
mountPath: /yt/rpc-proxy-logs
volumeClaimTemplates:
- metadata:
name: rpc-proxy-logs
spec: *logsVolumeSpec
serviceType: NodePort
# nodePort: ...
# Setup TLS for RPC protocol
transport:
tlsSecret:
name: ytsaurus-rpc-cert
tlsRequired: true
# tlsPeerAlternativeHostName: ...
dataNodes:
# https://ytsaurus.tech/docs/en/admin-guide/components#data-nodes
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#datanodesspec
# Could be 1, but that is still broken sometimes due to hard-coded replication_factor=2|3.
- instanceCount: 3
loggers: *loggers
locations:
- locationType: Logs
path: /yt/data-node-logs
- locationType: ChunkStore
path: /yt/node-data/chunk-store
volumeMounts:
- name: data-node-logs
mountPath: /yt/data-node-logs
- name: node-data
mountPath: /yt/node-data
volumeClaimTemplates:
- metadata:
name: node-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 20Gi
- metadata:
name: data-node-logs
spec: *logsVolumeSpec
execNodes:
# https://ytsaurus.tech/docs/en/admin-guide/components#exec-nodes
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#execnodesspec
- instanceCount: 1
loggers: *loggers
jobProxyLoggers:
- name: debug
compression: zstd
minLogLevel: debug
writerType: file
useTimestampSuffix: true
rotationPolicy: &rotationPolicyJobs
maxTotalSizeToKeep: 104857600 # 100Mi
rotationPeriodMilliseconds: 900000 # 15Min
categoriesFilter:
type: exclude
values: [ "Bus", "Concurrency" ]
- name: info
minLogLevel: info
writerType: file
rotationPolicy: *rotationPolicyJobs
- name: error
minLogLevel: error
writerType: stderr
resources:
# Allocate resources for exec node container
requests:
cpu: 1
memory: 1Gi
limits:
cpu: 10
memory: 10Gi
locations:
- locationType: Logs
path: /yt/exec-node-logs
- locationType: ChunkCache
path: /yt/node-data/chunk-cache
- locationType: Slots
path: /yt/node-data/slots
- locationType: ImageCache
path: /yt/node-data/image-cache
volumeMounts:
- name: exec-node-logs
mountPath: /yt/exec-node-logs
- name: node-data
mountPath: /yt/node-data
# mountPropagation: Bidirectional # Enable for tmpfs in jobs
# Bind mount and use containerd registry config from node.
# - name: config-registry
# mountPath: /config/registry
# readOnly: true
volumes:
# - name: config-registry
# hostPath:
# path: /etc/containerd/certs.d
# type: Directory
volumeClaimTemplates:
- metadata:
name: node-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 20Gi
- metadata:
name: exec-node-logs
spec: *logsVolumeSpec
# privileged: true # Enable for tmpfs in jobs
jobResources:
# Allocate resources for jobs container
requests:
cpu: 4
memory: 4Gi
limits:
cpu: 10
memory: 10Gi
jobEnvironment:
# Add CRI containerd sidecar
cri:
apiRetryTimeoutSeconds: 180
# registryConfigPath: /config/registry
schedulers:
# https://ytsaurus.tech/docs/en/admin-guide/components#scheduler
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#schedulersspec
instanceCount: 1
loggers: *loggers
locations:
- locationType: Logs
path: /yt/scheduler-logs
volumeMounts:
- name: scheduler-logs
mountPath: /yt/scheduler-logs
volumeClaimTemplates:
- metadata:
name: scheduler-logs
spec: *logsVolumeSpec
controllerAgents:
# https://ytsaurus.tech/docs/en/admin-guide/components#scheduler
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#controlleragentsspec
instanceCount: 1
loggers: *loggers
locations:
- locationType: Logs
path: /yt/controller-agent-logs
volumeMounts:
- name: controller-agent-logs
mountPath: /yt/controller-agent-logs
volumeClaimTemplates:
- metadata:
name: controller-agent-logs
spec: *logsVolumeSpec
tabletNodes:
# https://ytsaurus.tech/docs/en/admin-guide/components#tablet-nodes
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#tabletnodesspec
- instanceCount: 1
loggers: *loggers
locations:
- locationType: Logs
path: /yt/tablet-node-logs
volumeMounts:
- name: tablet-node-logs
mountPath: /yt/tablet-node-logs
volumeClaimTemplates:
- metadata:
name: tablet-node-logs
spec: *logsVolumeSpec
yqlAgents:
# https://ytsaurus.tech/docs/en/admin-guide/components#yql-agent
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#yqlagentspec
instanceCount: 1
# https://ytsaurus.tech/docs/en/admin-guide/releases#query-tracker
image: ghcr.io/ytsaurus/query-tracker:0.0.6-relwithdebinfo
loggers: *loggers
locations:
- locationType: Logs
path: /yt/yql-agent-logs
volumeMounts:
- name: yql-agent-logs
mountPath: /yt/yql-agent-logs
volumeClaimTemplates:
- metadata:
name: yql-agent-logs
spec: *logsVolumeSpec
queryTrackers:
# https://ytsaurus.tech/docs/en/admin-guide/components#yql-agent
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#queueagentspec
instanceCount: 1
# https://ytsaurus.tech/docs/en/admin-guide/releases#query-tracker
image: ghcr.io/ytsaurus/query-tracker:0.0.6-relwithdebinfo
loggers: *loggers
locations:
- locationType: Logs
path: /yt/query-tracker-logs
volumeMounts:
- name: query-tracker-logs
mountPath: /yt/query-tracker-logs
volumeClaimTemplates:
- metadata:
name: query-tracker-logs
spec: *logsVolumeSpec
strawberry:
# https://ytsaurus.tech/docs/en/admin-guide/chyt
# https://github.com/ytsaurus/yt-k8s-operator/blob/main/docs/api.md#strawberrycontrollerspec
# https://ytsaurus.tech/docs/en/admin-guide/releases#strawberry
image: ghcr.io/ytsaurus/strawberry:0.0.11
resources:
limits:
memory: 100Mi
---
apiVersion: v1
kind: Secret
metadata:
namespace: ytsaurus-dev
name: ytsaurus-admin-credentials
type: Opaque
data:
login: YWRtaW4= # admin
password: cGFzc3dvcmQ= # password
token: cGFzc3dvcmQ= # password
---
apiVersion: v1
kind: ConfigMap
metadata:
namespace: ytsaurus-dev
name: ytsaurus-config-overrides
data:
---
#
# Bootstrap internal CA
#
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
namespace: cert-manager
name: ytsaurus-selfsigned-issuer
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
namespace: cert-manager
name: ytsaurus-ca
spec:
isCA: true
commonName: ytsaurus-ca
subject:
organizations:
- ytsaurus CA
secretName: ytsaurus-ca-secret
issuerRef:
kind: Issuer
name: ytsaurus-selfsigned-issuer
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
namespace: cert-manager
name: ytsaurus-ca-issuer
spec:
ca:
secretName: ytsaurus-ca-secret
---
apiVersion: trust.cert-manager.io/v1alpha1
kind: Bundle
metadata:
namespace: ytsaurus-dev
name: ytsaurus-ca-bundle
spec:
sources:
- useDefaultCAs: false
- secret:
name: "ytsaurus-ca-secret"
key: "tls.crt"
target:
configMap:
key: "ca.crt"
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: ytsaurus-dev
---
#
# Issue cluster certificates.
#
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
namespace: ytsaurus-dev
name: ytsaurus-native-cert
spec:
dnsNames:
- "ytsaurus-dev.svc.cluster.local"
- "*.masters.ytsaurus-dev.svc.cluster.local"
- "*.discovery.ytsaurus-dev.svc.cluster.local"
issuerRef:
kind: ClusterIssuer
name: ytsaurus-ca-issuer
secretName: ytsaurus-native-cert
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
namespace: ytsaurus-dev
name: ytsaurus-https-cert
spec:
dnsNames:
- "*.ytsaurus-dev.svc"
- "*.ytsaurus-dev.svc.cluster.local"
- "*.http-proxies.ytsaurus-dev.svc"
- "*.http-proxies.ytsaurus-dev.svc.cluster.local"
issuerRef:
kind: ClusterIssuer
name: ytsaurus-ca-issuer
secretName: ytsaurus-https-cert
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
namespace: ytsaurus-dev
name: ytsaurus-rpc-cert
spec:
dnsNames:
- "*.rpc-proxies.ytsaurus-dev.svc"
- "*.rpc-proxies.ytsaurus-dev.svc.cluster.local"
issuerRef:
kind: ClusterIssuer
name: ytsaurus-ca-issuer
secretName: ytsaurus-rpc-cert