feat(pvc): Rework PVC permissions and split redis deployment
This commit is contained in:
parent
7fbe57fc90
commit
71e9378bbd
@ -33,6 +33,7 @@ spec:
|
|||||||
runAsUser: 991
|
runAsUser: 991
|
||||||
runAsGroup: 991
|
runAsGroup: 991
|
||||||
fsGroup: 991
|
fsGroup: 991
|
||||||
|
fsGroupChangePolicy: "OnRootMismatch"
|
||||||
containers:
|
containers:
|
||||||
- name: mastodon-web
|
- name: mastodon-web
|
||||||
image: ghcr.io/mastodon/mastodon:v4.3.7
|
image: ghcr.io/mastodon/mastodon:v4.3.7
|
||||||
@ -215,6 +216,48 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: "/mastodon/public/system"
|
- mountPath: "/mastodon/public/system"
|
||||||
name: mastodon-data
|
name: mastodon-data
|
||||||
|
volumes:
|
||||||
|
- name: mastodon-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: mastodon-pvc
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: redis
|
||||||
|
namespace: mastodon
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: redis
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: redis
|
||||||
|
spec:
|
||||||
|
affinity:
|
||||||
|
podAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 100
|
||||||
|
podAffinityTerm:
|
||||||
|
labelSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: cnpg.io/cluster
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- mastodon-db
|
||||||
|
- key: cnpg.io/instanceRole
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- primary
|
||||||
|
topologyKey: "kubernetes.io/hostname"
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
|
fsGroup: 1000
|
||||||
|
fsGroupChangePolicy: "OnRootMismatch"
|
||||||
|
containers:
|
||||||
- name: redis
|
- name: redis
|
||||||
image: redis:7.4.2
|
image: redis:7.4.2
|
||||||
ports:
|
ports:
|
||||||
@ -223,9 +266,6 @@ spec:
|
|||||||
- mountPath: "/data"
|
- mountPath: "/data"
|
||||||
name: redis-data
|
name: redis-data
|
||||||
volumes:
|
volumes:
|
||||||
- name: mastodon-data
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: mastodon-pvc
|
|
||||||
- name: redis-data
|
- name: redis-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: redis-pvc
|
claimName: redis-pvc
|
||||||
|
@ -14,14 +14,12 @@ spec:
|
|||||||
storage: 50Gi
|
storage: 50Gi
|
||||||
storageClassName: redundant-storage-class
|
storageClassName: redundant-storage-class
|
||||||
---
|
---
|
||||||
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: redis-pvc
|
name: redis-pvc
|
||||||
namespace: mastodon
|
namespace: mastodon
|
||||||
labels:
|
|
||||||
recurring-job.longhorn.io/source: enabled
|
|
||||||
recurring-job-group.longhorn.io/standard-pvc: enabled
|
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
|
@ -4,7 +4,7 @@ metadata:
|
|||||||
name: redis-svc
|
name: redis-svc
|
||||||
namespace: mastodon
|
namespace: mastodon
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: mastodon
|
app.kubernetes.io/name: redis
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
@ -12,4 +12,4 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
targetPort: 6379
|
targetPort: 6379
|
||||||
selector:
|
selector:
|
||||||
app: mastodon
|
app: redis
|
||||||
|
Loading…
x
Reference in New Issue
Block a user