apps(sharkey): Add init container for config

main
trivernis 10 months ago
parent 6808fcdfa1
commit 1197940d69
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -1,8 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: discordbot-2b
namespace: sharkey
metadata:
name: discordbot-2b
name: sharkey
resources:
- app/namespace.yaml
- app/sealedsecret.yaml

@ -4,7 +4,7 @@ metadata:
name: sharkey-config
namespace: sharkey
data:
default.yaml: |
default.yml: |
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Misskey configuration
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

@ -13,6 +13,20 @@ spec:
labels:
app: sharkey
spec:
initContainers:
- name: init-config
image: busybox
volumeMounts:
- name: sharkey-config
mountPath: "/sharkey/.config"
readOnly: false
- name: config-secret
mountPath: "/config-secret"
readOnly: true
- name: config
mountPath: "/config"
readOnly: true
command: ['sh', '-c', 'mkdir -p /sharkey/.config; cp /config-secret/*.yml /sharkey/.config/; cp /configt/*.yml /sharkey/.config/;']
containers:
- name: redis
image: redis
@ -23,14 +37,11 @@ spec:
- image: ghcr.io/transfem-org/sharkey:stable
name: sharkey
volumeMounts:
- name: config-secret
mountPath: "/sharkey/.config"
readOnly: true
- name: config
mountPath: "/sharkey/.config"
readOnly: true
- name: sharkey-files
mountPath: "/sharkey/files"
- name: sharkey-config
mountPath: "/sharkey/.config"
readOnly: true
env:
- name: example
valueFrom:
@ -50,4 +61,7 @@ spec:
path: "default.yml"
- name: sharkey-files
persistentVolumeClaim:
claimName: sharkey-files
claimName: sharkey-files-pvc
- name: sharkey-config
persistentVolumeClaim:
claimName: sharkey-config-pvc

@ -1,23 +1,25 @@
apiVersion: v1
kind: PersistentVolume
kind: PersistentVolumeClaim
metadata:
name: sharkey-files
name: sharkey-files-pvc
namespace: sharkey
spec:
capacity:
storage: 10Gi
storageClassName: "ebs-hdd"
accessModes:
- ReadWriteOnce
claimRef:
name: sharkey-files-pvc
namespace: sharkey
storageClassName: "ebs-hdd"
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: sharkey-files-pvc
name: sharkey-config-pvc
namespace: sharkey
spec:
storageClassName: "ebs-hdd"
volumeName: sharkey-files
accessModes:
- ReadWriteOnce
storageClassName: "ebs-ssd"
resources:
requests:
storage: 100Mi

Loading…
Cancel
Save