Skip to content

Commit 451c1c1

Browse files
committed
DX-97506: Automation of the engine experience in jenkins
This change incorporates: - Cluster wide deployment of CRDs (usually performed once) - Conditional deployment of engine operator and associated RBAC - Additional env parameters passed to master and coordinators when engine feature enabled Change-Id: I11c9e2ff76321dfd90ecf49b4bb044ff4a793308
1 parent 9f71ffd commit 451c1c1

7 files changed

Lines changed: 557 additions & 0 deletions
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: dremioengines.dremio.com
5+
spec:
6+
group: dremio.com
7+
names:
8+
kind: DremioEngine
9+
plural: dremioengines
10+
singular: dremioengine
11+
scope: Namespaced
12+
versions:
13+
- additionalPrinterColumns:
14+
- jsonPath: .spec.imageName
15+
name: IMAGE_NAME
16+
priority: 3
17+
type: string
18+
- jsonPath: .spec.maxReplicas
19+
name: MAX_REPLICAS
20+
priority: 2
21+
type: integer
22+
- jsonPath: .spec.minReplicas
23+
name: MIN_REPLICAS
24+
priority: 2
25+
type: integer
26+
- jsonPath: .spec.replicas
27+
name: REPLICAS
28+
priority: 1
29+
type: integer
30+
- jsonPath: .spec.size
31+
name: SIZE
32+
priority: 1
33+
type: string
34+
- jsonPath: .status.runningExecutors
35+
name: RUNNING_EXECUTORS
36+
priority: 2
37+
type: integer
38+
- jsonPath: .status.runningReplicas
39+
name: RUNNING_REPLICAS
40+
priority: 2
41+
type: integer
42+
- jsonPath: .status.state
43+
name: STATE
44+
priority: 1
45+
type: string
46+
name: v1
47+
schema:
48+
openAPIV3Schema:
49+
properties:
50+
spec:
51+
properties:
52+
imageName:
53+
description: Executor Image name
54+
type: string
55+
maxReplicas:
56+
description: TODO
57+
maximum: 128.0
58+
minimum: 0.0
59+
type: integer
60+
minReplicas:
61+
description: TODO
62+
maximum: 128.0
63+
minimum: 0.0
64+
type: integer
65+
replicas:
66+
description: Count of replicas comprising this engine
67+
maximum: 128.0
68+
minimum: 0.0
69+
type: integer
70+
size:
71+
description: "Then engine size, typically a T-shirt style name"
72+
enum:
73+
- LARGE_V1
74+
- MEDIUM_V1
75+
- SMALL_V1
76+
- XXX_LARGE_V1
77+
- XX_LARGE_V1
78+
- XX_SMALL_V1
79+
- X_LARGE_V1
80+
- X_SMALL_V1
81+
type: string
82+
required:
83+
- imageName
84+
- maxReplicas
85+
- minReplicas
86+
- replicas
87+
- size
88+
type: object
89+
status:
90+
properties:
91+
labelSelector:
92+
description: Label selector for the Replica scaling
93+
type: string
94+
message:
95+
description: TODO
96+
type: string
97+
observedGeneration:
98+
type: integer
99+
reason:
100+
description: TODO
101+
type: string
102+
runningExecutors:
103+
description: The status of executors that comprise the Engine
104+
type: integer
105+
runningReplicas:
106+
description: Count of replicas comprising this engine
107+
type: integer
108+
state:
109+
description: dTODO
110+
enum:
111+
- FAILED
112+
- RUNNING
113+
- STARTING
114+
type: string
115+
required:
116+
- message
117+
- runningReplicas
118+
- state
119+
type: object
120+
type: object
121+
served: true
122+
storage: true
123+
subresources:
124+
scale:
125+
labelSelectorPath: .status.labelSelector
126+
specReplicasPath: .spec.replicas
127+
statusReplicasPath: .status.runningReplicas
128+
status: {}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: dremioreplicas.dremio.com
5+
spec:
6+
group: dremio.com
7+
names:
8+
kind: DremioReplica
9+
plural: dremioreplicas
10+
singular: dremioreplica
11+
scope: Namespaced
12+
versions:
13+
- additionalPrinterColumns:
14+
- jsonPath: .spec.c3Storage
15+
name: C3_STORAGE
16+
priority: 3
17+
type: string
18+
- jsonPath: .spec.cpu
19+
name: CPU
20+
priority: 2
21+
type: string
22+
- jsonPath: .spec.executors
23+
name: EXECUTORS
24+
priority: 1
25+
type: integer
26+
- jsonPath: .spec.executorStorage
27+
name: EXECUTOR_STORAGE
28+
priority: 3
29+
type: string
30+
- jsonPath: .spec.imageName
31+
name: IMAGE_NAME
32+
priority: 2
33+
type: string
34+
- jsonPath: .spec.memory
35+
name: MEMORY
36+
priority: 2
37+
type: string
38+
- jsonPath: .status.state
39+
name: STATE
40+
priority: 1
41+
type: string
42+
name: v1
43+
schema:
44+
openAPIV3Schema:
45+
properties:
46+
spec:
47+
properties:
48+
c3Storage:
49+
description: TODO
50+
type: string
51+
cpu:
52+
description: TODO
53+
type: string
54+
executorStorage:
55+
description: TODO
56+
type: string
57+
executors:
58+
description: TODO
59+
type: integer
60+
imageName:
61+
description: Executor Image name
62+
type: string
63+
memory:
64+
description: TODO
65+
type: string
66+
required:
67+
- c3Storage
68+
- cpu
69+
- executorStorage
70+
- executors
71+
- imageName
72+
- memory
73+
type: object
74+
status:
75+
properties:
76+
message:
77+
description: TODO
78+
type: string
79+
observedGeneration:
80+
type: integer
81+
reason:
82+
description: TODO
83+
type: string
84+
runningExecutors:
85+
type: integer
86+
state:
87+
description: dTODO
88+
enum:
89+
- FAILED
90+
- RUNNING
91+
- STARTING
92+
type: string
93+
required:
94+
- message
95+
- state
96+
type: object
97+
type: object
98+
served: true
99+
storage: true
100+
subresources:
101+
status: {}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{{/*
2+
Engines - Coordinator Container Extra Environment Variables
3+
*/}}
4+
{{- define "dremio.coordinator.engine.envs" -}}
5+
{{- if $.Values.engine.enabled -}}
6+
- name: "EXECUTOR_IMAGE"
7+
value: {{ $.Values.image }}:{{ $.Values.imageTag }}
8+
- name: "KUBERNETES_NAMESPACE"
9+
valueFrom:
10+
fieldRef:
11+
fieldPath: "metadata.namespace"
12+
{{- end -}}
13+
{{- end -}}
14+
15+
{{/*
16+
Engine Operator - Service Account
17+
*/}}
18+
{{- define "dremio.engine.operator.serviceAccount" -}}
19+
{{- $operatorServiceAccount := coalesce $.Values.engine.operator.serviceAccount $.Values.serviceAccount -}}
20+
{{- if $operatorServiceAccount -}}
21+
serviceAccountName: {{ $operatorServiceAccount }}
22+
{{- end -}}
23+
{{- end -}}
24+
25+
{{/*
26+
Engine Operator - Pod Extra Init Containers
27+
*/}}
28+
{{- define "dremio.engine.operator.extraInitContainers" -}}
29+
{{- $operatorExtraInitContainers := coalesce $.Values.engine.operator.extraInitContainers $.Values.extraInitContainers -}}
30+
{{- if $operatorExtraInitContainers -}}
31+
{{ tpl $operatorExtraInitContainers $ }}
32+
{{- end -}}
33+
{{- end -}}
34+
35+
{{/*
36+
Engine Operator - Container Extra Environment Variables
37+
*/}}
38+
{{- define "dremio.engine.operator.extraEnvs" -}}
39+
{{- $operatorEnvironmentVariables := default (default (dict) $.Values.extraEnvs) $.Values.engine.operator.extraEnvs -}}
40+
{{- range $index, $environmentVariable:= $operatorEnvironmentVariables -}}
41+
{{- if hasPrefix "DREMIO" $environmentVariable.name -}}
42+
{{ fail "Environment variables cannot begin with DREMIO"}}
43+
{{- end -}}
44+
{{- end -}}
45+
{{- if $operatorEnvironmentVariables -}}
46+
{{ toYaml $operatorEnvironmentVariables }}
47+
{{- end -}}
48+
{{- end -}}
49+
50+
{{/*
51+
Engine Operator - Deployment Annotations
52+
*/}}
53+
{{- define "dremio.engine.operator.annotations" -}}
54+
{{- $operatorAnnotations := coalesce $.Values.engine.operator.annotations $.Values.annotations -}}
55+
{{- if $operatorAnnotations -}}
56+
annotations:
57+
{{- toYaml $operatorAnnotations | nindent 2 }}
58+
{{- end -}}
59+
{{- end -}}
60+
61+
{{/*
62+
Engine Operator - Deployment Labels
63+
*/}}
64+
{{- define "dremio.engine.operator.labels" -}}
65+
{{- $operatorLabels := coalesce $.Values.engine.operator.labels $.Values.labels -}}
66+
{{- if $operatorLabels -}}
67+
labels:
68+
{{- toYaml $operatorLabels | nindent 2 }}
69+
{{- end -}}
70+
{{- end -}}
71+
72+
{{/*
73+
Engine Operator - Pod Annotations
74+
*/}}
75+
{{- define "dremio.engine.operator.podAnnotations" -}}
76+
{{- $coordiantorPodAnnotations := coalesce $.Values.engine.operator.podAnnotations $.Values.podAnnotations -}}
77+
{{- if $coordiantorPodAnnotations -}}
78+
annotations:
79+
{{ toYaml $coordiantorPodAnnotations }}
80+
{{- end -}}
81+
{{- end -}}
82+
83+
{{/*
84+
Engine Operator - Pod Labels
85+
*/}}
86+
{{- define "dremio.engine.operator.podLabels" -}}
87+
{{- $operatorPodLabels := coalesce $.Values.engine.operator.podLabels $.Values.podLabels -}}
88+
{{- if $operatorPodLabels -}}
89+
{{ toYaml $operatorPodLabels }}
90+
{{- end -}}
91+
{{- end -}}
92+
93+
{{/*
94+
Engine Operator - Pod Node Selectors
95+
*/}}
96+
{{- define "dremio.engine.operator.nodeSelector" -}}
97+
{{- $operatorNodeSelector := coalesce $.Values.engine.operator.nodeSelector $.Values.nodeSelector -}}
98+
{{- if $operatorNodeSelector -}}
99+
nodeSelector:
100+
{{- toYaml $operatorNodeSelector | nindent 2 }}
101+
{{- end -}}
102+
{{- end -}}
103+
104+
{{/*
105+
Engine Operator - Pod Tolerations
106+
*/}}
107+
{{- define "dremio.engine.operator.tolerations" -}}
108+
{{- $operatorTolerations := coalesce $.Values.engine.operator.tolerations $.Values.tolerations -}}
109+
{{- if $operatorTolerations -}}
110+
tolerations:
111+
{{- toYaml $operatorTolerations | nindent 2 }}
112+
{{- end -}}
113+
{{- end -}}

charts/dremio_v2/templates/dremio-coordinator.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ spec:
7474
value: "/opt/dremio/aws/credentials"
7575
- name: AWS_SHARED_CREDENTIALS_FILE
7676
value: "/opt/dremio/aws/credentials"
77+
{{- include "dremio.coordinator.engine.envs" $ | nindent 8 }}
7778
{{- include "dremio.coordinator.log.path" $ | nindent 8 }}
7879
{{- include "dremio.coordinator.extraEnvs" $ | nindent 8 }}
7980
command: ["/opt/dremio/bin/dremio"]

0 commit comments

Comments
 (0)