Skip to content

Commit

Permalink
Add extraContainers option
Browse files Browse the repository at this point in the history
  • Loading branch information
craustin committed Aug 12, 2022
1 parent e545345 commit e79bc9b
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 2 deletions.
71 changes: 69 additions & 2 deletions charts/dremio_v2/docs/Values-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,24 @@ extraInitContainers: |
[...]
```

#### `extraContainers`

Type: String

By default, this value is not set.

This value controls additional `containers` ("sidecars") that run alongside the standard containers in Dremio's pods. The value specified here may reference values specified in the built-in `Values` object in Helm.

For example, to have a `container` with the Dremio image, you can specify the following:

```yaml
extraContainers: |
- name: dremio-hello-world
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
command: ["echo", "Hello World"]
[...]
```

#### `extraVolumes`

Type: Array
Expand Down Expand Up @@ -572,6 +590,28 @@ coordinator:

More Info: Refer to the [`extraInitContainers`](#extrainitcontainers) section of this reference.

#### `coordinator.extraContainers`

Type: String

By default, this value is not set. If this value is omitted or set to an empty string, this value will be inherited from the top level `extraContainers`.

This value controls additional `initContainers` that are started as part of the initialization process for Dremio's coordinator pods. The value specified here may reference values specified in the `values.yaml` file.

For example, to have a `container` with the Dremio image, you can specify the following:

```yaml
coordinator:
[...]
extraContainers: |
- name: dremio-hello-world
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
command: ["echo", "Hello World"]
[...]
```

More Info: Refer to the [`extraContainers`](#extracontainers) section of this reference.

#### `coordinator.extraVolumes`

Type: Array
Expand Down Expand Up @@ -818,7 +858,7 @@ This value controls additional parameters passed to the Dremio process.
For example, to pass an additional system property to the java process, you can specify the following:

```yaml
coordinator:
executor:
[...]
extraStartParams: >-
-DsomeTestKey=someValue
Expand All @@ -838,7 +878,7 @@ This value controls additional `initContainers` that are started as part of the
For example, to have an `initContainer` with the Dremio image, you can specify the following:

