Skip to content

Commit

Permalink
feat: helm deployment untested
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidharth-Singh10 committed Nov 2, 2024
1 parent 727601a commit 4c9b03e
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 8 deletions.
20 changes: 19 additions & 1 deletion hell_charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,29 @@ spec:
spec:
containers:
- name: backend
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
image: {{ .Values.image.rusty_backend.repository }}:{{ .Values.image.rusty_backend.tag }}
ports:
- containerPort: {{ .Values.deployment.containerPort }}
envFrom:
- configMapRef:
name: {{ .Release.Name }}-configmap
- secretRef:
name: {{ .Release.Name }}-secret
volumeMounts:
- name: certs-volume
mountPath: /certs/client
readOnly: true
- name: backend-data
mountPath: /var/rusty_backend_home
- name: docker-sock
mountPath: /var/run/docker.sock
volumes:
- name: certs-volume
persistentVolumeClaim:
claimName: rustybackenddockercerts
- name: backend-data
persistentVolumeClaim:
claimName: rustybackenddata
- name: docker-sock
hostPath:
path: /var/run/docker.sock
38 changes: 38 additions & 0 deletions hell_charts/templates/dind-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-dind
labels:
app: {{ .Release.Name }}-dind
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}-dind
template:
metadata:
labels:
app: {{ .Release.Name }}-dind
spec:
containers:
- name: dind
image: {{ .Values.image.docker_dind }}
securityContext:
privileged: true # Required for Docker-in-Docker
env:
- name: DOCKER_TLS_CERTDIR
value: "/certs"
ports:
- containerPort: {{ .Values.services.docker_dind.port }}
volumeMounts:
- name: certs-volume
mountPath: /certs/client
- name: backend-data
mountPath: /var/rusty_backend_home
volumes:
- name: certs-volume
persistentVolumeClaim:
claimName: rustybackenddockercerts
- name: backend-data
persistentVolumeClaim:
claimName: rustybackenddata
21 changes: 21 additions & 0 deletions hell_charts/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: rustybackenddata
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: rustybackenddockercerts
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
21 changes: 21 additions & 0 deletions hell_charts/templates/redis-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-redis
labels:
app: {{ .Release.Name }}-redis
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}-redis
template:
metadata:
labels:
app: {{ .Release.Name }}-redis
spec:
containers:
- name: redis
image: {{ .Values.image.redis }}
ports:
- containerPort: {{ .Values.services.redis.port }}
5 changes: 4 additions & 1 deletion hell_charts/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ type: Opaque
data:
SMTP_PASSWORD: {{ .Values.smtp.smtpPassword | b64enc | quote }}
OTP_SECRET: {{ .Values.otpSecret | b64enc | quote }}
JWT_SECRET: {{ .Values.jwtSecret | b64enc | quote}}
JWT_SECRET: {{ .Values.jwtSecret | b64enc | quote}}
AWS_ACCESS_KEY_ID: {{ .Values.secrets.awsAccessKeyId | b64enc | quote }}
AWS_SECRET_ACCESS_KEY: {{.Values.secrets.awsSecretAccessKey | b64enc | quote }}
AWS_REGION: {{.Values.secrets.awsRegion | b64enc | quote }}
32 changes: 26 additions & 6 deletions hell_charts/values.yaml.example
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
database:
databaseUrl: "yourdb"
databaseUrl: "yourdburl"

origins:
originUrls: "http://localhost:3000"

passResetLink: "http://localhost:5173/reset-password"

smtp:
smtpHost: "smtp.example.com"
smtpUsername: "example@example.com"
smtpHost: "smtp.zyx.com"
smtpUsername: "example@gmail.com"
smtpPassword: "example"

otpSecret: "example"
Expand All @@ -20,6 +20,26 @@ deployment:


image:
repository: "yourusername/yourimage"
tag: "latest"

rusty_backend:
repository: "example/affinity_backend"
tag: "latest"
pullPolicy: "Always"

docker_dind: "docker:dind"
redis: "redis:latest"

services:
rusty_backend:
port: 3001
redis:
port: 6379
docker_dind:
port: 2376


secrets:
awsSecretName: "example-secret"
awsAccessKeyId: "example"
awsSecretAccessKey: "8YYwRWIC5u+example"
awsRegion: "ap-example-1"

0 comments on commit 4c9b03e

Please sign in to comment.