YAML

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 how inject commands before entrypoint

Kubernetes how inject commands before entrypoint

Adding commands before an entrypoint.

Nathan Obert
Introduction This will be a quick short blog entry. Today I had an image running on Kubernetes from a vender invoked through HELM, and I needed to run some arbtirary commands however I did not want to extend the image and have to deal with maintaining yet another image. Below is the solution I came up with. YAML to inject commands before entry point. image: repository: docker.io/user/image pullPolicy: IfNotPresent tag: "latest" command: - bash - "-c" - | sed -i 's/^param=.