You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
1.9 KiB

apiVersion: apps/v1
kind: Deployment
metadata:
name: k8s-webui-backend
namespace: k8s-webui
spec:
replicas: 1
selector:
matchLabels:
app: k8s-webui-backend
template:
metadata:
labels:
app: k8s-webui-backend
spec:
serviceAccountName: k8s-webui
containers:
- name: backend
image: k8s-webui-backend:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3001
name: http
env:
- name: PORT
value: "3001"
- name: NODE_ENV
valueFrom:
configMapKeyRef:
name: k8s-webui-config
key: NODE_ENV
- name: K8S_NAMESPACE
valueFrom:
configMapKeyRef:
name: k8s-webui-config
key: K8S_NAMESPACE
- name: REDIS_URL
valueFrom:
configMapKeyRef:
name: k8s-webui-config
key: REDIS_URL
- name: DATABASE_URL
valueFrom:
configMapKeyRef:
name: k8s-webui-config
key: DATABASE_URL
- name: PASETO_SECRET_KEY
valueFrom:
secretKeyRef:
name: k8s-webui-secrets
key: PASETO_SECRET_KEY
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
periodSeconds: 5
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: k8s-webui-backend
namespace: k8s-webui
spec:
selector:
app: k8s-webui-backend
ports:
- port: 3001
targetPort: http
name: http
type: ClusterIP