mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2024-12-14 11:58:02 +00:00
bug(helm): Fix parsing error with statefulset (#985)
* Fix parsing error with persistence and password secret configuration --------- Signed-off-by: Frédéric Marchand <frederic.marchand@kudelskisecurity.com> Co-authored-by: Tarun Pothulapati <tarun@dragonflydb.io>
This commit is contained in:
parent
b8b84c0749
commit
10e831825a
5 changed files with 141 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
default_stages: [commit]
|
default_stages: [commit]
|
||||||
exclude: 'src\/redis\/.*'
|
exclude: 'src\/redis\/.*'
|
||||||
|
exclude: 'contrib\/charts\/dragonfly\/ci\/.*'
|
||||||
repos:
|
repos:
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
|
|
|
@ -99,6 +99,7 @@ spec:
|
||||||
resources:
|
resources:
|
||||||
limits: {}
|
limits: {}
|
||||||
requests: {}
|
requests: {}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- name: DFLY_PASSWORD
|
- name: DFLY_PASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
|
|
@ -0,0 +1,120 @@
|
||||||
|
---
|
||||||
|
# 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.0.0"
|
||||||
|
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/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.0.0"
|
||||||
|
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/statefulset.yaml
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: test-dragonfly
|
||||||
|
namespace: default
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: dragonfly
|
||||||
|
app.kubernetes.io/instance: test
|
||||||
|
app.kubernetes.io/version: "v1.0.0"
|
||||||
|
app.kubernetes.io/managed-by: Helm
|
||||||
|
spec:
|
||||||
|
serviceName: test
|
||||||
|
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.0.0"
|
||||||
|
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: {}
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /data
|
||||||
|
name: "test-data"
|
||||||
|
env:
|
||||||
|
- name: DFLY_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: dfly-password
|
||||||
|
key: password
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: "test-data"
|
||||||
|
spec:
|
||||||
|
accessModes: [ "ReadWriteOnce" ]
|
||||||
|
storageClassName: standard
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 128Mi
|
|
@ -0,0 +1,18 @@
|
||||||
|
storage:
|
||||||
|
enabled: true
|
||||||
|
storageClassName: "standard"
|
||||||
|
requests: 128Mi
|
||||||
|
|
||||||
|
extraObjects:
|
||||||
|
- apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: dfly-password
|
||||||
|
stringData:
|
||||||
|
password: foobar
|
||||||
|
|
||||||
|
passwordFromSecret:
|
||||||
|
enable: true
|
||||||
|
existingSecret:
|
||||||
|
name: dfly-password
|
||||||
|
key: password
|
|
@ -86,7 +86,7 @@ containers:
|
||||||
{{- toYaml . | trim | nindent 6 }}
|
{{- toYaml . | trim | nindent 6 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- include "dragonfly.volumemounts" . | trim | nindent 4 }}
|
{{- include "dragonfly.volumemounts" . | trim | nindent 4 }}
|
||||||
{{- if .Values.passwordFromSecret.enable -}}
|
{{- if .Values.passwordFromSecret.enable }}
|
||||||
env:
|
env:
|
||||||
- name: DFLY_PASSWORD
|
- name: DFLY_PASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
|
Loading…
Reference in a new issue