diff --git a/apps/castopod/README.md b/apps/castopod/README.md index 7be0bfe..bac75ea 100644 --- a/apps/castopod/README.md +++ b/apps/castopod/README.md @@ -9,7 +9,7 @@ To install or upgrade the mariadb charts, first edit the version number in `exte make externalCharts chart=mariadb # Deploy -helmfile -f env/weeble/helmfile.yaml -l app=castopod apply --skip-deps +helmfile -f env/weeble/helmfile.yaml -l app=castopod sync --skip-deps ``` ## Castopod Setup @@ -23,3 +23,11 @@ password: **** ``` Then you can go to `https://castopod.tonygilkerson.us/cp-admin` + +## Storage + +The two PVC created by this app are used for storing the castopod media and db stuff. If you want to delete then reinstall and still retain the data then you will need to edit the PVs and set the reclaim policy to `Retain` + +```sh +kubectl patch pv -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}' +``` diff --git a/apps/castopod/charts/castopod/templates/deployment.yaml b/apps/castopod/charts/castopod/templates/deployment.yaml index b78cb90..90ba47e 100644 --- a/apps/castopod/charts/castopod/templates/deployment.yaml +++ b/apps/castopod/charts/castopod/templates/deployment.yaml @@ -17,9 +17,16 @@ spec: labels: app: castopod spec: + volumes: + - name: media + persistentVolumeClaim: + claimName: castopod-media containers: - image: castopod/castopod:latest name: castopod + volumeMounts: + - mountPath: /var/www/castopod/public/media + name: media ports: - containerPort: 8000 resources: {} @@ -49,3 +56,4 @@ spec: secretKeyRef: name: castopod key: cpPassword + diff --git a/apps/castopod/charts/castopod/templates/pvc.yaml b/apps/castopod/charts/castopod/templates/pvc.yaml new file mode 100644 index 0000000..dfcebae --- /dev/null +++ b/apps/castopod/charts/castopod/templates/pvc.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: castopod-media +spec: + storageClassName: microk8s-hostpath + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: castopod-db +spec: + storageClassName: microk8s-hostpath + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 3Gi \ No newline at end of file diff --git a/apps/castopod/values/mariadb.yaml.gotmpl b/apps/castopod/values/mariadb.yaml.gotmpl index dd51127..9883d6e 100644 --- a/apps/castopod/values/mariadb.yaml.gotmpl +++ b/apps/castopod/values/mariadb.yaml.gotmpl @@ -29,4 +29,9 @@ initResources: memory: 128Mi requests: cpu: 100m - memory: 128Mi \ No newline at end of file + memory: 128Mi + +## Storage parameters +storage: + ## Set persistentVolumenClaimName to reference an existing PVC + persistentVolumeClaimName: castopod-db