-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Run kubectl in test VM for older K8s releases
kubectl is guaranteed to be compatible with limited number of earlier releases: > kubectl is supported within one minor version (older or newer) of > kube-apiserver. So far we have been using the latest kubectl in the host (now 1.18) to control clusters from K8s 1.11 to 1.18. This did not work any more with 'istioctl', which complained about "kubectl not being found in $PATH". When pairing istioctl with the same version of kubectl as the cluster this started working again. Downgrading kubectl in the test hosts may not be practical, but the CI infra also supports running kubectl in the cluster's master node (k8s1). This is triggered via the value of the Ginkgo 'cilium.kubeconfig' option. When 'cilium.kubeconfig' is non-empty, it is assumed to be a path to a valid kubeconfig for connecting kubectl in the host to the test cluster. When 'cilium.kubeconfig' is empty, CI Ginkgo helpers assume that kubectl should be run on "k8s1". 'test/vagrant-ci-start.sh' expects KUBECONFIG environment variable to be set to the path to the file into which the kubeconfig fetched from the test cluster should be stored. Modify 'test/vagrant-ci-start.sh' to accept undefined KUBECONFIG to signify the need to run kubectl in the test cluster's master node (k8s1). Finally, remove setting of both the KUBECONFIG environment variable before calling 'vagrant-ci-start.sh' and the Ginkgo option 'cilium.kubeconfig' in 'ginkgo-kubernetes-all.Jenkinsfile' which is used to run the CI K8s test suite on k8s versions from 1.11 to 1.17. This way we always use the kubectl installed as part of the testing cluster itself, in the master node. This solves the compatibility problem with istioctl and should help guard that we have not introduced any kubectl syntax that would not be compatible with the target k8s version. Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
- Loading branch information
1 parent
29f0b34
commit 5cdde10
Showing
2 changed files
with
19 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters