95 lines
2.4 KiB
YAML
95 lines
2.4 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
labels:
|
|
name: LABEL
|
|
name: RESOURCE_NAME
|
|
namespace: production
|
|
spec:
|
|
replicas: 0
|
|
selector:
|
|
matchLabels:
|
|
app: RESOURCE_NAME
|
|
strategy:
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxSurge: 1
|
|
maxUnavailable: 0
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: RESOURCE_NAME
|
|
spec:
|
|
containers:
|
|
- image: REPOSITORY/IMAGE
|
|
name: RESOURCE_NAME
|
|
env:
|
|
- name: KUBERNETES_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: CONTAINER_CORE_LIMIT
|
|
valueFrom:
|
|
resourceFieldRef:
|
|
resource: limits.cpu
|
|
- name: CONTAINER_MAX_MEMORY
|
|
valueFrom:
|
|
resourceFieldRef:
|
|
resource: limits.memory
|
|
- name: DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: endpoints
|
|
key: dbGateway.url
|
|
- name: DATABASE_PORT
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: endpoints
|
|
key: dbGateway.port
|
|
- name: COINBASE_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: coinbase-secret
|
|
key: coinbase.api.key
|
|
- name: COINBASE_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: coinbase-secret
|
|
key: coinbase.api.secret
|
|
- name: DB_GATEWAY_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: endpoints
|
|
key: dbGateway.url
|
|
ports:
|
|
- containerPort: 9090
|
|
name: RESOURCE_NAME
|
|
# livenessProbe:
|
|
# httpGet:
|
|
# path: /health
|
|
# port: 9090
|
|
# initialDelaySeconds: 30
|
|
# periodSeconds: 30
|
|
# timeoutSeconds: 1
|
|
# successThreshold: 1
|
|
# failureThreshold: 1
|
|
# readinessProbe:
|
|
# httpGet:
|
|
# port: 9090
|
|
# path: /readiness
|
|
# initialDelaySeconds: 30
|
|
# periodSeconds: 5
|
|
# timeoutSeconds: 1
|
|
# successThreshold: 1
|
|
# failureThreshold: 1
|
|
imagePullPolicy: Always
|
|
resources:
|
|
requests:
|
|
cpu: 10m
|
|
memory: 16Mi
|
|
limits:
|
|
cpu: 25m
|
|
memory: 32Mi
|
|
restartPolicy: Always
|
|
imagePullSecrets:
|
|
- name: registry-secret |