1
0
Fork 0
forked from infra/ansible

add flatpak-indexer deployment

Signed-off-by: Pedro Moura <pmoura@redhat.com>
This commit is contained in:
Pedro Moura 2026-02-10 17:38:44 -03:00 committed by Kevin Fenzi
commit 55fe803f4d

View file

@ -0,0 +1,178 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: flatpak-indexer
name: flatpak-indexer
spec:
replicas: 1
selector:
matchLabels:
app: flatpak-indexer
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
template:
metadata:
labels:
app: flatpak-indexer
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"flatpak-indexer:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"flatpak-indexer\")].image"}]'
spec:
containers:
- name: flatpak-indexer
image: flatpak-indexer:latest
env:
- name: OUTPUT_DIR
value: /var/www/flatpaks
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: redis-password
key: password
- name: REDIS_URL
value: redis://redis.flatpak-indexer.svc.cluster.local:6379
ports:
- containerPort: 8080
protocol: TCP
volumeMounts:
- mountPath: /etc/flatpak-indexer
name: indexer-config-volume
readOnly: true
- mountPath: /etc/koji.conf
name: koji-conf-volume
readOnly: true
- mountPath: /var/www/flatpaks
name: index-output-volume
volumes:
- name: indexer-config-volume
configMap:
name: indexer-config
- name: koji-conf-volume
configMap:
name: koji-conf
- name: index-output-volume
persistentVolumeClaim:
claimName: flatpak-indexer-storage{{ '-stg' if env == 'staging' else '' }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: flatpak-indexer-differ
name: flatpak-indexer-differ
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: flatpak-indexer-differ
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
template:
metadata:
labels:
app: flatpak-indexer-differ
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"flatpak-indexer:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"flatpak-indexer-differ\")].image"}]'
spec:
containers:
- name: flatpak-indexer-differ
image: flatpak-indexer:latest
env:
- name: OUTPUT_DIR
value: /var/www/flatpaks
- name: FLATPAK_INDEXER_COMMAND
value: differ
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: redis-password
key: password
- name: REDIS_URL
value: redis://redis.flatpak-indexer.svc.cluster.local:6379
ports:
- containerPort: 8080
protocol: TCP
resources:
requests:
cpu: 2
memory: 1Gi
limits:
cpu: 2
memory: 8Gi
volumeMounts:
- mountPath: /etc/flatpak-indexer
name: indexer-config-volume
readOnly: true
- mountPath: /var/www/flatpaks
name: index-output-volume
volumes:
- name: indexer-config-volume
configMap:
name: indexer-config
- name: index-output-volume
persistentVolumeClaim:
claimName: flatpak-indexer-storage{{ '-stg' if env == 'staging' else '' }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: redis
name: redis
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: redis
strategy:
type: Recreate
template:
metadata:
labels:
app: 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
env:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: redis-password
key: password
ports:
- containerPort: 6379
protocol: TCP
livenessProbe:
exec:
command: ['valkey-cli', '-a', '$REDIS_PASSWORD', 'ping']
failureThreshold: 3
initialDelaySeconds: 15
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
exec:
command: ['valkey-cli', '-a', '$REDIS_PASSWORD', 'ping']
failureThreshold: 3
periodSeconds: 60
successThreshold: 1
timeoutSeconds: 1
volumeMounts:
- mountPath: /data
name: redis-data-volume
volumes:
- name: redis-data-volume
persistentVolumeClaim:
claimName: flatpak-indexer-redis-storage{{ '-stg' if env == 'staging' else '' }}