k8s-at-home / charts

⚠️ Deprecated : Helm charts for applications you run at home
https://docs.k8s-at-home.com
Apache License 2.0
1.45k stars 621 forks source link

Homer persistence enabled fails to create a pvc #1464

Open sudo-rm-rf-slash opened 2 years ago

sudo-rm-rf-slash commented 2 years ago

Details

Helm chart name and version:

homer-7.1.0

Container name and tag:

b4bz/homer:21.09.2 I also tested b4bz/homer:latest (Latest Image was 20/03/2022)

What steps did you take and what happened:

The homer chart ignores persistence enabled: true and does not attempt to create a pvc. I have used multiple helm charts by k8s-at-home and they all work fine and create a pvc.

Relevant Helm values:

persistence:
  config:
    enabled: true
    mountPath: /www/assets
    storageClass: freenas-nfs-csi
    accessMode: ReadWriteMany
    size: 1Gi

What did you expect to happen:

I expected a homer PVC to be created.

Anything else you would like to add:

I am running MicroK8s v1.23.4-2+98fc2022f3ad3e on Ubunutu 20.03 AMD64 in a 3 node cluster. My NAS NFS target is TrueNAS Core 12.

I am using https://github.com/democratic-csi/democratic-csi provisioner for nfs I also got the same result when using the nfs.csi.k8s.io provisioner v1.20

Additional Information:

After applying the helm chart when I query the cluster for a pvc there is no homer pvc. You can see two succesful PVC claims for other deployments that are Bound. One is using the freenas-nfs-csi strorage class.

$ kubectl get pvc --all-namespaces
NAMESPACE   NAME                       STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS        AGE
default     photoprism-config          Bound    pvc-04f8b44a-ee1f-437f-bcd0-b6ee796c9748   1Gi        RWX            freenas-nfs-csi     22h
default     data-wikijs-postgresql-0   Bound    pvc-638e8615-bb7f-4102-ae92-64814ca83cfc   10Gi       RWO            freenas-iscsi-csi   21h
bjw-s commented 2 years ago

Do you happen to have https://github.com/k8s-at-home/charts/blob/master/charts/stable/homer/values.yaml#L50enabled? In that case the config persistence item would be overwritten by the configured configMap.

I'll add a note to the README about this behavior if that is indeed what is causing it for you.

sudo-rm-rf-slash commented 2 years ago

Yes. I have configmap enabled.

ghost commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two weeks if no further activity occurs. Thank you for your contributions.

sudo-rm-rf-slash commented 2 years ago

Any chance we can get this issue resolved? Configmap is required. That is how the homer config is stored.

onedr0p commented 2 years ago

Hi @sudo-rm-rf-slash we're a very small team (2-3 people maintaining these charts) and it's unfortunate to say we don't prioritize applications we do not use ourselves. Any help would be great from you or the the community to help fix issues. I hope you understand.

djjudas21 commented 2 years ago

@sudo-rm-rf-slash as a workaround, you can just change this:

persistence:
  config:
    enabled: true
    mountPath: /www/assets
    storageClass: freenas-nfs-csi
    accessMode: ReadWriteMany
    size: 1Gi

to

persistence:
  whatever:
    enabled: true
    mountPath: /www/assets
    storageClass: freenas-nfs-csi
    accessMode: ReadWriteMany
    size: 1Gi

and mount your PVC under a different name whatever so it doesn't clash with the configmap.

For what it's worth, looks like our setups are almost identical (MicroK8s, TrueNAS, Democratic CSI). For my Homer instance, instead of making such a lightweight app rely on persistent storage, I store my assets in a configmap and mount that into the pod as a directory.

Relevant part of my values.yaml:

# make a configmap under a different name and mount it as a dir
persistence:
  images:
    name: homer-images
    enabled: true
    mountPath: /www/assets/custom
    type: configMap

configmap:
  # configmap with images
  images:
    enabled: true
  # regular Homer config here
  config:
    # -- Store homer configuration as a ConfigMap
    enabled: true
    # -- Homer configuration. See [image documentation](https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md) for more information.
    # @default -- See values.yaml
    data:

Then the images are stored with my values.yaml in a subdirectory called images and are loaded into the configmap at deploy time, like this:

#!/bin/sh
helm upgrade -i --create-namespace -n homer homer -f values.yaml k8s-at-home/homer
kubectl create configmap -n homer homer-images --from-file=logos --dry-run -o yaml | kubectl apply -f -