For this use case within the shell script you can simply reference credentials it as ${HARNESS_KUBE_CONFIG_PATH}
export KUBECONFIG=${HARNESS_KUBE_CONFIG_PATH} kubectl get pods -n pod-test
With this even when running the shell script on delegate host, it can refer the credentials of the K8s cloud provider which is used inside infrastructure defintion associated with the workflow.
More information around HARNESS_KUBE_CONFIG_PATH is listed in docs: https://docs.harness.io/article/9dvxcegm90-variables#kubernetes