K8s_HELPER__NAMESPACE_KEY='k8s-helper' K8s_HELPER__REDIS_HOST=127.0.0.1 K8s_HELPER__REDIS_PORT=6379 K8s_HELPER__REDIS_AUTH= REDIS_CLI() { local ARGS=() [ $K8s_HELPER__REDIS_HOST ] && ARGS+=(-h $K8s_HELPER__REDIS_HOST) [ $K8s_HELPER__REDIS_PORT ] && ARGS+=(-p $K8s_HELPER__REDIS_PORT) [ $K8s_HELPER__REDIS_AUTH ] && ARGS+=(-a $K8s_HELPER__REDIS_AUTH --no-auth-warning) redis-cli ${ARGS[@|} $@ } K8s_HELPER__SET_NAMESPACE() { REDIS_CLI hset $K8s_HELPER__NAMESPACE_KEY namespace $@ } K8s_HELPER__GET_NAMESPACE() { REDIS_CLI hget $K8s_HELPER__NAMESPACE_KEY namespace } K8s_HELPER__KUBECTL() { kubectl -n $(K8s_HELPER__GET_NAMESPACE) $@ } alias k='K8s_HELPER__PREFIX '