App manifest #kubernetes #yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: firmware-update
labels:
app: firmware-update
spec:
replicas: 1
selector:
matchLabels:
app: firmware-update
# Pod template
template:
metadata:
labels:
app: firmware-update
spec:
containers:
- name: firmware-update
image: registry.gitlab.com/gs-iot/gs-firmware/_SERVICE_:_BRANCH_-_COMMITSHA_
imagePullPolicy: Always
env:
# Database host
- name: DB_HOST
value: "firmware-pg"
# Database port
- name: DB_PORT
value: "5432"
# Database name
- name: DB_NAME
value: "userdb"
# Database username
- name: DB_USER
valueFrom:
secretKeyRef:
name: firmware-pg-postgres-secret
key: username
# Database password
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: firmware-pg-postgres-secret
key: password
# Max of simultaneous connections
- name: MAX_SIM_CONN
value: "1000"
# Update server host
- name: UPDATE_CONN_HOST
value: "0.0.0.0"
# Update server port
- name: UPDATE_CONN_PORT
value: "32132"
# Redis servers
- name: REDIS_SERVER
value: "redis:6379"
# Redis password
- name: REDIS_PASSWORD
value: ""
# Redis database
- name: REDIS_DATABASE
value: "0"
# Log level
- name: LOG_LEVEL
value: debug
volumeMounts:
- mountPath: /data/firmwares-storage
name: firmwares
ports:
- containerPort: 32132
volumes:
- name: firmwares
persistentVolumeClaim:
claimName: firmwares-claim
imagePullSecrets:
- name: gitlab-registry-gs-firmware