Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datago 30302/upgrading vault to 1.8.11 #13

Merged
merged 116 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
690ee41
Add objectSelector to webhookconfiguration (#456)
guru1306 Feb 20, 2021
ff73577
changelog++
jasonodonnell Feb 20, 2021
4c1d79f
Add CSI secrets store provider (#461)
tomhjp Mar 19, 2021
3e36bb7
updating acceptance tests to k8s 1.17 on gke (#473)
tvoran Mar 24, 2021
2ddac08
changelog++
tomhjp Mar 24, 2021
102f9e4
Target vault-csi-provider release 0.1.0 (#475)
tomhjp Mar 25, 2021
f75b19f
Update to 0.10.0 (#477)
jasonodonnell Mar 25, 2021
7fd6959
Add volumes and mounts support for CSI (#479)
jasonodonnell Mar 25, 2021
703ba50
changelog++
jasonodonnell Mar 25, 2021
a685664
Remove extra word in readme (#482)
coignetp Mar 30, 2021
7a71c0f
fix csi helm deployment (#486)
ArieLevs Apr 6, 2021
b244573
changelog++
tomhjp Apr 7, 2021
a2a07b2
add hostNetwork value to injector deployment (#471)
paulwitt Apr 8, 2021
6e46bcf
changelog++
jasonodonnell Apr 8, 2021
bfbeba2
feat(ingress): Extra paths to prepend to the ingress host configurati…
samjmarshall Apr 8, 2021
ccebde9
changelog++
jasonodonnell Apr 8, 2021
ec67b5d
Add logLevel and logFormat values for Vault (#488)
jasonodonnell Apr 8, 2021
dc696bb
changelog++
jasonodonnell Apr 8, 2021
d8c2d20
Custom value of agent port (#489)
HamzaZo Apr 12, 2021
b838d4b
changelog++
jasonodonnell Apr 12, 2021
bf5783e
Add injector agent default overrides (#493)
jasonodonnell Apr 12, 2021
366cf23
changelog++
jasonodonnell Apr 12, 2021
088ce89
[injector] Add port name in injector service (#495)
javiercri Apr 13, 2021
f2e3d57
changelog++
jasonodonnell Apr 13, 2021
5f2e1d4
Fix injector unit test failing (#496)
jasonodonnell Apr 14, 2021
be1721f
Remove redundant logic (#434)
tomhjp Apr 14, 2021
2733859
Update to v0.11.0 (#497)
jasonodonnell Apr 14, 2021
dcb4b10
Add container based tests documentation (#492)
ArieLevs Apr 14, 2021
b59cbf6
Set kubeVersion and added chart-verifier tests (#510)
tvoran May 10, 2021
794a86a
changelog++
tvoran May 10, 2021
6e8ef40
match kubeVersion on semver pre-releases (#512)
tvoran May 11, 2021
92aed2c
Add ImagePullSecrets to CSI daemonset (#519)
mehmetsalgar May 12, 2021
f84fc7e
changelog++
tomhjp May 12, 2021
1505e77
changelog++
tomhjp May 12, 2021
2a70a9f
fix CONTRIBUTING.md (#501)
ArieLevs May 12, 2021
f226051
updating to use new dedicated context and token (#515)
sarahethompson May 13, 2021
ed38f6d
added values json schema (#513)
tvoran May 14, 2021
e817b1d
changelog++
tvoran May 14, 2021
0ab15df
[Issue-520] tolerations for csi-daemonset (#521)
mehmetsalgar May 18, 2021
dbd99b1
changelog++
tvoran May 18, 2021
030d3cd
Add extraArgs value for CSI (#526)
tomhjp May 21, 2021
23ff8a1
changelog++
tomhjp May 21, 2021
e206fad
add schema unit tests (#530)
tvoran May 25, 2021
4c71c26
Add UI targetPort option (#437)
inigohu May 25, 2021
d53b011
changelog++
jasonodonnell May 25, 2021
b21b37b
Update to v0.12.0 (#532)
jasonodonnell May 25, 2021
3593739
Adding helm test for vault server (#531)
tvoran May 28, 2021
3afcb46
changelog++
tvoran May 28, 2021
af25981
fix ui.serviceNodePort schema (#537)
tvoran Jun 1, 2021
828b312
changelog++
tvoran Jun 1, 2021
4588760
change maxUnavailable to integer (#535)
rule88 Jun 1, 2021
ad9a46a
changelog++
tvoran Jun 1, 2021
637087f
use vault-helm-test:0.2.0 (#543)
tvoran Jun 2, 2021
d27121c
Added webhook-certs volume mount to sidecar injector (#545)
Jun 10, 2021
bb63d73
changelog++
tvoran Jun 10, 2021
4d23074
Adding server.enterpriseLicense (#547)
tvoran Jun 11, 2021
3a6e097
changelog++
tvoran Jun 11, 2021
0f832e0
Add openshift overrides (#549)
tvoran Jun 16, 2021
7509bc7
changelog++
tvoran Jun 16, 2021
f67b844
Update to v0.13.0 (#554)
tvoran Jun 17, 2021
14d1f97
injector: add templateConfig.exitOnRetryFailure annotation (#560)
calvn Jul 6, 2021
1e4709c
feature: Support configuring various properties as YAML directly. (#565)
benashz Jul 7, 2021
f5ef752
++changelog
benashz Jul 7, 2021
2d42085
Update the default vault agent image to come from the hashicorp docke…
benashz Jul 12, 2021
4a4295d
Update acceptance tests to use the new stable GKE version 1.18.x (#569)
benashz Jul 12, 2021
a0d7b84
++changelog
benashz Jul 12, 2021
255cdc7
Add ingress/route configurable to specify active/general service (#570)
jasonodonnell Jul 15, 2021
4365686
changelog++
jasonodonnell Jul 15, 2021
64b4d88
feature: imagePullSecrets from string array. (#576)
benashz Jul 23, 2021
86ff773
++changelog
benashz Jul 23, 2021
a5c8562
vault-helm 0.14.0 release (#578)
tvoran Jul 28, 2021
bfc01c1
Update chart verifier (#579)
tvoran Jul 29, 2021
c9c23b1
Add imagePullSecrets on server test (#572)
shiinro Aug 12, 2021
2773175
changelog++
tvoran Aug 12, 2021
f7ab37f
Add injector.webhookAnnotations chart option (#584)
tvoran Aug 16, 2021
22df6c0
changelog++
tvoran Aug 16, 2021
c820454
vault-helm 0.15.0 release (#598)
tvoran Aug 23, 2021
d31f942
Support vault-k8s internal leader election (#568)
tvoran Aug 31, 2021
87a0a56
changelog++
tvoran Aug 31, 2021
8932c37
Fix the CSI acceptance test (#608)
tvoran Sep 8, 2021
23e0348
feat(csi): make provider hostPaths configurable (#603)
eyenx Sep 15, 2021
c267805
changelog++
benashz Sep 15, 2021
dd3b3f0
changelog++
benashz Sep 15, 2021
5a864f7
Adding support for the old leader-elector (#607)
tvoran Sep 16, 2021
78a355b
changelog++
tvoran Sep 16, 2021
cd20591
vault 0.16.0 release (#612)
tvoran Sep 16, 2021
b69e3d9
vault-helm default branch is now `main` (#618)
tvoran Sep 28, 2021
5dfc351
vault-helm 0.16.1 release (#619)
tvoran Sep 29, 2021
9758666
fix chart publish job (#620)
tvoran Sep 30, 2021
72c485d
ingress stable networking api (#590)
vrumjantsev Oct 9, 2021
ffd5086
changelog++ (#623)
tvoran Oct 11, 2021
96b8c98
Updating acceptance tests (#624)
tvoran Oct 11, 2021
d96a428
Feat: add externalTrafficPolicy support (#626)
benashz Oct 18, 2021
6914c4d
fix(csi-ds): mountpoint-dir same mountpath in pod (#628)
eyenx Oct 19, 2021
4aa01e8
Update changelog for #626 and #628 (#631)
benashz Oct 21, 2021
3b1bb78
Add server.ingress.ingressClassName (#630)
tvoran Oct 21, 2021
91ac2ee
vault-helm 0.17.0 release (#632)
tvoran Oct 21, 2021
dc08ab6
note a regression in 0.17.0 (#635)
tvoran Oct 23, 2021
c09c50f
Add option for Ingress pathType (#634)
tico24 Oct 25, 2021
a186036
changelog++ (#636)
imthaghost Oct 25, 2021
4db9e83
v0.17.1 (#637)
imthaghost Oct 25, 2021
8582cb3
Explain this fork in the README
j-setiawan Apr 2, 2020
9ad36a1
Adding support for LoadBalancerIP field in ServiceSpec
Apr 10, 2020
6ee557e
DATAGO-13861: Adding support for logrotate
hadielaham88 May 19, 2021
d5313bf
DATAGO-13861: Adding audit log rotation and shipment to datdog
hadielaham88 May 26, 2021
7f03e7c
Fixing minor typos and removing extra lines
hadielaham88 May 26, 2021
0e796d4
Update to 0.4.0
jasonodonnell Feb 21, 2020
a99988d
Explain this fork in the README
j-setiawan Apr 2, 2020
d7767ac
Adding support for LoadBalancerIP field in ServiceSpec
Apr 10, 2020
f8fc3b4
DATAGO-13861: Adding support for logrotate
hadielaham88 May 19, 2021
8e98540
DATAGO-13861: Adding audit log rotation and shipment to datdog
hadielaham88 May 26, 2021
3562df6
Fixing minor typos and removing extra lines
hadielaham88 May 26, 2021
d92becf
feat(DATAGO-27002): Upgrade vault to version 1.7.9 (#12)
nagsubhrajitt Jun 1, 2022
fa13d7d
fix: deploy_local.sh error with file
adhish2001 Jul 14, 2022
e4b7208
minor changes
adhish2001 Jul 14, 2022
b3cadd7
Merge branch 'develop' into DATAGO-30302/upgrading-vault-to-1.8.11
adhish2001 Jul 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- image: docker.mirror.hashicorp.services/cimg/go:1.16
environment:
BATS_VERSION: "1.3.0"
CHART_VERIFIER_VERSION: "1.0.0"
CHART_VERIFIER_VERSION: "1.2.1"
steps:
- checkout
- run:
Expand Down Expand Up @@ -94,7 +94,7 @@ workflows:
- bats-unit-test
filters:
branches:
only: master
only: main
update-helm-charts-index:
jobs:
- update-helm-charts-index:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ vaul-helm-dev-creds.json
./test/unit/vaul-helm-dev-creds.json
./test/acceptance/values.yaml
./test/acceptance/values.yml
.idea
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,61 @@
## Unreleased

## 0.17.1 (October 25th, 2021)

Improvements:
* Add option for Ingress PathType [GH-634](https://github.com/hashicorp/vault-helm/pull/634)

## 0.17.0 (October 21st, 2021)

KNOWN ISSUES:
* The chart will fail to deploy on Kubernetes 1.19+ with `server.ingress.enabled=true` because no `pathType` is set

CHANGES:
* Vault image default 1.8.4
* Vault K8s image default 0.14.0

Improvements:
* Support Ingress stable networking API [GH-590](https://github.com/hashicorp/vault-helm/pull/590)
* Support setting the `externalTrafficPolicy` for `LoadBalancer` and `NodePort` service types [GH-626](https://github.com/hashicorp/vault-helm/pull/626)
* Support setting ingressClassName on server Ingress [GH-630](https://github.com/hashicorp/vault-helm/pull/630)

Bugs:
* Ensure `kubeletRootDir` volume path and mounts are the same when `csi.daemonSet.kubeletRootDir` is overridden [GH-628](https://github.com/hashicorp/vault-helm/pull/628)

## 0.16.1 (September 29th, 2021)

CHANGES:
* Vault image default 1.8.3
* Vault K8s image default 0.13.1

## 0.16.0 (September 16th, 2021)

CHANGES:
* Support for deploying a leader-elector container with the [vault-k8s injector](https://github.com/hashicorp/vault-k8s) injector will be removed in version 0.18.0 of this chart since vault-k8s now uses an internal mechanism to determine leadership. To enable the deployment of the leader-elector container for use with vault-k8s 0.12.0 and earlier, set `useContainer=true`.

Improvements:
* Make CSI provider `hostPaths` configurable via `csi.daemonSet.providersDir` and `csi.daemonSet.kubeletRootDir` [GH-603](https://github.com/hashicorp/vault-helm/pull/603)
* Support vault-k8s internal leader election [GH-568](https://github.com/hashicorp/vault-helm/pull/568) [GH-607](https://github.com/hashicorp/vault-helm/pull/607)

## 0.15.0 (August 23rd, 2021)

Improvements:
* Add imagePullSecrets on server test [GH-572](https://github.com/hashicorp/vault-helm/pull/572)
* Add injector.webhookAnnotations chart option [GH-584](https://github.com/hashicorp/vault-helm/pull/584)

## 0.14.0 (July 28th, 2021)

Features:
* Added templateConfig.exitOnRetryFailure annotation for the injector [GH-560](https://github.com/hashicorp/vault-helm/pull/560)

Improvements:
* Support configuring pod tolerations, pod affinity, and node selectors as YAML [GH-565](https://github.com/hashicorp/vault-helm/pull/565)
* Set the default vault image to come from the hashicorp organization [GH-567](https://github.com/hashicorp/vault-helm/pull/567)
* Add support for running the acceptance tests against a local `kind` cluster [GH-567](https://github.com/hashicorp/vault-helm/pull/567)
* Add `server.ingress.activeService` to configure if the ingress should use the active service [GH-570](https://github.com/hashicorp/vault-helm/pull/570)
* Add `server.route.activeService` to configure if the route should use the active service [GH-570](https://github.com/hashicorp/vault-helm/pull/570)
* Support configuring `global.imagePullSecrets` from a string array [GH-576](https://github.com/hashicorp/vault-helm/pull/576)

## 0.13.0 (June 17th, 2021)

Improvements:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ quickly merge or address your contributions.

* Make sure you test against the latest released version. It is possible
we already fixed the bug you're experiencing. Even better is if you can test
against `master`, as bugs are fixed regularly but new versions are only
against `main`, as bugs are fixed regularly but new versions are only
released every few months.

* Provide steps to reproduce the issue, and if possible include the expected
Expand Down Expand Up @@ -121,7 +121,7 @@ may not be properly cleaned up. We recommend recycling the Kubernetes cluster to
start from a clean slate.

**Note:** There is a Terraform configuration in the
[`test/terraform/`](https://github.com/hashicorp/vault-helm/tree/master/test/terraform) directory
[`test/terraform/`](https://github.com/hashicorp/vault-helm/tree/main/test/terraform) directory
that can be used to quickly bring up a GKE cluster and configure
`kubectl` and `helm` locally. This can be used to quickly spin up a test
cluster for acceptance tests. Unit tests _do not_ require a running Kubernetes
Expand Down
7 changes: 4 additions & 3 deletions Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
apiVersion: v2
name: vault
version: 0.13.0
appVersion: 1.7.3
version: 0.17.1
appVersion: 1.8.4
kubeVersion: ">= 1.14.0-0"
description: Official HashiCorp Vault Chart
description: Install and configure Vault on Kubernetes.

home: https://www.vaultproject.io
icon: https://github.com/hashicorp/vault/raw/f22d202cde2018f9455dec755118a9b84586e082/Vault_PrimaryLogo_Black.png
keywords: ["vault", "security", "encryption", "secrets", "management", "automation", "infrastructure"]
Expand Down
37 changes: 35 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ CLOUDSDK_CORE_PROJECT?=vault-helm-dev-246514
# set to run a single test - e.g acceptance/server-ha-enterprise-dr.bats
ACCEPTANCE_TESTS?=acceptance


# filter bats unit tests to run.
UNIT_TESTS_FILTER?='.*'

# set to 'true' to run acceptance tests locally in a kind cluster
LOCAL_ACCEPTANCE_TESTS?=false

# kind cluster name
KIND_CLUSTER_NAME?=vault-helm

# kind k8s version
KIND_K8S_VERSION?=v1.20.2

# Generate json schema for chart values. See test/README.md for more details.
values-schema:
helm schema-gen values.yaml > values.schema.json
Expand All @@ -12,7 +25,7 @@ test-image:
@docker build --rm -t $(TEST_IMAGE) -f $(CURDIR)/test/docker/Test.dockerfile $(CURDIR)

test-unit:
@docker run -it -v ${PWD}:/helm-test $(TEST_IMAGE) bats /helm-test/test/unit
@docker run --rm -it -v ${PWD}:/helm-test $(TEST_IMAGE) bats -f $(UNIT_TESTS_FILTER) /helm-test/test/unit

test-bats: test-unit test-acceptance

Expand All @@ -21,14 +34,19 @@ test: test-image test-bats
# run acceptance tests on GKE
# set google project/credential vars above
test-acceptance:
ifeq ($(LOCAL_ACCEPTANCE_TESTS),true)
make setup-kind acceptance
else
@docker run -it -v ${PWD}:/helm-test \
-e GOOGLE_CREDENTIALS=${GOOGLE_CREDENTIALS} \
-e CLOUDSDK_CORE_PROJECT=${CLOUDSDK_CORE_PROJECT} \
-e KUBECONFIG=/helm-test/.kube/config \
-e VAULT_LICENSE_CI=${VAULT_LICENSE_CI} \
-w /helm-test \
$(TEST_IMAGE) \
make acceptance

endif

# destroy GKE cluster using terraform
test-destroy:
@docker run -it -v ${PWD}:/helm-test \
Expand All @@ -51,7 +69,9 @@ test-provision:
# this target is for running the acceptance tests
# it is run in the docker container above when the test-acceptance target is invoked
acceptance:
ifneq ($(LOCAL_ACCEPTANCE_TESTS),true)
gcloud auth activate-service-account --key-file=${GOOGLE_CREDENTIALS}
endif
bats test/${ACCEPTANCE_TESTS}

# this target is for provisioning the GKE cluster
Expand All @@ -66,4 +86,17 @@ provision-cluster:
destroy-cluster:
terraform destroy -auto-approve

# create a kind cluster for running the acceptance tests locally
setup-kind:
kind get clusters | grep -q "^${KIND_CLUSTER_NAME}$$" || \
kind create cluster \
--image kindest/node:${KIND_K8S_VERSION} \
--name ${KIND_CLUSTER_NAME} \
--config $(CURDIR)/test/kind/config.yaml
kubectl config use-context kind-${KIND_CLUSTER_NAME}

# delete the kind cluster
delete-kind:
kind delete cluster --name ${KIND_CLUSTER_NAME} || :

.PHONY: values-schema test-image test-unit test-bats test test-acceptance test-destroy test-provision acceptance provision-cluster destroy-cluster
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ $ helm repo add hashicorp https://helm.releases.hashicorp.com
$ helm install vault hashicorp/vault
```

Please see the many options supported in the `values.yaml` file. These are also
fully documented directly on the [Vault
website](https://www.vaultproject.io/docs/platform/k8s/helm) along with more
detailed installation instructions.
Please see the many options supported in the `values.yaml`
file. These are also fully documented directly on the
[Vault website](https://www.vaultproject.io/docs/platform/k8s/helm.html).


## Customizations
Expand Down
112 changes: 107 additions & 5 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,12 @@ Set's the affinity for pod placement when running in standalone and HA modes.
{{- define "vault.affinity" -}}
{{- if and (ne .mode "dev") .Values.server.affinity }}
affinity:
{{ tpl .Values.server.affinity . | nindent 8 | trim }}
{{ $tp := typeOf .Values.server.affinity }}
{{- if eq $tp "string" }}
{{- tpl .Values.server.affinity . | nindent 8 | trim }}
{{- else }}
{{- toYaml .Values.server.affinity | nindent 8 }}
{{- end }}
{{ end }}
{{- end -}}

Expand All @@ -242,17 +247,27 @@ Sets the injector affinity for pod placement
{{- define "injector.affinity" -}}
{{- if .Values.injector.affinity }}
affinity:
{{ tpl .Values.injector.affinity . | nindent 8 | trim }}
{{ $tp := typeOf .Values.injector.affinity }}
{{- if eq $tp "string" }}
{{- tpl .Values.injector.affinity . | nindent 8 | trim }}
{{- else }}
{{- toYaml .Values.injector.affinity | nindent 8 }}
{{- end }}
{{ end }}
{{- end -}}

{{/*
Set's the toleration for pod placement when running in standalone and HA modes.
Sets the toleration for pod placement when running in standalone and HA modes.
*/}}
{{- define "vault.tolerations" -}}
{{- if and (ne .mode "dev") .Values.server.tolerations }}
tolerations:
{{- $tp := typeOf .Values.server.tolerations }}
{{- if eq $tp "string" }}
{{ tpl .Values.server.tolerations . | nindent 8 | trim }}
{{- else }}
{{- toYaml .Values.server.tolerations | nindent 8 }}
{{- end }}
{{- end }}
{{- end -}}

Expand All @@ -262,7 +277,12 @@ Sets the injector toleration for pod placement
{{- define "injector.tolerations" -}}
{{- if .Values.injector.tolerations }}
tolerations:
{{- $tp := typeOf .Values.injector.tolerations }}
{{- if eq $tp "string" }}
{{ tpl .Values.injector.tolerations . | nindent 8 | trim }}
{{- else }}
{{- toYaml .Values.injector.tolerations | nindent 8 }}
{{- end }}
{{- end }}
{{- end -}}

Expand All @@ -272,7 +292,12 @@ Set's the node selector for pod placement when running in standalone and HA mode
{{- define "vault.nodeselector" -}}
{{- if and (ne .mode "dev") .Values.server.nodeSelector }}
nodeSelector:
{{ tpl .Values.server.nodeSelector . | indent 8 | trim }}
{{- $tp := typeOf .Values.server.nodeSelector }}
{{- if eq $tp "string" }}
{{ tpl .Values.server.nodeSelector . | nindent 8 | trim }}
{{- else }}
{{- toYaml .Values.server.nodeSelector | nindent 8 }}
{{- end }}
{{- end }}
{{- end -}}

Expand All @@ -282,7 +307,12 @@ Sets the injector node selector for pod placement
{{- define "injector.nodeselector" -}}
{{- if .Values.injector.nodeSelector }}
nodeSelector:
{{ tpl .Values.injector.nodeSelector . | indent 8 | trim }}
{{- $tp := typeOf .Values.injector.nodeSelector }}
{{- if eq $tp "string" }}
{{ tpl .Values.injector.nodeSelector . | nindent 8 | trim }}
{{- else }}
{{- toYaml .Values.injector.nodeSelector | nindent 8 }}
{{- end }}
{{- end }}
{{- end -}}

Expand Down Expand Up @@ -331,6 +361,21 @@ Sets extra injector service annotations
{{- end }}
{{- end -}}

{{/*
Sets extra injector webhook annotations
*/}}
{{- define "injector.webhookAnnotations" -}}
{{- if .Values.injector.webhookAnnotations }}
annotations:
{{- $tp := typeOf .Values.injector.webhookAnnotations }}
{{- if eq $tp "string" }}
{{- tpl .Values.injector.webhookAnnotations . | nindent 4 }}
{{- else }}
{{- toYaml .Values.injector.webhookAnnotations | nindent 4 }}
{{- end }}
{{- end }}
{{- end -}}

{{/*
Sets extra ui service annotations
*/}}
Expand Down Expand Up @@ -527,7 +572,12 @@ Sets the injector toleration for pod placement
{{- define "csi.pod.tolerations" -}}
{{- if .Values.csi.pod.tolerations }}
tolerations:
{{- $tp := typeOf .Values.csi.pod.tolerations }}
{{- if eq $tp "string" }}
{{ tpl .Values.csi.pod.tolerations . | nindent 8 | trim }}
{{- else }}
{{- toYaml .Values.csi.pod.tolerations | nindent 8 }}
{{- end }}
{{- end }}
{{- end -}}

Expand Down Expand Up @@ -596,3 +646,55 @@ Inject extra environment populated by secrets, if populated
{{ "https" }}
{{- end -}}
{{- end -}}

{{/*
imagePullSecrets generates pull secrets from either string or map values.
A map value must be indexable by the key 'name'.
*/}}
{{- define "imagePullSecrets" -}}
{{- with .Values.global.imagePullSecrets -}}
imagePullSecrets:
{{- range . -}}
{{- if typeIs "string" . }}
- name: {{ . }}
{{- else if index . "name" }}
- name: {{ .name }}
{{- end }}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
externalTrafficPolicy sets a Service's externalTrafficPolicy if applicable.
Supported inputs are Values.server.service and Values.ui
*/}}
{{- define "service.externalTrafficPolicy" -}}
{{- $type := "" -}}
{{- if .serviceType -}}
{{- $type = .serviceType -}}
{{- else if .type -}}
{{- $type = .type -}}
{{- end -}}
{{- if and .externalTrafficPolicy (or (eq $type "LoadBalancer") (eq $type "NodePort")) }}
externalTrafficPolicy: {{ .externalTrafficPolicy }}
{{- else }}
{{- end }}
{{- end -}}

{{/*
loadBalancer configuration for the the UI service.
Supported inputs are Values.ui
*/}}
{{- define "service.loadBalancer" -}}
{{- if eq (.serviceType | toString) "LoadBalancer" }}
{{- if .loadBalancerIP }}
loadBalancerIP: {{ .loadBalancerIP }}
{{- end }}
{{- with .loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range . }}
- {{ . }}
{{- end }}
{{- end -}}
{{- end }}
{{- end -}}
Loading