Description
What would you like to be added:
Currently, kubectl does not provide any warning regarding which Kubernetes cluster or cloud region the command is being executed on. This can lead to accidental modifications in the wrong environment (e.g., production instead of staging or wrong region ).
Add an interactive warning before executing any kubectl apply, delete, patch, replace, taint, exec, create, run commands, displaying the current region and asking for user confirmation before proceeding.
Example :
$ kubectl apply -f deployment.yaml
WARNING: You are making changes in region us-east-1 (Cluster: prod-cluster).
Do you want to continue? (yes/no):
This ensures users are aware of the region and cluster before proceeding.
Why is this needed:
Prevents accidental changes in production clusters.
Helps users working across multiple environments in difference regions
Enhances safety in cloud-based Kubernetes deployments.