We have a set of kubernetes yamls which is management by kustomize
and they will be deployed to different clusters. Each cluster is slightly different which means every environment will have a sub directory (environ/<envname>
) including some special kustomization overwrite.
We will manually deploy new version to different environments by command kubeclt apply -k environ/env
. But sometimes we do stupid thing like this: kubectl apply -k environ/env1
to the cluster env2
. So is there some method to stop doing a kubectl apply
to a wrong environment?