66 lines
1.6 KiB
Handlebars
66 lines
1.6 KiB
Handlebars
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: "{{appName}}"
|
|
namespace: "{{namespace}}"
|
|
labels:
|
|
app: "{{appName}}"
|
|
runtime: "{{runtime}}"
|
|
managed-by: cloudhost
|
|
spec:
|
|
replicas: {{replicas}}
|
|
selector:
|
|
matchLabels:
|
|
app: "{{appName}}"
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: "{{appName}}"
|
|
runtime: "{{runtime}}"
|
|
spec:
|
|
containers:
|
|
- name: "{{appName}}"
|
|
image: "{{image}}"
|
|
ports:
|
|
- containerPort: {{port}}
|
|
{{#if hasEnvVars}}
|
|
envFrom:
|
|
- secretRef:
|
|
name: "{{appName}}-env"
|
|
{{/if}}
|
|
{{#if hasDatabase}}
|
|
env:
|
|
- name: DB_HOST
|
|
value: "{{appName}}-db"
|
|
- name: DB_PORT
|
|
value: "{{dbPort}}"
|
|
- name: DB_NAME
|
|
value: "{{dbName}}"
|
|
- name: DB_USER
|
|
value: "appuser"
|
|
- name: DB_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: "{{appName}}-db-secret"
|
|
key: password
|
|
{{/if}}
|
|
resources:
|
|
requests:
|
|
cpu: "{{cpuRequest}}"
|
|
memory: "{{memoryRequest}}"
|
|
limits:
|
|
cpu: "{{cpuLimit}}"
|
|
memory: "{{memoryLimit}}"
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: {{port}}
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 5
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: {{port}}
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|