argo-app/templates/dbs.yaml
Mikaël Cluseau 994361aac8 add db svc
2023-09-27 23:16:17 +02:00

51 lines
869 B
YAML

{{- range until (.Values.nb_db|int) }}
---
apiVersion: v1
kind: Service
metadata:
name: db-{{.}}
spec:
type: ClusterIP
ports:
- port: 2379
selector:
db: "{{.}}"
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: db-{{.}}
spec:
replicas: 1
selector:
matchLabels:
db: "{{.}}"
template:
metadata:
labels:
db: "{{.}}"
spec:
containers:
- name: db
image: quay.io/coreos/etcd:v3.5.9
command:
- etcd
- --data-dir=/data
env:
- name: ETCD_INITIAL_CLUSTER_STATE
value: new
volumeMounts:
- name: data
mountPath: /data
volumeClaimTemplates:
- metadata:
name: data
spec:
storageClassName: local
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
{{- end }}