Skip to content

MintMaker: Deploy Redis for Renovate cache #6085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/mintmaker/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
resources:
- cronjobs/
- rbac/
- redis-cache/

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand Down
9 changes: 9 additions & 0 deletions components/mintmaker/base/redis-cache/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- redis-configmap.yaml
- redis-deployment.yaml
- redis-networkpolicy.yaml
- redis-pvc.yaml
- redis-service.yaml
namespace: mintmaker
25 changes: 25 additions & 0 deletions components/mintmaker/base/redis-cache/redis-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-config
namespace: mintmaker
data:
redis.conf: |
bind 0.0.0.0
protected-mode no
port 6379
maxmemory 800mb
maxmemory-policy allkeys-lru
dir /var/lib/redis/data

appendonly yes
aof-use-rdb-preamble yes
appendfsync everysec

save 900 1
save 300 10
save 60 10000

logfile ""
loglevel notice

51 changes: 51 additions & 0 deletions components/mintmaker/base/redis-cache/redis-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
namespace: mintmaker
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
serviceAccountName: mintmaker-controller-manager
securityContext:
fsGroup: 1001
containers:
- name: redis
image: registry.redhat.io/rhel9/redis-7:9.5
ports:
- containerPort: 6379
command: ["container-entrypoint"]
args: ["run-redis"]
resources:
requests:
memory: "800Mi"
cpu: "0.75"
limits:
memory: "1Gi"
cpu: "1"
securityContext:
runAsNonRoot: true
runAsUser: 1001
readOnlyRootFilesystem: true
volumeMounts:
- name: redis-data
mountPath: /var/lib/redis/data
- name: redis-config
mountPath: /etc/redis/redis.conf
subPath: redis.conf
volumes:
- name: redis-data
persistentVolumeClaim:
claimName: redis-pvc
- name: redis-config
configMap:
name: redis-config
12 changes: 12 additions & 0 deletions components/mintmaker/base/redis-cache/redis-networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: restrict-redis-access
namespace: mintmaker
spec:
podSelector:
matchLabels:
app: redis
ingress:
- from:
- podSelector: {}
14 changes: 14 additions & 0 deletions components/mintmaker/base/redis-cache/redis-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-pvc
namespace: mintmaker
spec:
accessModes:
- ReadWriteOnce
mountOptions:
- dir_mode=0777
- file_mode=0777
resources:
requests:
storage: 5Gi
12 changes: 12 additions & 0 deletions components/mintmaker/base/redis-cache/redis-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: redis
namespace: mintmaker
spec:
selector:
app: redis
ports:
- port: 6379
targetPort: 6379
type: ClusterIP