apps(sharkey): Add init container for config

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

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

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

@ -13,6 +13,20 @@ spec:
labels: labels:
app: sharkey app: sharkey
spec: 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: containers:
- name: redis - name: redis
image: redis image: redis
@ -23,14 +37,11 @@ spec:
- image: ghcr.io/transfem-org/sharkey:stable - image: ghcr.io/transfem-org/sharkey:stable
name: sharkey name: sharkey
volumeMounts: volumeMounts:
- name: config-secret
mountPath: "/sharkey/.config"
readOnly: true
- name: config
mountPath: "/sharkey/.config"
readOnly: true
- name: sharkey-files - name: sharkey-files
mountPath: "/sharkey/files" mountPath: "/sharkey/files"
- name: sharkey-config
mountPath: "/sharkey/.config"
readOnly: true
env: env:
- name: example - name: example
valueFrom: valueFrom:
@ -50,4 +61,7 @@ spec:
path: "default.yml" path: "default.yml"
- name: sharkey-files - name: sharkey-files
persistentVolumeClaim: persistentVolumeClaim:
claimName: sharkey-files claimName: sharkey-files-pvc
- name: sharkey-config
persistentVolumeClaim:
claimName: sharkey-config-pvc

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

Loading…
Cancel
Save