diff --git a/infrastructure/helm-chart/charts/tools/charts/postgresql/BUILD b/infrastructure/helm-chart/charts/tools/charts/postgresql/BUILD new file mode 100644 index 0000000000..ae4a40c627 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/postgresql/BUILD @@ -0,0 +1,5 @@ +load("//tools/build:helm.bzl", "helm_ruleset_version") + +helm_ruleset_version( + version = "15.1", +) diff --git a/infrastructure/helm-chart/charts/tools/charts/postgresql/Chart.yaml b/infrastructure/helm-chart/charts/tools/charts/postgresql/Chart.yaml new file mode 100644 index 0000000000..823c96c1b2 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/postgresql/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +appVersion: "1.0" +description: PostgreSQL Server +name: postgresql +version: 15.1 diff --git a/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/secret.yaml b/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/secret.yaml new file mode 100644 index 0000000000..b3eaeb9012 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: postgres + labels: + app: postgres +type: Opaque +data: + postgres-password: {{ default (randAlphaNum 32) | b64enc | quote }} diff --git a/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/service.yaml b/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/service.yaml new file mode 100644 index 0000000000..0f8805f575 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: postgres + labels: + app: postgres +spec: + type: ClusterIP + clusterIP: None + ports: + - name: postgres + port: {{ .Values.port }} + targetPort: {{ .Values.port }} + selector: + app: postgres diff --git a/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/statefulset.yaml b/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/statefulset.yaml new file mode 100644 index 0000000000..db74c96041 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/statefulset.yaml @@ -0,0 +1,49 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: postgres + labels: + app: postgres +spec: + replicas: 1 + selector: + matchLabels: + app: postgres + serviceName: postgres + template: + metadata: + labels: + app: postgres + spec: + terminationGracePeriodSeconds: 10 + containers: + - name: postgres + image: "postgres:{{ .Values.version }}" + imagePullPolicy: "IfNotPresent" + env: + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: postgres + key: postgres-password + ports: + - name: postgres + containerPort: {{ .Values.port }} + livenessProbe: + tcpSocket: + port: {{ .Values.port }} + initialDelaySeconds: 20 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + resources: {{ .Values.resources }} + volumeClaimTemplates: + - metadata: + name: postgres-data + spec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: {{ .Values.storage }} diff --git a/infrastructure/helm-chart/charts/tools/charts/postgresql/values.yaml b/infrastructure/helm-chart/charts/tools/charts/postgresql/values.yaml new file mode 100644 index 0000000000..d03860f654 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/postgresql/values.yaml @@ -0,0 +1,4 @@ +version: 15.1 +port: 5432 +storage: "5Gi" +resources: diff --git a/infrastructure/helm-chart/charts/tools/charts/redis/BUILD b/infrastructure/helm-chart/charts/tools/charts/redis/BUILD new file mode 100644 index 0000000000..0fae927253 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/redis/BUILD @@ -0,0 +1,5 @@ +load("//tools/build:helm.bzl", "helm_ruleset_version") + +helm_ruleset_version( + version = "7.0.8", +) diff --git a/infrastructure/helm-chart/charts/tools/charts/redis/Chart.yaml b/infrastructure/helm-chart/charts/tools/charts/redis/Chart.yaml new file mode 100644 index 0000000000..566654a6bd --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/redis/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +appVersion: "1.0" +description: Redis Server +name: redis +version: 7.0.8 diff --git a/infrastructure/helm-chart/charts/tools/charts/redis/templates/secret.yaml b/infrastructure/helm-chart/charts/tools/charts/redis/templates/secret.yaml new file mode 100644 index 0000000000..c2c8dd96c5 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/redis/templates/secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: redis + labels: + app: redis +type: Opaque +data: + redis-password: {{ default (randAlphaNum 32) | b64enc | quote }} diff --git a/infrastructure/helm-chart/charts/tools/charts/redis/templates/service.yaml b/infrastructure/helm-chart/charts/tools/charts/redis/templates/service.yaml new file mode 100644 index 0000000000..6d80b395a9 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/redis/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis + labels: + app: redis +spec: + type: ClusterIP + clusterIP: None + ports: + - name: redis + port: {{ .Values.port }} + targetPort: {{ .Values.port }} + selector: + app: redis diff --git a/infrastructure/helm-chart/charts/tools/charts/redis/templates/statefulset.yaml b/infrastructure/helm-chart/charts/tools/charts/redis/templates/statefulset.yaml new file mode 100644 index 0000000000..b81a79a9fe --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/redis/templates/statefulset.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: redis + labels: + app: redis +spec: + replicas: 1 + selector: + matchLabels: + app: redis + serviceName: redis + template: + metadata: + labels: + app: redis + spec: + terminationGracePeriodSeconds: 10 + containers: + - name: redis + image: "redis:{{ .Values.version }}" + imagePullPolicy: "IfNotPresent" + command: + - "redis-server" + env: + - name: REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis + key: redis-password + ports: + - name: redis + containerPort: {{ .Values.port }} + livenessProbe: + tcpSocket: + port: {{ .Values.port }} + initialDelaySeconds: 20 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + resources: {{ .Values.resources }} + volumeClaimTemplates: + - metadata: + name: redis-data + spec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: {{ .Values.storage }} diff --git a/infrastructure/helm-chart/charts/tools/charts/redis/values.yaml b/infrastructure/helm-chart/charts/tools/charts/redis/values.yaml new file mode 100644 index 0000000000..3de6277432 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/redis/values.yaml @@ -0,0 +1,4 @@ +version: 7.0.8 +port: 6379 +storage: "5Gi" +resources: \ No newline at end of file