I’m looking for a way to wire up a hostPath volume in a K8s charm, so that an existing directory on the K8s node is exposed to the charm. However, I haven’t found a way to do this.
AFAICT the Juju-native storage mechanism will either mount a new volume (via the
kubernetes type storage) or use an
emptyDir. Is that still correct? The K8s-native config I would like to approximate is:
# in a .spec for kind: Pod ... containers: - name: foo # # ... stuff ... # volumeMounts: - name: varlog mountPath: /var/log - name: varlibdockercontainers mountPath: /var/lib/docker/containers readOnly: true # # ... more stuff ... # volumes: - name: varlog hostPath: path: /var/log - name: varlibdockercontainers hostPath: path: /var/lib/docker/containers