BUSYBOX

Kubernetes how create folders for Physical Volumes (PVs) automatically

Kubernetes how create folders for Physical Volumes (PVs) automatically

Adding commands before an entrypoint.

Nathan Obert
Introduction This will be a quick short blog entry. Today I needed to have a container that could self-initialize it’s own Physical Volumes. This is quite easy to do with an init container. I’m going to provide a simple example to show how this works with busybox. Deployment YAML initContainers: - name: init-pv image: {{ .Values.initpv.image }} volumeMounts: - name: init mountPath: {{ .Values.persistentVolume.path }} {{- with .Values.initpv.command }} command: {{- toYaml .
Kubernetes init container to verify dependent service(s) are online.

Kubernetes init container to verify dependent service(s) are online.

Init container to check if kubernetes service available

Nathan Obert
Introduction With HELM Scripts containers all try to start at the same time. It depends on how the containers scripts were designed on if there is any sort of delay or dependency cchecking built into them. I wrote a very simple busybox script that can be used to prevent a container from starting until the kubernetes services is needs are available. In this example there are 3 checks going on.