base64 encoding Kubernetes Secrets includes newline char when exported as an env variable (if you don’t use -n option with echo)

I’m deploying an app to Kubernetes that references a Kubernetes Secret that is exported as an env var on the pod. I couldn’t work out why I kept getting this error when the pod was starting up: FATAL: password authentication failed for user “admin” but if I exec’d into the pod to check the value …

Kubernetes: creating a hostPath PersistentVolume in a single node cluster

To create a ‘hostPath’ PersistentVolume in a single node cluster (do not use in a cluster with more than 1 node): kind: PersistentVolume apiVersion: v1 metadata: name: pv1 labels: type: local spec: storageClassName: manual capacity: storage: 1Gi accessModes: – ReadWriteOnce hostPath: path: “/your-path-for-vol1” If the above is pv1.yaml, apply with: kubectl apply -f pv1.yaml For …