Skip to content

Commit

Permalink
feat: add custom image commands and arguments (#408)
Browse files Browse the repository at this point in the history
* feat: add custom image commands and arguments

Add support for customizing an image's command or arguments.  In our setup, we have
some custom startup & shutdown behavior that need to run before the main process
starts for things like enabling / disabling networking or injecting secrets.  These
cannot be configured with init containers since they need to run in the same place
that the main process is going to run.  If command / args are empty or not present,
they will be excluded from helm, allowing the default command of the image to be used

---------

Co-authored-by: Travis Cook <[email protected]>
  • Loading branch information
travis-cook-sfdc and Travis Cook authored Dec 11, 2023
1 parent b969ce1 commit 6f73340
Show file tree
Hide file tree
Showing 21 changed files with 133 additions and 73 deletions.
12 changes: 6 additions & 6 deletions charts/datahub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ description: A Helm chart for LinkedIn DataHub
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.3.17
version: 0.3.18
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 0.11.0
dependencies:
- name: datahub-gms
version: 0.2.158
version: 0.2.159
repository: file://./subcharts/datahub-gms
condition: datahub-gms.enabled
- name: datahub-frontend
version: 0.2.150
version: 0.2.151
repository: file://./subcharts/datahub-frontend
condition: datahub-frontend.enabled
- name: datahub-mae-consumer
version: 0.2.152
version: 0.2.153
repository: file://./subcharts/datahub-mae-consumer
condition: global.datahub_standalone_consumers_enabled
- name: datahub-mce-consumer
version: 0.2.154
version: 0.2.155
repository: file://./subcharts/datahub-mce-consumer
condition: global.datahub_standalone_consumers_enabled
- name: datahub-ingestion-cron
version: 0.2.137
repository: file://./subcharts/datahub-ingestion-cron
condition: datahub-ingestion-cron.enabled
- name: acryl-datahub-actions
version: 0.2.140
version: 0.2.141
repository: file://./subcharts/acryl-datahub-actions
condition: acryl-datahub-actions.enabled
maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/datahub/subcharts/acryl-datahub-actions/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: A Helm chart for Kubernetes
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.2.140
version: 0.2.141
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 0.0.11
2 changes: 2 additions & 0 deletions charts/datahub/subcharts/acryl-datahub-actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Current chart version is `0.0.3`
| extraVolumeMounts | Templatable string of additional `volumeMounts` to be passed to the `tpl` function | "" |
| fullnameOverride | string | `"acryl-datahub-actions"` | |
| global.datahub.gms.port | string | `"8080"` | |
| image.args | list | `[]` | Override the image's args. Used to configure custom startup or shutdown behavior |
| image.command | list | `[]` | Override the image's command. Used to configure custom startup or shutdown behavior |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"acryldata/datahub-actions"` | |
| image.tag | string | `"v0.0.6"` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ spec:
- name: http
containerPort: 9093
protocol: TCP
{{- if .Values.image.command }}
command: {{ .Values.image.command | toJson }}
{{- end }}
{{- if .Values.image.args }}
args: {{ .Values.image.args | toJson }}
{{- end }}
env:
- name: DATAHUB_GMS_HOST
value: {{ (((.Values.datahub).gms).host | default ((.Values.global.datahub).gms).host) | default (printf "%s-%s" .Release.Name "datahub-gms") | trunc 63 | trimSuffix "-"}}
Expand Down
4 changes: 4 additions & 0 deletions charts/datahub/subcharts/acryl-datahub-actions/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ image:
repository: acryldata/datahub-actions
tag: "v0.0.1"
pullPolicy: IfNotPresent
# Override the image's command & args with a new one.
# This may be necessary for custom startup or shutdown behaviors
command:
args:

imagePullSecrets: []
nameOverride: ""
Expand Down
2 changes: 1 addition & 1 deletion charts/datahub/subcharts/datahub-frontend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: A Helm chart for Kubernetes
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.2.150
version: 0.2.151
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: v0.11.0
6 changes: 4 additions & 2 deletions charts/datahub/subcharts/datahub-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ Current chart version is `0.2.0`
| fullnameOverride | string | `"datahub-frontend"` | |
| global.datahub_analytics_enabled | boolean | true | |
| global.datahub.gms.port | string | `"8080"` | |
| global.datahub.frontend.validateSignUpEmail | boolean | true | Enforces user sign up through invite link to use a valid email. |
| global.datahub.frontend.validateSignUpEmail | boolean | true | Enforces user sign up through invite link to use a valid email. |
| image.args | list | `[]` | Override the image's args. Used to configure custom startup or shutdown behavior |
| image.command | list | `[]` | Override the image's command. Used to configure custom startup or shutdown behavior |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"linkedin/datahub-frontend-react"` | |
| image.tag | string | `"head"` | |
Expand All @@ -48,7 +50,7 @@ Current chart version is `0.2.0`
| oidcAuthentication.oktaDomain | string | `""` | Okta domain, e.g. `dev-12345.okta.com`; needed only if `provider` is set to `okta` |
| oidcAuthentication.azureTenantId | string | `""` | Azure directory (tenant) ID; neede only if `provider` is set to `azure` |
| oidcAuthentication.user_name_claim | string | `""` | The attribute that will contain the username used on the DataHub platform |
| oidcAuthentication.user_name_claim_regex | string | `""` | A regex string used for extracting the username from the userNameClaim attribute |
| oidcAuthentication.user_name_claim_regex | string | `""` | A regex string used for extracting the username from the userNameClaim attribute |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| readinessProbe.initialDelaySeconds | int | `60` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ required "Global or specific tag is required" (.Values.image.tag | default .Values.global.datahub.version) }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.image.command }}
command: {{ .Values.image.command | toJson }}
{{- end }}
{{- if .Values.image.args }}
args: {{ .Values.image.args | toJson }}
{{- end }}
lifecycle:
{{- toYaml .Values.lifecycle | nindent 12 }}
ports:
Expand Down
4 changes: 4 additions & 0 deletions charts/datahub/subcharts/datahub-frontend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ image:
repository: linkedin/datahub-frontend-react
tag:
pullPolicy: IfNotPresent
# Override the image's command & args with a new one.
# This may be necessary for custom startup or shutdown behaviors
command:
args:

imagePullSecrets: []
nameOverride: ""
Expand Down
2 changes: 1 addition & 1 deletion charts/datahub/subcharts/datahub-gms/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: A Helm chart for LinkedIn DataHub's datahub-gms component
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.2.158
version: 0.2.159
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: v0.11.0
Loading

0 comments on commit 6f73340

Please sign in to comment.