diff --git a/hell_charts/templates/deployment.yaml b/hell_charts/templates/deployment.yaml index 7cc0489..134a1c8 100644 --- a/hell_charts/templates/deployment.yaml +++ b/hell_charts/templates/deployment.yaml @@ -16,7 +16,7 @@ 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: @@ -24,3 +24,21 @@ spec: 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 diff --git a/hell_charts/templates/dind-deployment.yaml b/hell_charts/templates/dind-deployment.yaml new file mode 100644 index 0000000..87915a0 --- /dev/null +++ b/hell_charts/templates/dind-deployment.yaml @@ -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 diff --git a/hell_charts/templates/pvc.yaml b/hell_charts/templates/pvc.yaml new file mode 100644 index 0000000..16fd255 --- /dev/null +++ b/hell_charts/templates/pvc.yaml @@ -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 diff --git a/hell_charts/templates/redis-deployment.yaml b/hell_charts/templates/redis-deployment.yaml new file mode 100644 index 0000000..90088ed --- /dev/null +++ b/hell_charts/templates/redis-deployment.yaml @@ -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 }} diff --git a/hell_charts/templates/secrets.yaml b/hell_charts/templates/secrets.yaml index 0aa963f..98525bf 100644 --- a/hell_charts/templates/secrets.yaml +++ b/hell_charts/templates/secrets.yaml @@ -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}} \ No newline at end of file + 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 }} \ No newline at end of file diff --git a/hell_charts/values.yaml.example b/hell_charts/values.yaml.example index d104b13..a891ba3 100644 --- a/hell_charts/values.yaml.example +++ b/hell_charts/values.yaml.example @@ -1,5 +1,5 @@ database: - databaseUrl: "yourdb" + databaseUrl: "yourdburl" origins: originUrls: "http://localhost:3000" @@ -7,8 +7,8 @@ origins: 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" @@ -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" + \ No newline at end of file