commit e560c7b6dc1f5a8c4a016f5e262be198a8d2f907 Author: razirizwan Date: Thu Nov 14 15:51:30 2024 +0530 created helm chart for wraft diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7f47975 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +values.yaml diff --git a/.helmignore b/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/Chart.yaml b/Chart.yaml new file mode 100644 index 0000000..5ba82f5 --- /dev/null +++ b/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: myproject +description: A Helm chart for my project +version: 0.1.0 + diff --git a/templates/createbucket-job.yaml b/templates/createbucket-job.yaml new file mode 100644 index 0000000..aa92123 --- /dev/null +++ b/templates/createbucket-job.yaml @@ -0,0 +1,23 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ .Release.Name }}-create-bucket +spec: + backoffLimit: 0 + template: + spec: + containers: + - name: create-bucket + image: minio/mc:latest + command: ["/bin/sh", "-c"] + args: + - | + mc --help > /dev/null 2>&1 || { + apk add --no-cache mc + } + mc config host add myminio http://myproject-minio:9000 minioadmin minioadmin + mc mb -p myminio/wraft + mc policy set public myminio/wraft + exit 0 + restartPolicy: Never + diff --git a/templates/deployment-backend.yaml b/templates/deployment-backend.yaml new file mode 100644 index 0000000..f0a93c5 --- /dev/null +++ b/templates/deployment-backend.yaml @@ -0,0 +1,63 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-backend +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Release.Name }}-backend + template: + metadata: + labels: + app: {{ .Release.Name }}-backend + spec: + containers: + - name: backend + image: {{ .Values.backend.image }} + ports: + - containerPort: {{ .Values.backend.service.targetPort | int }} + env: + - name: MIX_ENV + value: {{ .Values.backend.env.MIX_ENV | quote }} + - name: SECRET_KEY_BASE + valueFrom: + secretKeyRef: + name: backend-secret + key: SECRET_KEY_BASE + - name: GUARDIAN_KEY + value: {{ .Values.backend.env.GUARDIAN_KEY | quote }} + - name: DEV_DB_USERNAME + value: {{ .Values.backend.env.DEV_DB_USERNAME | quote }} + - name: DEV_DB_PASSWORD + valueFrom: + secretKeyRef: + name: backend-secret + key: DEV_DB_PASSWORD + - name: DEV_DB_NAME + value: {{ .Values.backend.env.DEV_DB_NAME | quote }} + - name: DEV_DB_HOST + value: {{ .Values.backend.env.DEV_DB_HOST | quote }} + - name: DEV_DB_PORT + value: {{ .Values.backend.env.DEV_DB_PORT | quote }} + - name: MINIO_URL + value: {{ .Values.backend.env.MINIO_URL | quote }} + - name: MINIO_HOST + value: {{ .Values.backend.env.MINIO_HOST | quote }} + - name: MINIO_PORT + value: {{ .Values.backend.env.MINIO_PORT | quote }} + - name: MINIO_BUCKET + value: {{ .Values.backend.env.MINIO_BUCKET | quote }} + - name: MINIO_ROOT_USER + valueFrom: + secretKeyRef: + name: backend-secret + key: MINIO_ROOT_USER + - name: MINIO_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: backend-secret + key: MINIO_ROOT_PASSWORD + - name: SENTRY_DSN + value: {{ .Values.backend.env.SENTRY_DSN | quote }} + diff --git a/templates/deployment-db.yaml b/templates/deployment-db.yaml new file mode 100644 index 0000000..48a7d22 --- /dev/null +++ b/templates/deployment-db.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-db +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Release.Name }}-db + template: + metadata: + labels: + app: {{ .Release.Name }}-db + spec: + containers: + - name: db + image: {{ .Values.db.image }} + ports: + - containerPort: {{ .Values.db.service.port | int }} + env: + - name: POSTGRES_USER + value: {{ .Values.db.env.POSTGRES_USER | quote }} + - name: POSTGRES_PASSWORD + value: {{ .Values.db.env.POSTGRES_PASSWORD | quote }} + - name: POSTGRES_DB + value: {{ .Values.db.env.POSTGRES_DB | quote }} + diff --git a/templates/deployment-frontend.yaml b/templates/deployment-frontend.yaml new file mode 100644 index 0000000..b08d2f2 --- /dev/null +++ b/templates/deployment-frontend.yaml @@ -0,0 +1,24 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-frontend +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Release.Name }}-frontend + template: + metadata: + labels: + app: {{ .Release.Name }}-frontend + spec: + containers: + - name: frontend + image: {{ .Values.frontend.image }} + ports: + - containerPort: {{ .Values.frontend.service.targetPort | int }} + env: + - name: NEXT_PUBLIC_API_HOST + value: "{{ .Values.frontend.env.NEXT_PUBLIC_API_HOST }}" + + diff --git a/templates/deployment-minio.yaml b/templates/deployment-minio.yaml new file mode 100644 index 0000000..9234a7b --- /dev/null +++ b/templates/deployment-minio.yaml @@ -0,0 +1,30 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: myproject-minio +spec: + replicas: 1 + selector: + matchLabels: + app: myproject-minio + template: + metadata: + labels: + app: myproject-minio + spec: + containers: + - name: minio + image: quay.io/minio/minio + command: + - "minio" + - "server" + - "/data" + - "--console-address=:9001" + ports: + - containerPort: 9000 + - containerPort: 9001 + env: + - name: MINIO_ROOT_USER + value: "minioadmin" + - name: MINIO_ROOT_PASSWORD + value: "minioadmin" diff --git a/templates/secret.yaml b/templates/secret.yaml new file mode 100644 index 0000000..5ae53e1 --- /dev/null +++ b/templates/secret.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Secret +metadata: + name: backend-secret +type: Opaque +stringData: + SECRET_KEY_BASE: {{ .Values.backend.env.SECRET_KEY_BASE | quote }} + DEV_DB_PASSWORD: {{ .Values.backend.env.DEV_DB_PASSWORD | quote }} + MINIO_ROOT_USER: {{ .Values.backend.env.MINIO_ROOT_USER | quote }} + MINIO_ROOT_PASSWORD: {{ .Values.backend.env.MINIO_ROOT_PASSWORD | quote }} + diff --git a/templates/service-backend.yaml b/templates/service-backend.yaml new file mode 100644 index 0000000..be635d0 --- /dev/null +++ b/templates/service-backend.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-backend +spec: + type: {{ .Values.backend.service.type }} + ports: + - port: {{ .Values.backend.service.port | int }} + targetPort: {{ .Values.backend.service.targetPort | int }} + selector: + app: {{ .Release.Name }}-backend + diff --git a/templates/service-db.yaml b/templates/service-db.yaml new file mode 100644 index 0000000..68e16cf --- /dev/null +++ b/templates/service-db.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-db +spec: + type: ClusterIP + ports: + - port: {{ .Values.db.service.port | int }} + targetPort: 5432 + selector: + app: {{ .Release.Name }}-db + diff --git a/templates/service-frontend.yaml b/templates/service-frontend.yaml new file mode 100644 index 0000000..e82b9c6 --- /dev/null +++ b/templates/service-frontend.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-frontend +spec: + type: {{ .Values.frontend.service.type }} + ports: + - port: {{ .Values.frontend.service.port | int }} + targetPort: {{ .Values.frontend.service.targetPort | int }} + selector: + app: {{ .Release.Name }}-frontend + diff --git a/templates/service-minio.yaml b/templates/service-minio.yaml new file mode 100644 index 0000000..e906739 --- /dev/null +++ b/templates/service-minio.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-minio +spec: + type: ClusterIP + ports: + - port: 9000 + targetPort: 9000 + name: api + - port: 9001 + targetPort: 9001 + name: console + selector: + app: {{ .Release.Name }}-minio +