I have the following bash script but im unable to use my defined command "kctl" if i call it with "get pods". Do I maybe have to add a placeholder behind the command at the kctl() funtction or so?
#!/bin/bash
KCTL=$(which kubectl)
KUBECONFIG=$1
kctl() {
$KCTL --kubeconfig=$KUBECONFIG
}
kctl get pods
For some reason I always get back the kubectl help and not a list of pods at the default namespace.
Thanks in advance