How to figuring out hostpath mappings for apps?

MisterE2002

Patron
Joined
Sep 5, 2015
Messages
211
So i think i have basic knowledge out containers but i am unfamiliar about "linked" variants. Installed TrueCharts spotnet today and have some questions.

* spotnet seems to create 2 pods ("postgresql" and "spotweb"), whereof 1 pod with 2 containers ("spotweb" and "db-wait"). If i add a hostmapping it is only added to pod "spotweb". We can not specify a particular pod. Is the assumption correct that only the "primary" pod creates volatile data (the data we want to keep). If the postgresql pod creates its own PVC we can not use a hostpath mapping?

* For normal Docker images we get volume documentation on dockerhub. Where can i find this for truechart images? Usually this is "/config" but not in this case.

* If documentation is unavailable how to determine the mapping to make? I was hoping i can look at the default PVC mapping and overrule this. But this does not really help.


Looking at the truenas host i see no mount point.
zfs list | grep spotweb
tank/ix-applications/releases/spotweb/volumes/pvc-d0aba042-d914-4495-89b3-04af273c67f4 17.5M 999G 17.5M legacy

The result of "mount" in or outside the container is not useful.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I think maybe what you're looking for is either truetool's mount feature or you can find them in k3s kubectl describe pods --all-namespaces with a combination of Mounts and Volumes sections.
 

MisterE2002

Patron
Joined
Sep 5, 2015
Messages
211
Thanks for the pointer in the right direction.
I have no Kubernetes experience, so toyed a bit.

If my assumption is correct: All data seems to get stored in the database pod (notice the "db-spotweb-postgresql-0" for the postgresql pod).
This is mounted on "/bitnami/postgresql" which seem to match the documentation

However, i mounted host "/mnt/tank/share/spotnet" to container "/hostmachine". This is attached to the spotweb pod.

So this means 3 possibilities:
* I still do not understand something
* The truecharts is not contructed to make this possible
* TrueNAS is lacking the feature to attach a hostpath to a wanted pod


Code:
k3s kubectl get pods -A |grep spotweb
kube-system           svclb-spotweb-51650403-llrlz               1/1     Running           0              77s
ix-spotweb            spotweb-postgresql-0                       1/1     Running           0              77s
ix-spotweb            spotweb-679667878d-5q768                   1/1     Running           0              77s


Code:
k3s kubectl describe pod spotweb-679667878d-5q768 -n ix-spotweb
    Mounts:
      /dev/shm from shm (rw)
      /hostmachine from list-0 (rw)
      /shared from shared (rw)
      /tmp from temp (rw)
      /var/logs from varlogs (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-djjdn (ro)
Volumes:
  list-0:
    Type:          HostPath (bare host directory volume)
    Path:          /mnt/tank/share/spotnet
    HostPathType:  



Code:
k3s kubectl describe pod spotweb-postgresql-0 -n ix-spotweb
    Mounts:
      /bitnami/postgresql from db (rw)
      /dev/shm from shm (rw)
      /shared from shared (rw)
      /tmp from temp (rw)
      /var/logs from varlogs (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-d2mjj (ro)
Volumes:
  db:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  db-spotweb-postgresql-0
    ReadOnly:   false



Code:
root@san:~# k3s kubectl describe pvc --all-namespaces
Name:          db-spotweb-postgresql-0
Namespace:     ix-spotweb
StorageClass:  ix-storage-class-spotweb
Status:        Bound
Volume:        pvc-d0aba042-d914-4495-89b3-04af273c67f4
Labels:        app.kubernetes.io/instance=spotweb
               app.kubernetes.io/name=postgresql
Annotations:   pv.kubernetes.io/bind-completed: yes
               pv.kubernetes.io/bound-by-controller: yes
               volume.beta.kubernetes.io/storage-provisioner: zfs.csi.openebs.io
               volume.kubernetes.io/storage-provisioner: zfs.csi.openebs.io
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      999Gi
Access Modes:  RWO
VolumeMode:    Filesystem
Used By:       spotweb-postgresql-0
Events:        <none>
 

MisterE2002

Patron
Joined
Sep 5, 2015
Messages
211
@sretalla: any experience with this stuff? I filed a bug report.
They closed it. But i really dislike "invisible" stuff on my nas.

I only only see something like "sync between pods". So maybe the Spotweb and Database POD need some synchronization?

All other arguments seems not relevant. We want a local install bound to the nas itself. We do want failover (truenas does not even support multiple nodes).
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
They have explained it pretty well in the bug report.

i really dislike "invisible" stuff on my nas.

If you want to see the contents of the PVC, use truetool to mount it. It's really that simple.
 
Top