Improve Kubernetes support
This is made on top of https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/merge_requests/30.
It improves support for:
- reading credentials from
.kube/config
orKUBECONFIG
env variable, - supporting missing docker image,
- removing helper containers to run clone/artifacts/caching support,
- adding integration tests for most common scenarios: abort, cancel, missing image, build failure,
- adds a notice to license
executors/kubernetes/exec.go
that this file was modified
Merge request reports
Activity
Added 1 commit:
- d35c01bd - Make lint happy
Added 41 commits:
-
d35c01bd...2e36ec6c - 40 commits from branch
master
- f331b67b - Merge remote-tracking branch 'origin/master' into kubernetes-support
-
d35c01bd...2e36ec6c - 40 commits from branch
Added 1 commit:
- d35c01bd - Make lint happy
338 308 err := e.Prepare(test.GlobalConfig, test.RunnerConfig, test.Build) 339 309 340 310 if err != nil { 311 if test.Error { 312 assert.Error(t, err) 313 } else { 314 assert.NoError(t, err) 315 } 341 316 if !test.Error { 342 317 t.Errorf("Got error. Expected: %v", test.Expected) 343 318 } - Resolved by Kamil Trzciński
- Resolved by Kamil Trzciński
- Resolved by Kamil Trzciński
- Resolved by Kamil Trzciński
I don't have strong opinion on dependency on
kubectl
, but by executingkubectl cluster-info
we are also ensuring that the credentials are valid and allow to access currently running cluster.Edited by Kamil TrzcińskiThe tests pass locally \o/
ok gitlab.com/gitlab-org/gitlab-ci-multi-runner/executors/kubernetes 156.440s coverage: 49.7% of statements
Coverage seems low compared to docker (62%), docker-machine (71%), shell (73.8%) and virtualbox (67.5%), but I think it's fibbing - profile attached.
About half of my comments from !30 (merged) appear to be addressed, it's a bit difficult to swap from one to the other
I agree it's not perfect.
mentioned in issue omnibus-gitlab#1412 (closed)
You have to configure access to Kubernetes cluster, then you will see this:
coverage: 80.8% of statements ok gitlab.com/gitlab-org/gitlab-ci-multi-runner/executors/kubernetes 27.302s
Added 1 commit:
- 45e8436e - Update Kubernetes documentation
Added 1 commit:
- fcaf28c3 - Close kubeClient on Cleanup
Enabled an automatic merge when the build for fcaf28c3 succeeds
Added 11 commits:
-
fcaf28c3...aebd7006 - 10 commits from branch
master
- bef548ff - Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ci-multi-runner into kubernetes-support
-
fcaf28c3...aebd7006 - 10 commits from branch
mentioned in commit 18ae6b13
@andypost This is part of Bleeding Edge release.
- docs/executors/kubernetes.md 0 → 100644
31 1. **Build**: User build. This is run on the user-provided docker image. 32 1. **Post-build**: Create cache, upload artifacts to GitLab. This is run on 33 a special Docker Image. 34 35 The special Docker Image is based on [Alpine Linux] and contains all the tools 36 required to run the prepare step of the build: the Git binary and the Runner 37 binary for supporting caching and artifacts. You can find the definition of 38 this special image [in the official Runner repository][special-build]. 39 40 ## Connecting to the Kubernetes API 41 42 The following options are provided, which allow you to connect to the Kubernetes API: 43 44 - `host`: Optional Kubernetes master host URL (auto-discovery attempted if not specified) 45 - `cert_file`: Optional Kubernetes master auth certificate 46 - `key_file`: Optional Kubernetes master auth private key Mentioned in merge request gitlab-com/www-gitlab-com!3202 (merged)