Badges: add Redis for caching
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
parent
321edb65cc
commit
14f399e536
5 changed files with 75 additions and 2 deletions
|
@ -32,3 +32,14 @@ items:
|
||||||
kind: ImageStream
|
kind: ImageStream
|
||||||
metadata:
|
metadata:
|
||||||
name: python-310-custom-builder
|
name: python-310-custom-builder
|
||||||
|
# Redis (for caching)
|
||||||
|
- apiVersion: image.openshift.io/v1
|
||||||
|
kind: ImageStream
|
||||||
|
metadata:
|
||||||
|
name: redis
|
||||||
|
spec:
|
||||||
|
tags:
|
||||||
|
- name: latest
|
||||||
|
from:
|
||||||
|
kind: DockerImage
|
||||||
|
name: docker.io/bitnami/redis:latest
|
||||||
|
|
|
@ -14,3 +14,19 @@ spec:
|
||||||
targetPort: 8080
|
targetPort: 8080
|
||||||
selector:
|
selector:
|
||||||
deploymentconfig: frontend
|
deploymentconfig: frontend
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: redis
|
||||||
|
labels:
|
||||||
|
app: badges
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: redis
|
||||||
|
port: 6379
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 6379
|
||||||
|
selector:
|
||||||
|
app: badges
|
||||||
|
deploymentconfig: redis
|
||||||
|
|
|
@ -212,3 +212,42 @@ spec:
|
||||||
from:
|
from:
|
||||||
kind: ImageStreamTag
|
kind: ImageStreamTag
|
||||||
name: fedbadges:latest
|
name: fedbadges:latest
|
||||||
|
---
|
||||||
|
# Redis, for caching
|
||||||
|
apiVersion: apps.openshift.io/v1
|
||||||
|
kind: DeploymentConfig
|
||||||
|
metadata:
|
||||||
|
name: redis
|
||||||
|
labels:
|
||||||
|
app: badges
|
||||||
|
service: redis
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
app: badges
|
||||||
|
deploymentconfig: redis
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: badges
|
||||||
|
deploymentconfig: redis
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: redis
|
||||||
|
image: redis:latest
|
||||||
|
env:
|
||||||
|
- name: REDIS_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: badges
|
||||||
|
key: redis-password
|
||||||
|
triggers:
|
||||||
|
- type: ConfigChange
|
||||||
|
- type: ImageChange
|
||||||
|
imageChangeParams:
|
||||||
|
automatic: true
|
||||||
|
containerNames:
|
||||||
|
- redis
|
||||||
|
from:
|
||||||
|
kind: ImageStreamTag
|
||||||
|
name: redis:latest
|
||||||
|
|
|
@ -66,12 +66,17 @@ fasjson_base_url = "https://fasjson{{ env_suffix }}.fedoraproject.org"
|
||||||
|
|
||||||
# Cache configuation
|
# Cache configuation
|
||||||
[consumer_config.cache]
|
[consumer_config.cache]
|
||||||
backend = "dogpile.cache.pymemcache"
|
backend = "dogpile.cache.redis"
|
||||||
expiration_time = 86400
|
expiration_time = 86400
|
||||||
[consumer_config.cache.arguments]
|
[consumer_config.cache.arguments]
|
||||||
url = "memcached01{{ env_suffix }}:11211"
|
host = "redis.badges.svc.cluster.local"
|
||||||
|
port = 6379
|
||||||
|
password = "{{ (env == 'production')|ternary(badges_prod_redis_password, badges_stg_redis_password) }}"
|
||||||
|
db = 0
|
||||||
|
redis_expiration_time = 86400
|
||||||
distributed_lock = true
|
distributed_lock = true
|
||||||
lock_timeout = 5
|
lock_timeout = 5
|
||||||
|
thread_local_lock = false
|
||||||
|
|
||||||
# This is a set of data that tells our consumer what Open Badges Issuer
|
# This is a set of data that tells our consumer what Open Badges Issuer
|
||||||
# should be kept as the issuer of all the badges we create.
|
# should be kept as the issuer of all the badges we create.
|
||||||
|
|
|
@ -6,6 +6,8 @@ metadata:
|
||||||
stringData:
|
stringData:
|
||||||
{% if env == 'staging' %}
|
{% if env == 'staging' %}
|
||||||
oidc-client-secret: {{ badges_stg_oidc_client_secret }}
|
oidc-client-secret: {{ badges_stg_oidc_client_secret }}
|
||||||
|
redis-password: {{ badges_stg_redis_password }}
|
||||||
{% else %}
|
{% else %}
|
||||||
oidc-client-secret: {{ badges_prod_oidc_client_secret }}
|
oidc-client-secret: {{ badges_prod_oidc_client_secret }}
|
||||||
|
redis-password: {{ badges_prod_redis_password }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue