The K8S_CONTEXT environment variable is used when setting up the python Kubernetes API client, but the actual node draining operation is performed by shelling out to kubectl rather than using the API, and the --context flag (and K8S_CONTEXT) variable are not passed when doing so. You can work around this by using the EXTRA_DRAIN_ARGS variable, but it isn't documented that you need to do so, and, it probably shouldn't be necessary at all.
The
K8S_CONTEXTenvironment variable is used when setting up the python Kubernetes API client, but the actual node draining operation is performed by shelling out tokubectlrather than using the API, and the--contextflag (andK8S_CONTEXT) variable are not passed when doing so. You can work around this by using theEXTRA_DRAIN_ARGSvariable, but it isn't documented that you need to do so, and, it probably shouldn't be necessary at all.