```yaml
coordinator:
executor:
[...]
extraInitContainers: |
- name: dremio-hello-world
Expand All @@ -849,6 +889,28 @@ coordinator:

More Info: Refer to the [`extraInitContainers`](#extrainitcontainers) section of this reference.

#### `executor.extraContainers`

Type: String

By default, this value is not set. If this value is omitted or set to an empty string, this value will be inherited from the top level `extraContainers`.

This value controls additional `initContainers` that are started as part of the initialization process for Dremio's executor pods. The value specified here may reference values specified in the `values.yaml` file.

For example, to have a `container` with the Dremio image, you can specify the following:

```yaml
executor:
[...]
extraContainers: |
- name: dremio-hello-world
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
command: ["echo", "Hello World"]
[...]
```

More Info: Refer to the [`extraContainers`](#extracontainers) section of this reference.

#### `executor.extraVolumes`

Type: Array
Expand Down Expand Up @@ -939,6 +1001,11 @@ executor:
-DsomeTestKey=someValue
extraInitContainers: |
- name: dremio-hello-world-init
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
command: ["echo", "Hello World"]
extraContainers: |
- name: dremio-hello-world
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
command: ["echo", "Hello World"]
Expand Down
10 changes: 10 additions & 0 deletions charts/dremio_v2/templates/_helpers_coordinator.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ Coordinator - Pod Extra Init Containers
{{- end -}}
{{- end -}}

{{/*
Coordinator - Pod Extra Containers
*/}}
{{- define "dremio.coordinator.extraContainers" -}}
{{- $coordinatorExtraContainers := coalesce $.Values.coordinator.extraContainers $.Values.extraContainers -}}
{{- if $coordinatorExtraContainers -}}
{{ tpl $coordinatorExtraContainers $ }}
{{- end -}}
{{- end -}}

{{/*
Coordinator - Pod Extra Volume Mounts
*/}}
Expand Down
13 changes: 13 additions & 0 deletions charts/dremio_v2/templates/_helpers_executor.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@ Executor - Pod Extra Init Containers
{{- end -}}
{{- end -}}

{{/*
Executor - Pod Extra Containers
*/}}
{{- define "dremio.executor.extraContainers" -}}
{{- $context := index . 0 -}}
{{- $engineName := index . 1 -}}
{{- $engineConfiguration := default (dict) (get (default (dict) $context.Values.executor.engineOverride) $engineName) -}}
{{- $engineExtraContainers := coalesce $engineConfiguration.extraContainers $context.Values.executor.extraContainers $context.Values.extraContainers -}}
{{- if $engineExtraContainers -}}
{{ tpl $engineExtraContainers $context }}
{{- end -}}
{{- end -}}

{{/*
Executor - Pod Extra Volume Mounts
*/}}
Expand Down
1 change: 1 addition & 0 deletions charts/dremio_v2/templates/dremio-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ spec:
{{- include "dremio.coordinator.nodeSelector" $ | nindent 6 }}
{{- include "dremio.coordinator.tolerations" $ | nindent 6 }}
containers:
{{- include "dremio.coordinator.extraContainers" $ | nindent 6 }}
- name: dremio-coordinator
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
imagePullPolicy: IfNotPresent
Expand Down
1 change: 1 addition & 0 deletions charts/dremio_v2/templates/dremio-executor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ spec:
{{- include "dremio.executor.nodeSelector" (list $ $engineName) | nindent 6}}
{{- include "dremio.executor.tolerations" (list $ $engineName) | nindent 6}}
containers:
{{- include "dremio.executor.extraContainers" (list $ $engineName) | nindent 6 }}
- name: dremio-executor
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
imagePullPolicy: IfNotPresent
Expand Down
1 change: 1 addition & 0 deletions charts/dremio_v2/templates/dremio-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ spec:
{{- include "dremio.coordinator.nodeSelector" $ | nindent 6 }}
{{- include "dremio.coordinator.tolerations" $ | nindent 6 }}
containers:
{{- include "dremio.coordinator.extraContainers" $ | nindent 6 }}
- name: dremio-master-coordinator
image: {{ $.Values.image }}:{{ $.Values.imageTag }}
imagePullPolicy: IfNotPresent
Expand Down
26 changes: 26 additions & 0 deletions charts/dremio_v2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ coordinator:
# image: {{ $.Values.image }}:{{ $.Values.imageTag }}
# command: ["echo", "Hello World"]

# Extra Containers
# Uncomment the below lines to use a custom set of extra containers for the coordinator.
#extraContainers: |
# - name: extra-container
# image: {{ $.Values.image }}:{{ $.Values.imageTag }}
# command: ["echo", "Hello World"]

# Extra Volumes
# Uncomment below to use a custom set of extra volumes for the coordinator.
#extraVolumes: []
Expand Down Expand Up @@ -155,6 +162,13 @@ executor:
# image: {{ $.Values.image }}:{{ $.Values.imageTag }}
# command: ["echo", "Hello World"]

# Extra Containers
# Uncomment the below lines to use a custom set of extra containers for the executors.
#extraContainers: |
# - name: extra-container
# image: {{ $.Values.image }}:{{ $.Values.imageTag }}
# command: ["echo", "Hello World"]

# Extra Volumes
# Uncomment below to use a custom set of extra volumes for executors.
#extraVolumes: []
Expand Down Expand Up @@ -233,6 +247,11 @@ executor:
# image: {{ $.Values.image }}:{{ $.Values.imageTag }}
# command: ["echo", "Hello World"]
#
# extraContainers: |
# - name: extra-container
# image: {{ $.Values.image }}:{{ $.Values.imageTag }}
# command: ["echo", "Hello World"]
#
#
# extraVolumes: []
# extraVolumeMounts: []
Expand Down Expand Up @@ -428,6 +447,13 @@ distStorage:
# image: {{ $.Values.image }}:{{ $.Values.imageTag }}
# command: ["echo", "Hello World"]

# Extra Containers
# Uncomment the below lines to provide extra containers ("sidecars").
#extraContainers: |
# - name: extra-container
# image: {{ $.Values.image }}:{{ $.Values.imageTag }}
# command: ["echo", "Hello World"]

# Kubernetes Service Account
# Uncomment the below line to provide a Kubernetes service account that Dremio should run with.
#serviceAccount: ""
Expand Down

0 comments on commit e79bc9b

Please sign in to comment.