-
Notifications
You must be signed in to change notification settings - Fork 983
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(Helm chart): Add env vars into pods (#4196)
* feat: update pod template Signed-off-by: andreibe <[email protected]> * fix: remove duplicate Signed-off-by: andreibe <[email protected]> * feat: update chart values.yaml Signed-off-by: andreibe <[email protected]> * feat: update README.md Signed-off-by: andreibe <[email protected]> * fix: change template behaviour on env Signed-off-by: andreibe <[email protected]> * chore: add helm ci tests Signed-off-by: andreibe <[email protected]> * fix: rerun go test Signed-off-by: andreibe <[email protected]> * test: add extra manifests Signed-off-by: andreibe <[email protected]> * fix: ci tests Signed-off-by: andreibe <[email protected]> --------- Signed-off-by: andreibe <[email protected]> Signed-off-by: andreibe <[email protected]> Co-authored-by: andreibe <[email protected]> Co-authored-by: Tarun Pothulapati <[email protected]>
- Loading branch information
1 parent
c857ff9
commit ada96d9
Showing
7 changed files
with
345 additions
and
1 deletion.
There are no files selected for viewing
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
136 changes: 136 additions & 0 deletions
136
contrib/charts/dragonfly/ci/extraenv-and-passwordSecret-values.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,136 @@ | ||
--- | ||
# 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.4" | ||
app.kubernetes.io/managed-by: Helm | ||
--- | ||
# Source: dragonfly/templates/extra-manifests.yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: dfly-password | ||
stringData: | ||
password: foobar | ||
--- | ||
# Source: dragonfly/templates/extra-manifests.yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: my-secret | ||
stringData: | ||
password: password | ||
username: username | ||
type: Opaque | ||
--- | ||
# Source: dragonfly/templates/extra-manifests.yaml | ||
apiVersion: v1 | ||
data: | ||
configKey1: configValue1 | ||
configKey2: configValue2 | ||
kind: ConfigMap | ||
metadata: | ||
name: my-configmap | ||
--- | ||
# 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.4" | ||
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.4" | ||
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.4" | ||
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: dfly-password | ||
key: password | ||
- name: ENV_VAR43 | ||
value: value1 | ||
- name: ENV_VAR323 | ||
value: value2 | ||
envFrom: | ||
- configMapRef: | ||
name: my-configmap | ||
- secretRef: | ||
name: my-secret |
40 changes: 40 additions & 0 deletions
40
contrib/charts/dragonfly/ci/extraenv-and-passwordSecret-values.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,40 @@ | ||
extraObjects: | ||
- apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: dfly-password | ||
stringData: | ||
password: foobar | ||
- apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: my-configmap | ||
data: | ||
configKey1: configValue1 | ||
configKey2: configValue2 | ||
- apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: my-secret | ||
type: Opaque | ||
stringData: | ||
username: username | ||
password: password | ||
|
||
env: | ||
- name: ENV_VAR43 | ||
value: value1 | ||
- name: ENV_VAR323 | ||
value: value2 | ||
|
||
envFrom: | ||
- configMapRef: | ||
name: my-configmap | ||
- secretRef: | ||
name: my-secret | ||
|
||
passwordFromSecret: | ||
enable: true | ||
existingSecret: | ||
name: dfly-password | ||
key: password |
123 changes: 123 additions & 0 deletions
123
contrib/charts/dragonfly/ci/extraenv-values.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,123 @@ | ||
--- | ||
# 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.4" | ||
app.kubernetes.io/managed-by: Helm | ||
--- | ||
# Source: dragonfly/templates/extra-manifests.yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: my-secret | ||
stringData: | ||
password: password | ||
username: username | ||
type: Opaque | ||
--- | ||
# Source: dragonfly/templates/extra-manifests.yaml | ||
apiVersion: v1 | ||
data: | ||
configKey1: configValue1 | ||
configKey2: configValue2 | ||
kind: ConfigMap | ||
metadata: | ||
name: my-configmap | ||
--- | ||
# 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.4" | ||
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.4" | ||
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.4" | ||
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: ENV_VAR43 | ||
value: value1 | ||
- name: ENV_VAR323 | ||
value: value2 | ||
envFrom: | ||
- configMapRef: | ||
name: my-configmap | ||
- secretRef: | ||
name: my-secret |
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,28 @@ | ||
extraObjects: | ||
- apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: my-configmap | ||
data: | ||
configKey1: configValue1 | ||
configKey2: configValue2 | ||
- apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: my-secret | ||
type: Opaque | ||
stringData: | ||
username: username | ||
password: password | ||
|
||
env: | ||
- name: ENV_VAR43 | ||
value: value1 | ||
- name: ENV_VAR323 | ||
value: value2 | ||
|
||
envFrom: | ||
- configMapRef: | ||
name: my-configmap | ||
- secretRef: | ||
name: my-secret |
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