mote: Add redis password & liveness probes
This commit is contained in:
parent
c287d34d44
commit
af4de4fbd7
8 changed files with 97 additions and 2 deletions
|
@ -39,6 +39,10 @@
|
||||||
objectname: fedmsg-dc.yml
|
objectname: fedmsg-dc.yml
|
||||||
when: env == "production"
|
when: env == "production"
|
||||||
|
|
||||||
|
- role: openshift/object
|
||||||
|
template: redis-is.yml
|
||||||
|
objectname: redis-is.yml
|
||||||
|
|
||||||
- role: openshift/object
|
- role: openshift/object
|
||||||
template: redis-dc.yml
|
template: redis-dc.yml
|
||||||
objectname: redis-dc.yml
|
objectname: redis-dc.yml
|
||||||
|
@ -55,6 +59,10 @@
|
||||||
template: mote-cm.yml
|
template: mote-cm.yml
|
||||||
objectname: mote-cm.yml
|
objectname: mote-cm.yml
|
||||||
|
|
||||||
|
- role: openshift/object
|
||||||
|
template: secret.yml
|
||||||
|
objectname: secret.yml
|
||||||
|
|
||||||
- role: openshift/object
|
- role: openshift/object
|
||||||
template: fedmsg-cm.yml
|
template: fedmsg-cm.yml
|
||||||
objectname: fedmsg-cm.yml
|
objectname: fedmsg-cm.yml
|
||||||
|
|
|
@ -13,7 +13,11 @@ spec:
|
||||||
runPolicy: Serial
|
runPolicy: Serial
|
||||||
source:
|
source:
|
||||||
git:
|
git:
|
||||||
|
{% if env == 'staging' %}
|
||||||
|
ref: staging
|
||||||
|
{% else %}
|
||||||
ref: main
|
ref: main
|
||||||
|
{% endif %}
|
||||||
uri: https://github.com/fedora-infra/mote.git
|
uri: https://github.com/fedora-infra/mote.git
|
||||||
type: Git
|
type: Git
|
||||||
strategy:
|
strategy:
|
||||||
|
|
|
@ -23,6 +23,13 @@ spec:
|
||||||
env:
|
env:
|
||||||
- name: REDIS_URL
|
- name: REDIS_URL
|
||||||
value: "redis://redis.{{ app }}.svc.cluster.local"
|
value: "redis://redis.{{ app }}.svc.cluster.local"
|
||||||
|
- name: REDIS_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: redis-password
|
||||||
|
key: password
|
||||||
|
- name: FLASK_CACHE_TYPE
|
||||||
|
value: RedisCache
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /etc/fedora-messaging/config.py
|
- mountPath: /etc/fedora-messaging/config.py
|
||||||
|
|
|
@ -6,6 +6,7 @@ metadata:
|
||||||
app: mote
|
app: mote
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
revisionHistoryLimit: 5
|
||||||
selector:
|
selector:
|
||||||
app: mote
|
app: mote
|
||||||
template:
|
template:
|
||||||
|
@ -17,6 +18,12 @@ spec:
|
||||||
- image: image-registry.openshift-image-registry.svc:5000/mote/mote
|
- image: image-registry.openshift-image-registry.svc:5000/mote/mote
|
||||||
name: mote
|
name: mote
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
|
env:
|
||||||
|
- name: REDIS_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: redis-password
|
||||||
|
key: password
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
{% if env == 'staging' %}
|
{% if env == 'staging' %}
|
||||||
- mountPath: /srv/web/meetbot
|
- mountPath: /srv/web/meetbot
|
||||||
|
@ -35,6 +42,26 @@ spec:
|
||||||
requests:
|
requests:
|
||||||
cpu: '0'
|
cpu: '0'
|
||||||
memory: 50Mi
|
memory: 50Mi
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: 9696
|
||||||
|
scheme: HTTP
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 1
|
||||||
|
periodSeconds: 30
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: 9696
|
||||||
|
scheme: HTTP
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 1
|
||||||
|
periodSeconds: 30
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
volumes:
|
volumes:
|
||||||
- name: meetbot
|
- name: meetbot
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
|
|
|
@ -6,6 +6,7 @@ metadata:
|
||||||
app: mote-worker
|
app: mote-worker
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
revisionHistoryLimit: 5
|
||||||
selector:
|
selector:
|
||||||
app: mote-worker
|
app: mote-worker
|
||||||
template:
|
template:
|
||||||
|
@ -24,7 +25,11 @@ spec:
|
||||||
value: "redis://redis.{{ app }}.svc.cluster.local"
|
value: "redis://redis.{{ app }}.svc.cluster.local"
|
||||||
- name: LOGLEVEL
|
- name: LOGLEVEL
|
||||||
value: "20"
|
value: "20"
|
||||||
|
- name: REDIS_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: redis-password
|
||||||
|
key: password
|
||||||
name: mote-worker
|
name: mote-worker
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|
|
@ -14,7 +14,7 @@ spec:
|
||||||
app: redis
|
app: redis
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: registry.redhat.io/rhel9/redis-6
|
- image: image-registry.openshift-image-registry.svc:5000/mote/redis
|
||||||
name: redis
|
name: redis
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
@ -27,7 +27,22 @@ spec:
|
||||||
requests:
|
requests:
|
||||||
cpu: '0'
|
cpu: '0'
|
||||||
memory: 200Mi
|
memory: 200Mi
|
||||||
|
env:
|
||||||
|
- name: REDIS_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: redis-password
|
||||||
|
key: password
|
||||||
volumes:
|
volumes:
|
||||||
- emptyDir: {}
|
- emptyDir: {}
|
||||||
name: redis-data
|
name: redis-data
|
||||||
restartPolicy: Always
|
restartPolicy: Always
|
||||||
|
triggers:
|
||||||
|
- type: ImageChange
|
||||||
|
imageChangeParams:
|
||||||
|
automatic: true
|
||||||
|
from:
|
||||||
|
kind: ImageStreamTag
|
||||||
|
name: redis:latest
|
||||||
|
containerNames:
|
||||||
|
- "redis"
|
||||||
|
|
18
roles/openshift-apps/mote/templates/redis-is.yml
Normal file
18
roles/openshift-apps/mote/templates/redis-is.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: image.openshift.io/v1
|
||||||
|
kind: ImageStream
|
||||||
|
metadata:
|
||||||
|
name: redis
|
||||||
|
namespace: mote
|
||||||
|
spec:
|
||||||
|
lookupPolicy:
|
||||||
|
local: false
|
||||||
|
tags:
|
||||||
|
- from:
|
||||||
|
kind: DockerImage
|
||||||
|
name: registry.redhat.io/rhel9/redis-6:latest
|
||||||
|
importPolicy:
|
||||||
|
scheduled: true
|
||||||
|
name: latest
|
||||||
|
referencePolicy:
|
||||||
|
type: Source
|
||||||
|
|
11
roles/openshift-apps/mote/templates/secret.yml
Normal file
11
roles/openshift-apps/mote/templates/secret.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
kind: Secret
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: redis-password
|
||||||
|
stringData:
|
||||||
|
{% if env == 'staging' %}
|
||||||
|
password: {{ stg_mote_redis_password }}
|
||||||
|
{% else %}
|
||||||
|
password: {{ prod_mote_redis_password }}
|
||||||
|
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue