1
0
Fork 0
forked from infra/ansible

badges: moved deploymentconfig.yml.j2 to deployment.yml.j2

Signed-off-by: Pedro Moura <pmoura@redhat.com>
This commit is contained in:
Pedro Moura 2026-04-14 18:36:23 -03:00 committed by Kevin Fenzi
commit ba88e1c63b

View file

@ -1,7 +1,7 @@
---
# Frontend component (Python/Pyramid served by gunicorn)
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
labels:
@ -9,27 +9,23 @@ metadata:
spec:
replicas: 1
selector:
app: badges
deploymentconfig: frontend
matchLabels:
app: badges
strategy:
type: Rolling
activeDeadlineSeconds: 21600
rollingParams:
intervalSeconds: 1
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
template:
metadata:
creationTimestamp: null
labels:
app: badges
deploymentconfig: frontend
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"tahrir:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"frontend\")].image"}]'
spec:
containers:
- name: frontend
image: tahrir:latest
image: image-registry.openshift-image-registry.svc:5000/tahrir/tahrir:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
@ -58,7 +54,6 @@ spec:
- name: tahrir-fedora-messaging-crt-volume
mountPath: /etc/pki/fedora-messaging/crt
readOnly: true
env:
- name: FLASK_CONFIG
value: "/etc/badges/tahrir.cfg"
@ -72,7 +67,6 @@ spec:
value: /etc/keytabs/fedbadges.keytab
- name: FEDORA_MESSAGING_CONF
value: /etc/badges/fm-tahrir.toml
readinessProbe:
timeoutSeconds: 10
initialDelaySeconds: 5
@ -87,7 +81,6 @@ spec:
httpGet:
path: "/healthz/live"
port: 8080
volumes:
- name: etc-badges
configMap:
@ -113,49 +106,39 @@ spec:
- name: tahrir-fedora-messaging-crt-volume
secret:
secretName: tahrir-fedora-messaging-crt
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- frontend
from:
kind: ImageStreamTag
name: tahrir:latest
---
# Consumer component (Fedora Messaging consume command)
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
name: consumer
labels:
app: badges
spec:
# There can be as many as necessary
replicas: {{ (env == 'production')|ternary(2, 1) }}
selector:
app: badges
deploymentconfig: consumer
matchLabels:
app: badges
strategy:
type: Recreate
recreateParams:
mid:
execNewPod:
command: [/opt/app-root/bin/tahrir-sync-db, /etc/badges/tahrir.cfg]
containerName: consumer
volumes:
- etc-badges
failurePolicy: Abort
template:
metadata:
creationTimestamp: null
labels:
app: badges
deploymentconfig: consumer
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"fedbadges:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"consumer\")].image"}]'
spec:
initContainers:
- name: db-sync
image: image-registry.openshift-image-registry.svc:5000/fedbadges/fedbadges:latest
command: ["/opt/app-root/bin/tahrir-sync-db", "/etc/badges/tahrir.cfg"]
volumeMounts:
- name: etc-badges
mountPath: "/etc/badges"
readOnly: true
containers:
- name: consumer
image: image-registry.openshift-image-registry.svc:5000/fedbadges/fedbadges:latest
imagePullPolicy: Always
volumeMounts:
- name: etc-badges
@ -206,20 +189,10 @@ spec:
- name: fedora-messaging-crt-volume
secret:
secretName: fedora-messaging-crt
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- consumer
from:
kind: ImageStreamTag
name: fedbadges:latest
---
# Redis, for caching
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
labels:
@ -228,17 +201,20 @@ metadata:
spec:
replicas: 1
selector:
app: badges
deploymentconfig: redis
matchLabels:
app: badges
strategy: {}
template:
metadata:
labels:
app: badges
deploymentconfig: redis
service: redis
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"redis:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"redis\")].image"}]'
spec:
containers:
- name: redis
image: redis:latest
image: image-registry.openshift-image-registry.svc:5000/redis/redis:latest
volumeMounts:
- name: data
mountPath: "/bitnami/redis/data"
@ -267,13 +243,3 @@ spec:
- name: data
persistentVolumeClaim:
claimName: redis
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- redis
from:
kind: ImageStreamTag
name: redis:latest