112 lines
3.4 KiB
YAML
112 lines
3.4 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: celery
|
|
labels:
|
|
deleteBeforeUpgrade: yes
|
|
spec:
|
|
replicas: 1
|
|
revisionHistoryLimit: 2
|
|
selector:
|
|
matchLabels:
|
|
app: celery
|
|
strategy:
|
|
type: Recreate
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: celery
|
|
spec:
|
|
affinity:
|
|
podAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
- labelSelector:
|
|
matchExpressions:
|
|
- key: app
|
|
operator: In
|
|
values:
|
|
- datatracker
|
|
topologyKey: "kubernetes.io/hostname"
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
containers:
|
|
# -----------------------------------------------------
|
|
# Celery Container
|
|
# -----------------------------------------------------
|
|
- name: celery
|
|
image: "ghcr.io/ietf-tools/datatracker:$APP_IMAGE_TAG"
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8000
|
|
name: http
|
|
protocol: TCP
|
|
volumeMounts:
|
|
- name: dt-vol
|
|
mountPath: /a
|
|
- name: dt-tmp
|
|
mountPath: /tmp
|
|
- name: dt-home
|
|
mountPath: /home/datatracker
|
|
- name: dt-xml2rfc-cache
|
|
mountPath: /var/cache/xml2rfc
|
|
- name: dt-cfg
|
|
mountPath: /workspace/ietf/settings_local.py
|
|
subPath: settings_local.py
|
|
env:
|
|
- name: "CONTAINER_ROLE"
|
|
value: "celery"
|
|
envFrom:
|
|
- secretRef:
|
|
name: dt-secrets-env
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
readOnlyRootFilesystem: true
|
|
runAsUser: 1000
|
|
runAsGroup: 1000
|
|
# -----------------------------------------------------
|
|
# ScoutAPM Container
|
|
# -----------------------------------------------------
|
|
- name: scoutapm
|
|
image: "scoutapp/scoutapm:version-1.4.0"
|
|
imagePullPolicy: IfNotPresent
|
|
# Replace command with one that will shut down on a TERM signal
|
|
# The ./core-agent start command line is from the scoutapm docker image
|
|
command:
|
|
- "sh"
|
|
- "-c"
|
|
- >-
|
|
trap './core-agent shutdown --tcp 0.0.0.0:6590' TERM;
|
|
./core-agent start --daemonize false --log-level debug --tcp 0.0.0.0:6590 &
|
|
wait $!
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- "sh"
|
|
- "-c"
|
|
- "./core-agent probe --tcp 0.0.0.0:6590 | grep -q 'Agent found'"
|
|
securityContext:
|
|
readOnlyRootFilesystem: true
|
|
runAsUser: 65534 # "nobody" user by default
|
|
runAsGroup: 65534 # "nogroup" group by default
|
|
volumes:
|
|
# To be overriden with the actual shared volume
|
|
- name: dt-vol
|
|
- name: dt-tmp
|
|
emptyDir:
|
|
sizeLimit: "2Gi"
|
|
- name: dt-xml2rfc-cache
|
|
emptyDir:
|
|
sizeLimit: "2Gi"
|
|
- name: dt-home
|
|
emptyDir:
|
|
sizeLimit: "2Gi"
|
|
- name: dt-cfg
|
|
configMap:
|
|
name: files-cfgmap
|
|
dnsPolicy: ClusterFirst
|
|
restartPolicy: Always
|
|
terminationGracePeriodSeconds: 600
|