ansible/roles/openshift-apps/resultsdb/templates/backend/deploymentconfigs.yml
2023-06-22 22:33:47 +00:00

132 lines
3.7 KiB
YAML

---
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: "resultsdb-api"
labels:
service: api
app: resultsdb
spec:
replicas: 2
selector:
app: resultsdb
service: api
strategy:
type: Rolling
rollingParams:
pre:
failurePolicy: Abort
execNewPod:
containerName: api
command:
- /bin/sh
- -i
- -c
- |
# try for 10 minutes (600 seconds)
e=$(( $(date +%s) + 600 ))
i=0
entrypoint=""
if [ -f /app/entrypoint.sh ]; then
entrypoint=/app/entrypoint.sh
fi
while [ $(date +%s) -lt $e ]; do
echo 'TRY #'$((++i))
if $entrypoint resultsdb init_db ; then
exit 0
fi
done
exit 1
volumes:
- config-volume
- httpd-config-volume
template:
metadata:
labels:
service: api
app: resultsdb
spec:
containers:
- name: api
image: resultsdb-api
imagePullPolicy: Always
env:
- name: RESULTSDB_WSGI_SCRIPT_PATH
value: "/usr/share/resultsdb/resultsdb.wsgi"
- name: RESULTSDB_THREADS
value: "5"
- name: RESULTSDB_CONF_PATH
value: "/etc/httpd/conf.d/resultsdb.conf"
- name: RESULTSDB_LOG_LEVEL
value: "info"
- name: RESULTSDB_MESSAGING
value: "Y"
ports:
- containerPort: 5001
volumeMounts:
- name: config-volume
mountPath: /etc/resultsdb
readOnly: true
- name: httpd-config-volume
mountPath: /etc/httpd/conf.d
readOnly: true
- name: fedora-messaging-ca-volume
mountPath: /etc/pki/rabbitmq/ca
readOnly: true
- name: fedora-messaging-key-volume
mountPath: /etc/pki/rabbitmq/key
readOnly: true
- name: fedora-messaging-crt-volume
mountPath: /etc/pki/rabbitmq/crt
readOnly: true
- name: fedora-messaging-config-volume
mountPath: /etc/fedora-messaging
readOnly: true
readinessProbe:
timeoutSeconds: 1
initialDelaySeconds: 5
httpGet:
path: /api/v2.0/
port: 5001
livenessProbe:
timeoutSeconds: 1
initialDelaySeconds: 30
httpGet:
path: /api/v2.0/
port: 5001
resources:
limits:
memory: 500Mi
cpu: 300m
requests:
memory: 384Mi
cpu: 300m
volumes:
- name: config-volume
secret:
secretName: "resultsdb-config"
- name: httpd-config-volume
configMap:
name: "resultsdb-httpd-config"
- name: fedora-messaging-config-volume
configMap:
name: fedora-messaging-configmap
- name: fedora-messaging-ca-volume
secret:
secretName: resultsdb-fedora-messaging-ca
- name: fedora-messaging-crt-volume
secret:
secretName: resultsdb-fedora-messaging-crt
- name: fedora-messaging-key-volume
secret:
secretName: resultsdb-fedora-messaging-key
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- api
from:
kind: ImageStreamTag
name: resultsdb-api:latest