172 lines
4.8 KiB
YAML
172 lines
4.8 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
labels:
|
|
app: control-center
|
|
component: provisioning-platform
|
|
name: control-center
|
|
spec:
|
|
replicas: 2
|
|
revisionHistoryLimit: 5
|
|
selector:
|
|
matchLabels:
|
|
app: control-center
|
|
strategy:
|
|
rollingUpdate:
|
|
maxSurge: 1
|
|
maxUnavailable: 0
|
|
type: RollingUpdate
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
prometheus.io/path: /metrics
|
|
prometheus.io/port: '8080'
|
|
prometheus.io/scrape: 'true'
|
|
labels:
|
|
app: control-center
|
|
component: provisioning-platform
|
|
spec:
|
|
affinity:
|
|
podAntiAffinity:
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
- podAffinityTerm:
|
|
labelSelector:
|
|
matchExpressions:
|
|
- key: app
|
|
operator: In
|
|
values:
|
|
- control-center
|
|
topologyKey: kubernetes.io/hostname
|
|
weight: 100
|
|
containers:
|
|
- env:
|
|
- name: CONTROL_CENTER_MODE
|
|
value: kubernetes
|
|
- name: CONTROL_CENTER_SERVER_HOST
|
|
value: 0.0.0.0
|
|
- name: CONTROL_CENTER_SERVER_PORT
|
|
value: '8080'
|
|
- name: CONTROL_CENTER_DATABASE
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: database_type
|
|
name: control-center-config
|
|
- name: CONTROL_CENTER_DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: database_url
|
|
name: control-center-secrets
|
|
optional: true
|
|
- name: CONTROL_CENTER_RBAC_ENABLED
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: rbac_enabled
|
|
name: control-center-config
|
|
- name: CONTROL_CENTER_JWT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: jwt_secret
|
|
name: control-center-secrets
|
|
- name: CONTROL_CENTER_JWT_ISSUER
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: jwt_issuer
|
|
name: control-center-config
|
|
- name: CONTROL_CENTER_JWT_AUDIENCE
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: jwt_audience
|
|
name: control-center-config
|
|
- name: CONTROL_CENTER_MFA_REQUIRED
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: mfa_required
|
|
name: control-center-config
|
|
- name: CONTROL_CENTER_LOG_LEVEL
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
key: log_level
|
|
name: control-center-config
|
|
- name: POD_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
- name: POD_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
image: provisioning-control-center:latest
|
|
imagePullPolicy: Always
|
|
livenessProbe:
|
|
failureThreshold: 3
|
|
httpGet:
|
|
path: /health
|
|
port: 8080
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
name: control-center
|
|
ports:
|
|
- containerPort: 8080
|
|
name: http
|
|
protocol: TCP
|
|
- containerPort: 8081
|
|
name: metrics
|
|
protocol: TCP
|
|
readinessProbe:
|
|
failureThreshold: 3
|
|
httpGet:
|
|
path: /ready
|
|
port: 8080
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
resources:
|
|
limits:
|
|
cpu: '1'
|
|
memory: 1Gi
|
|
requests:
|
|
cpu: 250m
|
|
memory: 256Mi
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
readOnlyRootFilesystem: false
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
volumeMounts:
|
|
- mountPath: /etc/provisioning/control-center
|
|
name: control-center-config
|
|
readOnly: true
|
|
- mountPath: /var/log/provisioning/control-center
|
|
name: control-center-logs
|
|
initContainers:
|
|
- command:
|
|
- sh
|
|
- -c
|
|
- until nc -z postgres 5432 || true; do echo waiting for db; sleep 2; done
|
|
image: busybox:1.35
|
|
imagePullPolicy: IfNotPresent
|
|
name: wait-for-db
|
|
restartPolicy: Always
|
|
serviceAccountName: control-center
|
|
terminationGracePeriodSeconds: 30
|
|
tolerations:
|
|
- effect: NoExecute
|
|
key: node.kubernetes.io/not-ready
|
|
operator: Exists
|
|
tolerationSeconds: 300
|
|
- effect: NoExecute
|
|
key: node.kubernetes.io/unreachable
|
|
operator: Exists
|
|
tolerationSeconds: 300
|
|
volumes:
|
|
- configMap:
|
|
defaultMode: 420
|
|
name: control-center-config
|
|
name: control-center-config
|
|
- name: control-center-logs
|
|
persistentVolumeClaim:
|
|
claimName: control-center-logs
|