Skip to content

Commit

Permalink
add specific statefulsets file, template port config for ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
sambukowski committed Sep 26, 2024
1 parent 7e8b571 commit 6ace483
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 84 deletions.
83 changes: 0 additions & 83 deletions charts/graph-node/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,86 +38,3 @@ spec:
value: {{ .Values.environment.ethereumNetwork }}:{{ .Values.environment.ethereumRPC }}
- name: GRAPH_LOG
value: info

---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: ipfs
namespace: {{ .Values.global.namespaceOverride | default .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: ipfs
template:
metadata:
labels:
app: ipfs
spec:
containers:
- name: ipfs
image: {{ .Values.ipfs.image }}:{{ .Values.ipfs.tag }}
ports:
- containerPort: {{ .Values.ipfs.ports.api | default 5001 }}
volumeMounts:
- name: ipfs-storage
mountPath: /data/ipfs
volumes:
- name: ipfs-storage
persistentVolumeClaim:
claimName: ipfs-pvc

---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
namespace: {{ .Values.global.namespaceOverride | default .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
securityContext:
fsGroup: 999
containers:
- name: postgres
image: {{ .Values.postgres.image }}:{{ .Values.postgres.tag }}
ports:
- containerPort: {{ .Values.postgres.ports.postgres | default 5432 }}
env:
- name: POSTGRES_USER
value: {{ .Values.postgres.user }}
- name: POSTGRES_PASSWORD
value: {{ .Values.postgres.password }}
- name: POSTGRES_DB
value: {{ .Values.postgres.database }}
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
- name: POSTGRES_INITDB_ARGS
value: "--lc-collate=C --lc-ctype=C --encoding=UTF8"
securityContext:
runAsUser: 999
runAsGroup: 999
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/postgresql/data
readinessProbe:
exec:
command: ["pg_isready", "-U", "{{ .Values.postgres.user }}"]
initialDelaySeconds: 10
periodSeconds: 5
resources:
requests:
cpu: 100m
memory: 256Mi
volumes:
- name: postgres-storage
persistentVolumeClaim:
claimName: postgres-pvc
2 changes: 1 addition & 1 deletion charts/graph-node/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
service:
name: graph-node
port:
number: 8000
number: {{ .Values.graphNode.ports.http | default 8000 }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
Expand Down
81 changes: 81 additions & 0 deletions charts/graph-node/templates/statefulsets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: ipfs
namespace: {{ .Values.global.namespaceOverride | default .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: ipfs
template:
metadata:
labels:
app: ipfs
spec:
containers:
- name: ipfs
image: {{ .Values.ipfs.image }}:{{ .Values.ipfs.tag }}
ports:
- containerPort: {{ .Values.ipfs.ports.api | default 5001 }}
volumeMounts:
- name: ipfs-storage
mountPath: /data/ipfs
volumes:
- name: ipfs-storage
persistentVolumeClaim:
claimName: ipfs-pvc

---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
namespace: {{ .Values.global.namespaceOverride | default .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
securityContext:
fsGroup: 999
containers:
- name: postgres
image: {{ .Values.postgres.image }}:{{ .Values.postgres.tag }}
ports:
- containerPort: {{ .Values.postgres.ports.postgres | default 5432 }}
env:
- name: POSTGRES_USER
value: {{ .Values.postgres.user }}
- name: POSTGRES_PASSWORD
value: {{ .Values.postgres.password }}
- name: POSTGRES_DB
value: {{ .Values.postgres.database }}
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
- name: POSTGRES_INITDB_ARGS
value: "--lc-collate=C --lc-ctype=C --encoding=UTF8"
securityContext:
runAsUser: 999
runAsGroup: 999
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/postgresql/data
readinessProbe:
exec:
command: ["pg_isready", "-U", "{{ .Values.postgres.user }}"]
initialDelaySeconds: 10
periodSeconds: 5
resources:
requests:
cpu: 100m
memory: 256Mi
volumes:
- name: postgres-storage
persistentVolumeClaim:
claimName: postgres-pvc

0 comments on commit 6ace483

Please sign in to comment.