created helm chart for wraft

master
razirizwan 2024-11-14 15:51:30 +05:30
commit e560c7b6dc
13 changed files with 259 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
values.yaml

23
.helmignore Normal file
View File

@ -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/

5
Chart.yaml Normal file
View File

@ -0,0 +1,5 @@
apiVersion: v2
name: myproject
description: A Helm chart for my project
version: 0.1.0

View File

@ -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

View File

@ -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 }}

View File

@ -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 }}

View File

@ -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 }}"

View File

@ -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"

11
templates/secret.yaml Normal file
View File

@ -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 }}

View File

@ -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

12
templates/service-db.yaml Normal file
View File

@ -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

View File

@ -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

View File

@ -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