Fix templates for dateme app
This commit is contained in:
parent
f5cb52c57a
commit
e13c6bac3c
82
charts/dateme-chart/templates/backend-deployment.yaml
Normal file
82
charts/dateme-chart/templates/backend-deployment.yaml
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-{{ .Values.backend.name }}
|
||||||
|
namespace: {{ .Values.global.namespace }}
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.backend.name }}
|
||||||
|
component: backend
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.backend.replicaCount }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.backend.name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.backend.name }}
|
||||||
|
component: backend
|
||||||
|
spec:
|
||||||
|
initContainers:
|
||||||
|
- name: wait-for-postgres
|
||||||
|
image: postgres:16-alpine
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
until pg_isready -h {{ .Release.Name }}-{{ .Values.postgres.name }}-headless -p {{ .Values.postgres.port }}; do
|
||||||
|
echo "Waiting for PostgreSQL..."
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
echo "PostgreSQL is ready!"
|
||||||
|
containers:
|
||||||
|
- name: {{ .Values.backend.name }}
|
||||||
|
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.backend.service.targetPort }}
|
||||||
|
name: http
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
{{- if .Values.backend.env }}
|
||||||
|
{{- range $key, $value := .Values.backend.env }}
|
||||||
|
- name: {{ $key }}
|
||||||
|
value: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
- name: DATABASE_URL
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ .Release.Name }}-db-credentials
|
||||||
|
key: DATABASE_URL
|
||||||
|
startupProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 3
|
||||||
|
failureThreshold: 30
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 3
|
||||||
|
failureThreshold: 2
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: {{ .Values.backend.resources.requests.cpu }}
|
||||||
|
memory: {{ .Values.backend.resources.requests.memory }}
|
||||||
|
limits:
|
||||||
|
cpu: {{ .Values.backend.resources.limits.cpu }}
|
||||||
|
memory: {{ .Values.backend.resources.limits.memory }}
|
||||||
17
charts/dateme-chart/templates/backend-service.yaml
Normal file
17
charts/dateme-chart/templates/backend-service.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-{{ .Values.backend.name }}
|
||||||
|
namespace: {{ .Values.global.namespace }}
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.backend.name }}
|
||||||
|
component: backend
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.backend.service.type }}
|
||||||
|
selector:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.backend.name }}
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: {{ .Values.backend.service.port }}
|
||||||
|
targetPort: {{ .Values.backend.service.targetPort }}
|
||||||
|
protocol: TCP
|
||||||
@ -1,99 +0,0 @@
|
|||||||
---
|
|
||||||
# PVC for Backend media storage
|
|
||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: backend-media-pvc
|
|
||||||
namespace: dating-app
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteMany
|
|
||||||
{{- if .Values.backend.persistence.storageClass }}
|
|
||||||
storageClassName: {{ .Values.backend.persistence.storageClass }}
|
|
||||||
{{- end }}
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: {{ .Values.backend.persistence.size }}
|
|
||||||
|
|
||||||
---
|
|
||||||
# Backend Deployment
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: backend
|
|
||||||
namespace: dating-app
|
|
||||||
labels:
|
|
||||||
app: backend
|
|
||||||
spec:
|
|
||||||
replicas: {{ .Values.backend.replicas }}
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: backend
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: backend
|
|
||||||
spec:
|
|
||||||
initContainers:
|
|
||||||
- name: db-init
|
|
||||||
image: postgres:15-alpine
|
|
||||||
command: ['sh', '-c', 'until pg_isready -h postgres.dating-app.svc.cluster.local -p {{ .Values.postgres.service.port }}; do echo waiting for db; sleep 2; done;']
|
|
||||||
containers:
|
|
||||||
- name: backend
|
|
||||||
image: {{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag }}
|
|
||||||
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
|
|
||||||
ports:
|
|
||||||
- containerPort: {{ .Values.backend.service.targetPort }}
|
|
||||||
name: http
|
|
||||||
envFrom:
|
|
||||||
- configMapRef:
|
|
||||||
name: backend-config
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: {{ .Values.backend.resources.requests.memory }}
|
|
||||||
cpu: {{ .Values.backend.resources.requests.cpu }}
|
|
||||||
limits:
|
|
||||||
memory: {{ .Values.backend.resources.limits.memory }}
|
|
||||||
cpu: {{ .Values.backend.resources.limits.cpu }}
|
|
||||||
volumeMounts:
|
|
||||||
- name: media-storage
|
|
||||||
mountPath: {{ .Values.backend.persistence.mountPath }}
|
|
||||||
{{- if .Values.backend.probes.readiness.enabled }}
|
|
||||||
readinessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: {{ .Values.backend.probes.readiness.path }}
|
|
||||||
port: {{ .Values.backend.service.targetPort }}
|
|
||||||
initialDelaySeconds: {{ .Values.backend.probes.readiness.initialDelaySeconds }}
|
|
||||||
periodSeconds: {{ .Values.backend.probes.readiness.periodSeconds }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.backend.probes.liveness.enabled }}
|
|
||||||
livenessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: {{ .Values.backend.probes.liveness.path }}
|
|
||||||
port: {{ .Values.backend.service.targetPort }}
|
|
||||||
initialDelaySeconds: {{ .Values.backend.probes.liveness.initialDelaySeconds }}
|
|
||||||
periodSeconds: {{ .Values.backend.probes.liveness.periodSeconds }}
|
|
||||||
{{- end }}
|
|
||||||
volumes:
|
|
||||||
- name: media-storage
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: backend-media-pvc
|
|
||||||
|
|
||||||
---
|
|
||||||
# Backend Service
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: backend
|
|
||||||
namespace: dating-app
|
|
||||||
labels:
|
|
||||||
app: backend
|
|
||||||
spec:
|
|
||||||
type: {{ .Values.backend.service.type }}
|
|
||||||
selector:
|
|
||||||
app: backend
|
|
||||||
ports:
|
|
||||||
- port: {{ .Values.backend.service.port }}
|
|
||||||
targetPort: {{ .Values.backend.service.targetPort }}
|
|
||||||
protocol: TCP
|
|
||||||
name: http
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
# ConfigMap for backend configuration
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: backend-config
|
|
||||||
namespace: dating-app
|
|
||||||
data:
|
|
||||||
JWT_SECRET: {{ .Values.backend.environment.JWT_SECRET | quote }}
|
|
||||||
JWT_EXPIRES_MINUTES: {{ .Values.backend.environment.JWT_EXPIRES_MINUTES | quote }}
|
|
||||||
MEDIA_DIR: {{ .Values.backend.environment.MEDIA_DIR | quote }}
|
|
||||||
CORS_ORIGINS: {{ .Values.backend.environment.CORS_ORIGINS | quote }}
|
|
||||||
DATABASE_URL: "postgresql://{{ .Values.postgres.credentials.username }}:{{ .Values.postgres.credentials.password }}@postgres.dating-app.svc.cluster.local:{{ .Values.postgres.service.port }}/{{ .Values.postgres.credentials.database }}"
|
|
||||||
|
|
||||||
---
|
|
||||||
# ConfigMap for frontend configuration
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: frontend-config
|
|
||||||
namespace: dating-app
|
|
||||||
data:
|
|
||||||
VITE_API_URL: {{ .Values.frontend.environment.VITE_API_URL | quote }}
|
|
||||||
23
charts/dateme-chart/templates/db-schema-configmap.yaml
Normal file
23
charts/dateme-chart/templates/db-schema-configmap.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-db-schema
|
||||||
|
namespace: {{ .Values.global.namespace }}
|
||||||
|
data:
|
||||||
|
schema.sql: |
|
||||||
|
-- Create users table
|
||||||
|
CREATE TABLE IF NOT EXISTS users (
|
||||||
|
id SERIAL PRIMARY KEY,
|
||||||
|
username TEXT UNIQUE NOT NULL,
|
||||||
|
email TEXT UNIQUE NOT NULL,
|
||||||
|
password_hash TEXT NOT NULL,
|
||||||
|
first_name TEXT,
|
||||||
|
last_name TEXT,
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_users_username ON users (username);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_users_email ON users (email);
|
||||||
|
|
||||||
|
-- Placeholder for dateme-specific tables
|
||||||
|
-- Add your application schema here
|
||||||
13
charts/dateme-chart/templates/db-secret.yaml
Normal file
13
charts/dateme-chart/templates/db-secret.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-db-credentials
|
||||||
|
namespace: {{ .Values.global.namespace }}
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
DATABASE_URL: postgresql://{{ .Values.postgres.user }}:{{ .Values.postgres.password }}@{{ .Release.Name }}-{{ .Values.postgres.name }}-headless.{{ .Values.global.namespace }}.svc.cluster.local:{{ .Values.postgres.port }}/{{ .Values.postgres.database }}
|
||||||
|
DB_HOST: {{ printf "%s-%s-headless.%s.svc.cluster.local" .Release.Name .Values.postgres.name .Values.global.namespace }}
|
||||||
|
DB_PORT: "{{ .Values.postgres.port }}"
|
||||||
|
DB_NAME: {{ .Values.postgres.database | quote }}
|
||||||
|
DB_USER: {{ .Values.postgres.user | quote }}
|
||||||
|
DB_PASSWORD: {{ .Values.postgres.password | quote }}
|
||||||
35
charts/dateme-chart/templates/db-service.yaml
Normal file
35
charts/dateme-chart/templates/db-service.yaml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-{{ .Values.postgres.name }}-headless
|
||||||
|
namespace: {{ .Values.global.namespace }}
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.postgres.name }}
|
||||||
|
component: database
|
||||||
|
spec:
|
||||||
|
clusterIP: None
|
||||||
|
selector:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.postgres.name }}
|
||||||
|
ports:
|
||||||
|
- name: postgres
|
||||||
|
port: {{ .Values.postgres.port }}
|
||||||
|
targetPort: {{ .Values.postgres.port }}
|
||||||
|
protocol: TCP
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-{{ .Values.postgres.name }}
|
||||||
|
namespace: {{ .Values.global.namespace }}
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.postgres.name }}
|
||||||
|
component: database
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.postgres.service.type }}
|
||||||
|
selector:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.postgres.name }}
|
||||||
|
ports:
|
||||||
|
- name: postgres
|
||||||
|
port: {{ .Values.postgres.service.port }}
|
||||||
|
targetPort: {{ .Values.postgres.port }}
|
||||||
|
protocol: TCP
|
||||||
84
charts/dateme-chart/templates/db-statefulset.yaml
Normal file
84
charts/dateme-chart/templates/db-statefulset.yaml
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-{{ .Values.postgres.name }}
|
||||||
|
namespace: {{ .Values.global.namespace }}
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.postgres.name }}
|
||||||
|
component: database
|
||||||
|
spec:
|
||||||
|
serviceName: {{ .Release.Name }}-{{ .Values.postgres.name }}-headless
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.postgres.name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.postgres.name }}
|
||||||
|
component: database
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: postgres
|
||||||
|
image: "{{ .Values.postgres.image.repository }}:{{ .Values.postgres.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.postgres.image.pullPolicy }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.postgres.port }}
|
||||||
|
name: postgres
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: POSTGRES_USER
|
||||||
|
value: {{ .Values.postgres.user | quote }}
|
||||||
|
- name: POSTGRES_PASSWORD
|
||||||
|
value: {{ .Values.postgres.password | quote }}
|
||||||
|
- name: POSTGRES_DB
|
||||||
|
value: {{ .Values.postgres.database | quote }}
|
||||||
|
- name: PGDATA
|
||||||
|
value: /var/lib/postgresql/data/pgdata
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /var/lib/postgresql/data
|
||||||
|
- name: init-sql
|
||||||
|
mountPath: /docker-entrypoint-initdb.d
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- pg_isready -U {{ .Values.postgres.user }}
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- pg_isready -U {{ .Values.postgres.user }}
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 2
|
||||||
|
failureThreshold: 3
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: {{ .Values.postgres.resources.requests.cpu }}
|
||||||
|
memory: {{ .Values.postgres.resources.requests.memory }}
|
||||||
|
limits:
|
||||||
|
cpu: {{ .Values.postgres.resources.limits.cpu }}
|
||||||
|
memory: {{ .Values.postgres.resources.limits.memory }}
|
||||||
|
volumes:
|
||||||
|
- name: init-sql
|
||||||
|
configMap:
|
||||||
|
name: {{ .Release.Name }}-db-schema
|
||||||
|
defaultMode: 0755
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- {{ .Values.postgres.persistence.accessMode }}
|
||||||
|
storageClassName: {{ .Values.postgres.persistence.storageClass }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.postgres.persistence.size }}
|
||||||
57
charts/dateme-chart/templates/frontend-deployment.yaml
Normal file
57
charts/dateme-chart/templates/frontend-deployment.yaml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-{{ .Values.frontend.name }}
|
||||||
|
namespace: {{ .Values.global.namespace }}
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.frontend.name }}
|
||||||
|
component: frontend
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.frontend.replicaCount }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.frontend.name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.frontend.name }}
|
||||||
|
component: frontend
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: {{ .Values.frontend.name }}
|
||||||
|
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.frontend.service.targetPort }}
|
||||||
|
name: http
|
||||||
|
protocol: TCP
|
||||||
|
{{- with .Values.frontend.env }}
|
||||||
|
env:
|
||||||
|
{{- range $key, $value := . }}
|
||||||
|
- name: {{ $key }}
|
||||||
|
value: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 3
|
||||||
|
failureThreshold: 2
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: {{ .Values.frontend.resources.requests.cpu }}
|
||||||
|
memory: {{ .Values.frontend.resources.requests.memory }}
|
||||||
|
limits:
|
||||||
|
cpu: {{ .Values.frontend.resources.limits.cpu }}
|
||||||
|
memory: {{ .Values.frontend.resources.limits.memory }}
|
||||||
17
charts/dateme-chart/templates/frontend-service.yaml
Normal file
17
charts/dateme-chart/templates/frontend-service.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-{{ .Values.frontend.name }}
|
||||||
|
namespace: {{ .Values.global.namespace }}
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.frontend.name }}
|
||||||
|
component: frontend
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.frontend.service.type }}
|
||||||
|
selector:
|
||||||
|
app: {{ .Release.Name }}-{{ .Values.frontend.name }}
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: {{ .Values.frontend.service.port }}
|
||||||
|
targetPort: {{ .Values.frontend.service.targetPort }}
|
||||||
|
protocol: TCP
|
||||||
@ -1,71 +0,0 @@
|
|||||||
---
|
|
||||||
# Frontend Deployment
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: frontend
|
|
||||||
namespace: dating-app
|
|
||||||
labels:
|
|
||||||
app: frontend
|
|
||||||
spec:
|
|
||||||
replicas: {{ .Values.frontend.replicas }}
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: frontend
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: frontend
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: frontend
|
|
||||||
image: {{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag }}
|
|
||||||
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
|
|
||||||
ports:
|
|
||||||
- containerPort: {{ .Values.frontend.service.targetPort }}
|
|
||||||
name: http
|
|
||||||
envFrom:
|
|
||||||
- configMapRef:
|
|
||||||
name: frontend-config
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: {{ .Values.frontend.resources.requests.memory }}
|
|
||||||
cpu: {{ .Values.frontend.resources.requests.cpu }}
|
|
||||||
limits:
|
|
||||||
memory: {{ .Values.frontend.resources.limits.memory }}
|
|
||||||
cpu: {{ .Values.frontend.resources.limits.cpu }}
|
|
||||||
{{- if .Values.frontend.probes.readiness.enabled }}
|
|
||||||
readinessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: {{ .Values.frontend.probes.readiness.path }}
|
|
||||||
port: {{ .Values.frontend.service.targetPort }}
|
|
||||||
initialDelaySeconds: {{ .Values.frontend.probes.readiness.initialDelaySeconds }}
|
|
||||||
periodSeconds: {{ .Values.frontend.probes.readiness.periodSeconds }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.frontend.probes.liveness.enabled }}
|
|
||||||
livenessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: {{ .Values.frontend.probes.liveness.path }}
|
|
||||||
port: {{ .Values.frontend.service.targetPort }}
|
|
||||||
initialDelaySeconds: {{ .Values.frontend.probes.liveness.initialDelaySeconds }}
|
|
||||||
periodSeconds: {{ .Values.frontend.probes.liveness.periodSeconds }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
---
|
|
||||||
# Frontend Service
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: frontend
|
|
||||||
namespace: dating-app
|
|
||||||
labels:
|
|
||||||
app: frontend
|
|
||||||
spec:
|
|
||||||
type: {{ .Values.frontend.service.type }}
|
|
||||||
selector:
|
|
||||||
app: frontend
|
|
||||||
ports:
|
|
||||||
- port: {{ .Values.frontend.service.port }}
|
|
||||||
targetPort: {{ .Values.frontend.service.targetPort }}
|
|
||||||
protocol: TCP
|
|
||||||
name: http
|
|
||||||
@ -1,51 +1,89 @@
|
|||||||
{{- if .Values.ingress.enabled }}
|
{{- if .Values.frontend.ingress.enabled }}
|
||||||
---
|
|
||||||
# Ingress for Backend API
|
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: backend-ingress
|
name: {{ .Release.Name }}-frontend
|
||||||
namespace: dating-app
|
namespace: {{ .Values.global.namespace }}
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}-frontend
|
||||||
|
component: frontend
|
||||||
|
{{- with .Values.frontend.ingress.annotations }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- range $key, $value := .Values.ingress.annotations }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{ $key }}: {{ $value | quote }}
|
{{- end }}
|
||||||
{{- end }}
|
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: {{ .Values.ingress.className }}
|
{{- if .Values.frontend.ingress.className }}
|
||||||
|
ingressClassName: {{ .Values.frontend.ingress.className }}
|
||||||
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
- host: {{ .Values.backend.ingress.host }}
|
{{- range .Values.frontend.ingress.hosts }}
|
||||||
http:
|
- host: {{ .host | quote }}
|
||||||
paths:
|
http:
|
||||||
- path: {{ .Values.backend.ingress.path }}
|
paths:
|
||||||
pathType: {{ .Values.backend.ingress.pathType }}
|
{{- range .paths }}
|
||||||
backend:
|
- path: {{ .path }}
|
||||||
service:
|
pathType: {{ .pathType }}
|
||||||
name: backend
|
backend:
|
||||||
port:
|
service:
|
||||||
number: {{ .Values.backend.service.port }}
|
name: {{ $.Release.Name }}-{{ $.Values.frontend.name }}
|
||||||
|
port:
|
||||||
|
number: {{ $.Values.frontend.service.port }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.frontend.ingress.tls }}
|
||||||
|
tls:
|
||||||
|
{{- range .Values.frontend.ingress.tls }}
|
||||||
|
- hosts:
|
||||||
|
{{- range .hosts }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
secretName: {{ .secretName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
---
|
---
|
||||||
# Ingress for Frontend
|
|
||||||
|
{{- if .Values.backend.ingress.enabled }}
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: frontend-ingress
|
name: {{ .Release.Name }}-backend
|
||||||
namespace: dating-app
|
namespace: {{ .Values.global.namespace }}
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}-backend
|
||||||
|
component: backend
|
||||||
|
{{- with .Values.backend.ingress.annotations }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- range $key, $value := .Values.ingress.annotations }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{ $key }}: {{ $value | quote }}
|
{{- end }}
|
||||||
{{- end }}
|
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: {{ .Values.ingress.className }}
|
{{- if .Values.backend.ingress.className }}
|
||||||
|
ingressClassName: {{ .Values.backend.ingress.className }}
|
||||||
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
- host: {{ .Values.frontend.ingress.host }}
|
{{- range .Values.backend.ingress.hosts }}
|
||||||
http:
|
- host: {{ .host | quote }}
|
||||||
paths:
|
http:
|
||||||
- path: {{ .Values.frontend.ingress.path }}
|
paths:
|
||||||
pathType: {{ .Values.frontend.ingress.pathType }}
|
{{- range .paths }}
|
||||||
backend:
|
- path: {{ .path }}
|
||||||
service:
|
pathType: {{ .pathType }}
|
||||||
name: frontend
|
backend:
|
||||||
port:
|
service:
|
||||||
number: {{ .Values.frontend.service.port }}
|
name: {{ $.Release.Name }}-{{ $.Values.backend.name }}
|
||||||
|
port:
|
||||||
|
number: {{ $.Values.backend.service.port }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.backend.ingress.tls }}
|
||||||
|
tls:
|
||||||
|
{{- range .Values.backend.ingress.tls }}
|
||||||
|
- hosts:
|
||||||
|
{{- range .hosts }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
secretName: {{ .secretName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
# Namespace
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: dating-app
|
|
||||||
@ -1,105 +0,0 @@
|
|||||||
{{- if .Values.postgres.enabled }}
|
|
||||||
---
|
|
||||||
# ConfigMap for PostgreSQL initialization scripts
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: postgres-init-scripts
|
|
||||||
namespace: dating-app
|
|
||||||
data:
|
|
||||||
01-init-db.sh: |
|
|
||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Create the application user if it doesn't exist
|
|
||||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
|
||||||
-- Create application user if not exists
|
|
||||||
DO \$do\$ BEGIN
|
|
||||||
CREATE ROLE {{ .Values.postgres.credentials.username }} WITH LOGIN PASSWORD '{{ .Values.postgres.credentials.password }}';
|
|
||||||
EXCEPTION WHEN DUPLICATE_OBJECT THEN
|
|
||||||
RAISE NOTICE 'Role {{ .Values.postgres.credentials.username }} already exists';
|
|
||||||
END
|
|
||||||
\$do\$;
|
|
||||||
|
|
||||||
-- Grant privileges
|
|
||||||
GRANT ALL PRIVILEGES ON DATABASE {{ .Values.postgres.credentials.database }} TO {{ .Values.postgres.credentials.username }};
|
|
||||||
GRANT ALL PRIVILEGES ON SCHEMA public TO {{ .Values.postgres.credentials.username }};
|
|
||||||
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO {{ .Values.postgres.credentials.username }};
|
|
||||||
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO {{ .Values.postgres.credentials.username }};
|
|
||||||
EOSQL
|
|
||||||
|
|
||||||
02-create-tables.sql: |
|
|
||||||
-- Create tables for dating app
|
|
||||||
CREATE TABLE IF NOT EXISTS users (
|
|
||||||
id SERIAL PRIMARY KEY,
|
|
||||||
email VARCHAR(255) UNIQUE NOT NULL,
|
|
||||||
hashed_password VARCHAR(255) NOT NULL,
|
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS profiles (
|
|
||||||
id SERIAL PRIMARY KEY,
|
|
||||||
user_id INTEGER NOT NULL UNIQUE,
|
|
||||||
display_name VARCHAR(255) NOT NULL,
|
|
||||||
age INTEGER NOT NULL,
|
|
||||||
gender VARCHAR(50) NOT NULL,
|
|
||||||
location VARCHAR(255) NOT NULL,
|
|
||||||
bio TEXT,
|
|
||||||
interests JSONB DEFAULT '[]',
|
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS photos (
|
|
||||||
id SERIAL PRIMARY KEY,
|
|
||||||
profile_id INTEGER NOT NULL,
|
|
||||||
file_path VARCHAR(255) NOT NULL,
|
|
||||||
display_order INTEGER NOT NULL,
|
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (profile_id) REFERENCES profiles(id) ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS likes (
|
|
||||||
id SERIAL PRIMARY KEY,
|
|
||||||
liker_id INTEGER NOT NULL,
|
|
||||||
liked_id INTEGER NOT NULL,
|
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
UNIQUE(liker_id, liked_id),
|
|
||||||
FOREIGN KEY (liker_id) REFERENCES users(id) ON DELETE CASCADE,
|
|
||||||
FOREIGN KEY (liked_id) REFERENCES users(id) ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS conversations (
|
|
||||||
id SERIAL PRIMARY KEY,
|
|
||||||
user_id_1 INTEGER NOT NULL,
|
|
||||||
user_id_2 INTEGER NOT NULL,
|
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
UNIQUE(user_id_1, user_id_2),
|
|
||||||
FOREIGN KEY (user_id_1) REFERENCES users(id) ON DELETE CASCADE,
|
|
||||||
FOREIGN KEY (user_id_2) REFERENCES users(id) ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS messages (
|
|
||||||
id SERIAL PRIMARY KEY,
|
|
||||||
conversation_id INTEGER NOT NULL,
|
|
||||||
sender_id INTEGER NOT NULL,
|
|
||||||
content TEXT NOT NULL,
|
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (conversation_id) REFERENCES conversations(id) ON DELETE CASCADE,
|
|
||||||
FOREIGN KEY (sender_id) REFERENCES users(id) ON DELETE CASCADE
|
|
||||||
);
|
|
||||||
|
|
||||||
-- Create indexes for performance
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_users_email ON users(email);
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_profiles_user_id ON profiles(user_id);
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_photos_profile_id ON photos(profile_id);
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_likes_liker_id ON likes(liker_id);
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_likes_liked_id ON likes(liked_id);
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_conversations_users ON conversations(user_id_1, user_id_2);
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_messages_conversation_id ON messages(conversation_id);
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_messages_created_at ON messages(created_at);
|
|
||||||
|
|
||||||
{{- end }}
|
|
||||||
@ -1,127 +0,0 @@
|
|||||||
{{- if .Values.postgres.enabled }}
|
|
||||||
---
|
|
||||||
# Headless Service for StatefulSet
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: postgres
|
|
||||||
namespace: dating-app
|
|
||||||
labels:
|
|
||||||
app: postgres
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: {{ .Values.postgres.service.port }}
|
|
||||||
targetPort: {{ .Values.postgres.service.port }}
|
|
||||||
name: postgres
|
|
||||||
clusterIP: None # Headless service for StatefulSet
|
|
||||||
selector:
|
|
||||||
app: postgres
|
|
||||||
|
|
||||||
---
|
|
||||||
# PostgreSQL StatefulSet
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: postgres
|
|
||||||
namespace: dating-app
|
|
||||||
labels:
|
|
||||||
app: postgres
|
|
||||||
spec:
|
|
||||||
serviceName: postgres
|
|
||||||
replicas: {{ .Values.postgres.replicas }}
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: postgres
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: postgres
|
|
||||||
spec:
|
|
||||||
securityContext:
|
|
||||||
fsGroup: 999
|
|
||||||
containers:
|
|
||||||
- name: postgres
|
|
||||||
image: {{ .Values.postgres.image }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
ports:
|
|
||||||
- containerPort: {{ .Values.postgres.service.port }}
|
|
||||||
name: postgres
|
|
||||||
env:
|
|
||||||
- name: POSTGRES_USER
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: postgres-credentials
|
|
||||||
key: username
|
|
||||||
- name: POSTGRES_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: postgres-credentials
|
|
||||||
key: password
|
|
||||||
- name: POSTGRES_DB
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: postgres-credentials
|
|
||||||
key: database
|
|
||||||
- name: PGDATA
|
|
||||||
value: /var/lib/postgresql/data/pgdata
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: {{ .Values.postgres.resources.requests.memory }}
|
|
||||||
cpu: {{ .Values.postgres.resources.requests.cpu }}
|
|
||||||
limits:
|
|
||||||
memory: {{ .Values.postgres.resources.limits.memory }}
|
|
||||||
cpu: {{ .Values.postgres.resources.limits.cpu }}
|
|
||||||
volumeMounts:
|
|
||||||
- name: postgres-storage
|
|
||||||
mountPath: /var/lib/postgresql/data
|
|
||||||
- name: init-scripts
|
|
||||||
mountPath: /docker-entrypoint-initdb.d
|
|
||||||
livenessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- pg_isready -U $POSTGRES_USER
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 3
|
|
||||||
readinessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- pg_isready -U $POSTGRES_USER
|
|
||||||
initialDelaySeconds: 10
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 2
|
|
||||||
failureThreshold: 3
|
|
||||||
volumes:
|
|
||||||
- name: init-scripts
|
|
||||||
configMap:
|
|
||||||
name: postgres-init-scripts
|
|
||||||
defaultMode: 0755
|
|
||||||
volumeClaimTemplates:
|
|
||||||
- metadata:
|
|
||||||
name: postgres-storage
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
{{- if .Values.postgres.persistence.storageClass }}
|
|
||||||
storageClassName: {{ .Values.postgres.persistence.storageClass }}
|
|
||||||
{{- end }}
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: {{ .Values.postgres.persistence.size }}
|
|
||||||
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
type: {{ .Values.postgres.service.type | default "ClusterIP" }}
|
|
||||||
selector:
|
|
||||||
app: postgres
|
|
||||||
ports:
|
|
||||||
- port: {{ .Values.postgres.service.port }}
|
|
||||||
targetPort: {{ .Values.postgres.service.port }}
|
|
||||||
protocol: TCP
|
|
||||||
name: postgres
|
|
||||||
{{- end }}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
# Secret for PostgreSQL credentials
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: postgres-credentials
|
|
||||||
namespace: dating-app
|
|
||||||
type: Opaque
|
|
||||||
data:
|
|
||||||
username: {{ .Values.postgres.credentials.username | b64enc }}
|
|
||||||
password: {{ .Values.postgres.credentials.password | b64enc }}
|
|
||||||
database: {{ .Values.postgres.credentials.database | b64enc }}
|
|
||||||
@ -1,127 +1,125 @@
|
|||||||
# Default values for dating-app Helm chart
|
# Default values for dateme-chart
|
||||||
|
|
||||||
# Global settings
|
|
||||||
global:
|
global:
|
||||||
domain: example.com
|
namespace: my-apps
|
||||||
|
imagePullSecrets: []
|
||||||
# PostgreSQL configuration
|
|
||||||
postgres:
|
|
||||||
enabled: true
|
|
||||||
image: postgres:15-alpine
|
|
||||||
replicas: 1
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: "256Mi"
|
|
||||||
cpu: "100m"
|
|
||||||
limits:
|
|
||||||
memory: "512Mi"
|
|
||||||
cpu: "500m"
|
|
||||||
persistence:
|
|
||||||
enabled: true
|
|
||||||
size: 10Gi
|
|
||||||
storageClass: ""
|
|
||||||
credentials:
|
|
||||||
username: dating_app_user
|
|
||||||
password: Aa123456
|
|
||||||
database: dating_app
|
|
||||||
service:
|
|
||||||
port: 5432
|
|
||||||
|
|
||||||
# Backend configuration
|
# Backend configuration
|
||||||
backend:
|
backend:
|
||||||
|
name: backend
|
||||||
|
replicaCount: 1
|
||||||
image:
|
image:
|
||||||
repository: dating-app-backend
|
repository: harbor.dvirlabs.com/my-apps/dateme-backend
|
||||||
tag: latest
|
pullPolicy: Always
|
||||||
pullPolicy: IfNotPresent
|
tag: develop-latest
|
||||||
replicas: 2
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: "256Mi"
|
|
||||||
cpu: "100m"
|
|
||||||
limits:
|
|
||||||
memory: "512Mi"
|
|
||||||
cpu: "500m"
|
|
||||||
service:
|
service:
|
||||||
|
type: ClusterIP
|
||||||
port: 8000
|
port: 8000
|
||||||
targetPort: 8000
|
targetPort: 8000
|
||||||
type: ClusterIP
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 512Mi
|
||||||
|
env:
|
||||||
|
PYTHONUNBUFFERED: "1"
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
className: nginx
|
className: "traefik"
|
||||||
host: api-dateme.dvirlabs.com
|
annotations:
|
||||||
path: /
|
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||||
pathType: Prefix
|
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||||
environment:
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
JWT_SECRET: your-secret-key-change-in-production
|
hosts:
|
||||||
JWT_EXPIRES_MINUTES: "1440"
|
- host: api-dateme.dvirlabs.com
|
||||||
MEDIA_DIR: /app/media
|
paths:
|
||||||
CORS_ORIGINS: "http://localhost:5173,http://localhost:3000,http://localhost,https://dateme.dvirlabs.com"
|
- path: /
|
||||||
persistence:
|
pathType: Prefix
|
||||||
enabled: true
|
tls:
|
||||||
size: 5Gi
|
- secretName: api-dateme-tls
|
||||||
storageClass: ""
|
hosts:
|
||||||
mountPath: /app/media
|
- api-dateme.dvirlabs.com
|
||||||
probes:
|
|
||||||
readiness:
|
|
||||||
enabled: true
|
|
||||||
path: /health
|
|
||||||
initialDelaySeconds: 10
|
|
||||||
periodSeconds: 10
|
|
||||||
liveness:
|
|
||||||
enabled: true
|
|
||||||
path: /health
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 30
|
|
||||||
|
|
||||||
# Frontend configuration
|
# Frontend configuration
|
||||||
frontend:
|
frontend:
|
||||||
|
name: frontend
|
||||||
|
replicaCount: 1
|
||||||
image:
|
image:
|
||||||
repository: dating-app-frontend
|
repository: harbor.dvirlabs.com/my-apps/dateme-frontend
|
||||||
tag: latest
|
pullPolicy: Always
|
||||||
pullPolicy: IfNotPresent
|
tag: develop-latest
|
||||||
replicas: 2
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: "128Mi"
|
|
||||||
cpu: "50m"
|
|
||||||
limits:
|
|
||||||
memory: "256Mi"
|
|
||||||
cpu: "200m"
|
|
||||||
service:
|
service:
|
||||||
|
type: ClusterIP
|
||||||
port: 80
|
port: 80
|
||||||
targetPort: 80
|
targetPort: 80
|
||||||
type: ClusterIP
|
env:
|
||||||
|
API_BASE: "https://api-dateme.dvirlabs.com"
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 50m
|
||||||
|
memory: 64Mi
|
||||||
|
limits:
|
||||||
|
cpu: 200m
|
||||||
|
memory: 256Mi
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
className: nginx
|
className: "traefik"
|
||||||
host: dateme.dvirlabs.com
|
annotations:
|
||||||
path: /
|
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||||
pathType: Prefix
|
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||||
environment:
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
VITE_API_URL: "https://api-dateme.dvirlabs.com"
|
hosts:
|
||||||
probes:
|
- host: dateme.dvirlabs.com
|
||||||
readiness:
|
paths:
|
||||||
enabled: true
|
- path: /
|
||||||
path: /health
|
pathType: Prefix
|
||||||
initialDelaySeconds: 5
|
tls:
|
||||||
periodSeconds: 10
|
- secretName: dateme-tls
|
||||||
liveness:
|
hosts:
|
||||||
enabled: true
|
- dateme.dvirlabs.com
|
||||||
path: /health
|
externalUrl: "https://dateme.dvirlabs.com"
|
||||||
initialDelaySeconds: 15
|
|
||||||
periodSeconds: 30
|
|
||||||
|
|
||||||
# Ingress configuration
|
# PostgreSQL configuration
|
||||||
|
postgres:
|
||||||
|
name: db
|
||||||
|
image:
|
||||||
|
repository: postgres
|
||||||
|
tag: "16"
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
user: dateme_user
|
||||||
|
password: dateme_password
|
||||||
|
database: dateme_db
|
||||||
|
port: 5432
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 5432
|
||||||
|
targetPort: 5432
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
storageClass: "nfs-client"
|
||||||
|
size: 10Gi
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 256Mi
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 512Mi
|
||||||
|
|
||||||
|
# Ingress (top-level, disabled - use component-specific ingress instead)
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: false
|
||||||
className: nginx
|
className: "traefik"
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
|
hosts:
|
||||||
# ConfigMap for shared configuration
|
- host: dateme.dvirlabs.com
|
||||||
configmap:
|
paths:
|
||||||
enabled: true
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
# Secret for sensitive data (use external secrets in production)
|
tls:
|
||||||
secrets:
|
- secretName: dateme-tls
|
||||||
enabled: true
|
hosts:
|
||||||
|
- dateme.dvirlabs.com
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user