-
Notifications
You must be signed in to change notification settings - Fork 981
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(contrib/helm): evaluate the provided passwordSecretName value as…
… a template (#4046) * feat(contrib/helm): evaluate the provided passwordSecretName value as a template Useful to reuse some defined variables or functions directly to compute the value (external chart for instance, that depends on this one) example: '{{ include "something.defined.elsewhere" $ }}-secrets' Signed-off-by: Raphael Glon <[email protected]> * update golden tests --------- Signed-off-by: Raphael Glon <[email protected]> Co-authored-by: Raphael Glon <[email protected]> Co-authored-by: Tarun Pothulapati <[email protected]>
- Loading branch information
1 parent
a87d6ae
commit 1ceca47
Showing
4 changed files
with
126 additions
and
3 deletions.
There are no files selected for viewing
108 changes: 108 additions & 0 deletions
108
contrib/charts/dragonfly/ci/passwordsecret-values.tpl.golden.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
--- | ||
# Source: dragonfly/templates/serviceaccount.yaml | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: test-dragonfly | ||
namespace: default | ||
labels: | ||
app.kubernetes.io/name: dragonfly | ||
app.kubernetes.io/instance: test | ||
app.kubernetes.io/version: "v1.25.3" | ||
app.kubernetes.io/managed-by: Helm | ||
--- | ||
# Source: dragonfly/templates/extra-manifests.yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: dragonfly-password | ||
stringData: | ||
password: foobar | ||
--- | ||
# Source: dragonfly/templates/service.yaml | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: test-dragonfly | ||
namespace: default | ||
labels: | ||
app.kubernetes.io/name: dragonfly | ||
app.kubernetes.io/instance: test | ||
app.kubernetes.io/version: "v1.25.3" | ||
app.kubernetes.io/managed-by: Helm | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 6379 | ||
targetPort: dragonfly | ||
protocol: TCP | ||
name: dragonfly | ||
selector: | ||
app.kubernetes.io/name: dragonfly | ||
app.kubernetes.io/instance: test | ||
--- | ||
# Source: dragonfly/templates/deployment.yaml | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: test-dragonfly | ||
namespace: default | ||
labels: | ||
app.kubernetes.io/name: dragonfly | ||
app.kubernetes.io/instance: test | ||
app.kubernetes.io/version: "v1.25.3" | ||
app.kubernetes.io/managed-by: Helm | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: dragonfly | ||
app.kubernetes.io/instance: test | ||
template: | ||
metadata: | ||
annotations: | ||
labels: | ||
app.kubernetes.io/name: dragonfly | ||
app.kubernetes.io/instance: test | ||
spec: | ||
serviceAccountName: test-dragonfly | ||
containers: | ||
- name: dragonfly | ||
image: "docker.dragonflydb.io/dragonflydb/dragonfly:v1.25.3" | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- name: dragonfly | ||
containerPort: 6379 | ||
protocol: TCP | ||
livenessProbe: | ||
exec: | ||
command: | ||
- /bin/sh | ||
- /usr/local/bin/healthcheck.sh | ||
failureThreshold: 3 | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 5 | ||
readinessProbe: | ||
exec: | ||
command: | ||
- /bin/sh | ||
- /usr/local/bin/healthcheck.sh | ||
failureThreshold: 3 | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 5 | ||
args: | ||
- "--alsologtostderr" | ||
resources: | ||
limits: {} | ||
requests: {} | ||
|
||
env: | ||
- name: DFLY_requirepass | ||
valueFrom: | ||
secretKeyRef: | ||
name: dragonfly-password | ||
key: password |
13 changes: 13 additions & 0 deletions
13
contrib/charts/dragonfly/ci/passwordsecret-values.tpl.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
extraObjects: | ||
- apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: dragonfly-password | ||
stringData: | ||
password: foobar | ||
|
||
passwordFromSecret: | ||
enable: true | ||
existingSecret: | ||
name: '{{ include "dragonfly.name" $ }}-password' | ||
key: password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= | ||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= | ||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= | ||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= | ||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= | ||
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= |