Skip to content

Commit

Permalink
Add bootstrapExtraEnv for bootstrapping job (#601)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit-K authored Jan 3, 2025
1 parent f9433d2 commit 5064107
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions helm/polaris/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ $ helm uninstall --namespace polaris polaris
| autoscaling.minReplicas | int | `1` | The minimum number of replicas to maintain. |
| autoscaling.targetCPUUtilizationPercentage | int | `80` | Optional; set to zero or empty to disable. |
| autoscaling.targetMemoryUtilizationPercentage | string | `nil` | Optional; set to zero or empty to disable. |
| bootstrapExtraEnv | list | `[]` | Extra environment variables to add to the bootstrap metastore manager job (see `extraEnv` for an example) |
| bootstrapMetastoreManager | bool | `false` | Configures whether to enable the bootstrap metastore manager job |
| configMapLabels | object | `{}` | Additional Labels to apply to polaris configmap. |
| extraEnv | list | `[]` | Advanced configuration via Environment Variables. Extra environment variables to add to the Polaris server container. You can pass here any valid EnvVar object: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#envvar-v1-core This can be useful to get configuration values from Kubernetes secrets or config maps. |
Expand Down
4 changes: 4 additions & 0 deletions helm/polaris/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ spec:
imagePullPolicy: {{ tpl .Values.image.pullPolicy . }}
command: ["/app/bin/polaris-service"]
args: ["bootstrap", "/app/config/polaris-server.yml"]
{{- if .Values.bootstrapExtraEnv }}
env:
{{- tpl (toYaml .Values.bootstrapExtraEnv) . | nindent 12 }}
{{- end }}
volumeMounts:
- name: config-volume
mountPath: /app/config/polaris-server.yml
Expand Down
20 changes: 20 additions & 0 deletions helm/polaris/tests/job_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,26 @@ tests:
cpu: 200m
memory: 256Mi

# spec.template.spec.containers[0].env (with bootstrapMetastoreManager enabled)
- it: should not set container env by default
set:
bootstrapMetastoreManager: true
asserts:
- notExists:
path: spec.template.spec.containers[0].env
- it: should set container env
set:
bootstrapMetastoreManager: true
bootstrapExtraEnv:
- name: foo
value: bar
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: foo
value: bar

# spec.template.spec.nodeSelector (with bootstrapMetastoreManager enabled)
- it: should not set nodeSelector by default
set:
Expand Down
3 changes: 3 additions & 0 deletions helm/polaris/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ extraEnv:
# -- Configures whether to enable the bootstrap metastore manager job
bootstrapMetastoreManager: false

# -- Extra environment variables to add to the bootstrap metastore manager job (see `extraEnv` for an example)
bootstrapExtraEnv: []

# -- The secret name to pull persistence.xml from (ensure the key name is 'persistence.xml')
persistenceConfigSecret: ~

Expand Down

0 comments on commit 5064107

Please sign in to comment.