1
0
Fork 0
forked from infra/ansible

fmn: moved deploymentconfig.yml to deployment.yml

Signed-off-by: Pedro Moura <pmoura@redhat.com>
This commit is contained in:
Pedro Moura 2026-04-22 18:19:35 -03:00 committed by Kevin Fenzi
commit a19387aa22

View file

@ -1,7 +1,7 @@
---
# Frontend component (Javascript served by Apache httpd)
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
labels:
@ -9,26 +9,23 @@ metadata:
spec:
replicas: 1
selector:
app: fmn
deploymentconfig: frontend
matchLabels:
app: fmn
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: fmn
deploymentconfig: frontend
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"fmn:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"frontend\")].image"}]'
spec:
containers:
- name: frontend
image: image-registry.openshift-image-registry.svc:5000/fmn/fmn:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
@ -53,20 +50,10 @@ spec:
volumes:
- name: httpdir-volume
emptyDir: {}
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- frontend
from:
kind: ImageStreamTag
name: fmn:latest
---
# API component (Python/FastAPI served by Uvicorn)
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
labels:
@ -74,26 +61,23 @@ metadata:
spec:
replicas: 1
selector:
app: fmn
deploymentconfig: api
matchLabels:
app: fmn
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: fmn
deploymentconfig: api
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"fmn:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"api\")].image"}]'
spec:
containers:
- name: api
image: image-registry.openshift-image-registry.svc:5000/fmn/fmn:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
@ -116,7 +100,6 @@ spec:
- name: fedora-messaging-crt-volume
mountPath: /etc/pki/fedora-messaging/crt
readOnly: true
env:
- name: APP_SCRIPT
value: ".s2i/run-api.sh"
@ -141,7 +124,6 @@ spec:
key: cache-hash-key
- name: FEDORA_MESSAGING_CONF
value: /etc/fmn/api.toml
readinessProbe:
timeoutSeconds: 1
initialDelaySeconds: 5
@ -154,7 +136,6 @@ spec:
httpGet:
path: /api/v1/healthz/live
port: 8080
volumes:
- name: etc-fmn
configMap:
@ -174,49 +155,39 @@ spec:
- name: fedora-messaging-crt-volume
secret:
secretName: fedora-messaging-crt
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- api
from:
kind: ImageStreamTag
name: fmn:latest
---
# Consumer component (Fedora Messaging consume command)
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
name: consumer
labels:
app: fmn
spec:
# There can be as many as necessary
replicas: 1
selector:
app: fmn
deploymentconfig: consumer
matchLabels:
app: fmn
strategy:
type: Recreate
recreateParams:
mid:
execNewPod:
command: [/opt/app-root/bin/fmn, database, sync]
containerName: consumer
volumes:
- etc-fmn
failurePolicy: Abort
template:
metadata:
creationTimestamp: null
labels:
app: fmn
deploymentconfig: consumer
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"fmn:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"consumer\")].image"}]'
spec:
initContainers:
- name: database-sync
image: image-registry.openshift-image-registry.svc:5000/fmn/fmn:latest
command: ["/opt/app-root/bin/fmn", "database", "sync"]
volumeMounts:
- name: etc-fmn
mountPath: "/etc/fmn"
readOnly: true
containers:
- name: consumer
image: image-registry.openshift-image-registry.svc:5000/fmn/fmn:latest
imagePullPolicy: Always
volumeMounts:
- name: etc-fmn
@ -273,41 +244,31 @@ 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: fmn:latest
---
# Email sending component (custom python runner)
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
name: sender-email
labels:
app: fmn
spec:
# There can be many pods for email.
replicas: 1
selector:
app: fmn
deploymentconfig: sender-email
matchLabels:
app: fmn
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
app: fmn
deploymentconfig: sender-email
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"fmn:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"sender-email\")].image"}]'
spec:
containers:
- name: sender-email
image: image-registry.openshift-image-registry.svc:5000/fmn/fmn:latest
imagePullPolicy: Always
volumeMounts:
- name: etc-fmn
@ -338,42 +299,31 @@ spec:
- name: fedora-messaging-crt-volume
secret:
secretName: fedora-messaging-crt
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- sender-email
from:
kind: ImageStreamTag
name: fmn:latest
---
# IRC sending component (custom python runner)
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
name: sender-irc
labels:
app: fmn
spec:
# There can be only one pod for IRC
# Staging is currently unable to connect to IRC outside because of firewall rules.
replicas: {{ (env == 'production')|ternary('1', '0') }}
selector:
app: fmn
deploymentconfig: sender-irc
matchLabels:
app: fmn
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
app: fmn
deploymentconfig: sender-irc
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"fmn:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"sender-irc\")].image"}]'
spec:
containers:
- name: sender-irc
image: image-registry.openshift-image-registry.svc:5000/fmn/fmn:latest
imagePullPolicy: Always
volumeMounts:
- name: etc-fmn
@ -404,42 +354,31 @@ spec:
- name: fedora-messaging-crt-volume
secret:
secretName: fedora-messaging-crt
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- sender-irc
from:
kind: ImageStreamTag
name: fmn:latest
---
# Matrix sending component (custom python runner)
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
name: sender-matrix
labels:
app: fmn
spec:
# Not sure how many concurrent connections are supported by Matrix with the
# same token. Let's just have one for now.
replicas: 1
selector:
app: fmn
deploymentconfig: sender-matrix
matchLabels:
app: fmn
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
app: fmn
deploymentconfig: sender-matrix
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"fmn:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"sender-matrix\")].image"}]'
spec:
containers:
- name: sender-matrix
image: image-registry.openshift-image-registry.svc:5000/fmn/fmn:latest
imagePullPolicy: Always
volumeMounts:
- name: etc-fmn
@ -470,20 +409,10 @@ spec:
- name: fedora-messaging-crt-volume
secret:
secretName: fedora-messaging-crt
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- sender-matrix
from:
kind: ImageStreamTag
name: fmn:latest
---
# Redis, for caching
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
labels:
@ -492,13 +421,16 @@ metadata:
spec:
replicas: 1
selector:
app: fmn
deploymentconfig: redis
matchLabels:
app: fmn
strategy: {}
template:
metadata:
labels:
app: fmn
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
@ -509,20 +441,10 @@ spec:
secretKeyRef:
name: fmn
key: redis-password
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- redis
from:
kind: ImageStreamTag
name: redis:latest
---
# Collectd stats collector
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
name: collectd
labels:
@ -530,19 +452,20 @@ metadata:
spec:
replicas: 1
selector:
app: fmn
deploymentconfig: collectd
matchLabels:
app: fmn
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
app: fmn
deploymentconfig: collectd
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"fmn:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"collectd\")].image"}]'
spec:
containers:
- name: collectd
image: image-registry.openshift-image-registry.svc:5000/fmn/fmn:latest
imagePullPolicy: Always
volumeMounts:
- name: etc-fmn
@ -561,26 +484,15 @@ spec:
secretKeyRef:
name: fmn
key: cache-hash-key
volumes:
- name: etc-fmn
configMap:
name: fmn
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- collectd
from:
kind: ImageStreamTag
name: fmn:latest
---
# Sendria, to display email notifications in staging
{% if env == 'staging' %}
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: fmn
@ -589,15 +501,17 @@ metadata:
spec:
replicas: 1
selector:
app: fmn
deploymentconfig: sendria
matchLabels:
app: fmn
strategy:
type: Recreate
template:
metadata:
labels:
app: fmn
deploymentconfig: sendria
service: sendria
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"sendria:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"sendria\")].image"}]'
spec:
containers:
- name: sendria
@ -623,14 +537,4 @@ spec:
volumes:
- name: data
emptyDir: {}
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- sendria
from:
kind: ImageStreamTag
name: sendria:latest
{% endif %}