87 lines
1.7 KiB
YAML
87 lines
1.7 KiB
YAML
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: requirements-periodic-table
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: fastapi-app
|
|
namespace: requirements-periodic-table
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: fastapi-app
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: fastapi-app
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: regcred
|
|
containers:
|
|
- name: fastapi-app
|
|
image: docker.io/your-dockerhub-username/periodic-table-backend:latest
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: 8080
|
|
env:
|
|
- name: DATABASE_HOST
|
|
value: postgresql
|
|
envFrom:
|
|
- secretRef:
|
|
name: periodic-table-env # Provide secrets for APP settings
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: fastapi-app
|
|
namespace: requirements-periodic-table
|
|
spec:
|
|
selector:
|
|
app: fastapi-app
|
|
ports:
|
|
- port: 8080
|
|
targetPort: 8080
|
|
name: http
|
|
type: ClusterIP
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: frontend
|
|
namespace: requirements-periodic-table
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: frontend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: frontend
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: regcred
|
|
containers:
|
|
- name: frontend
|
|
image: docker.io/your-dockerhub-username/periodic-table-frontend:latest
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: 80
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: frontend
|
|
namespace: requirements-periodic-table
|
|
spec:
|
|
selector:
|
|
app: frontend
|
|
ports:
|
|
- port: 80
|
|
targetPort: 80
|
|
name: http
|
|
type: LoadBalancer
|