--- title: "PVC Debug Pod" date: 2024-03-04T22:05:41-08:00 tags: - k8s --- I've been annoyed sufficiently-often by the fact that there is no single `kubectl` command to "_create a pod, and attach a PVC to it_" that I threw together the following script: ```bash #!/bin/bash set -ex # This script assumes the existence and correct configuration of `kubectl` and `fzf`. # TODO - cool feature would be to grab namespaces with `kubectl get ns` and pipe through `fzf` to select - but, 99% of the time, this'll just be for the current namespace anyway PVC_TO_MOUNT=$(kubectl get pvc --no-headers | awk '{print $1}' | fzf) POD_CREATE_OUTPUT=$(cat <