Skip to content
Permalink
Browse files

ci: sudo microk8s.$command

Apparently microk8s commands now require `sudo` to run [1]. Even
`kubectl`. It's a bit annoying to have to do this, but without it all of
our builds are blocked.

According to microk8s itself, we could try a different approach:

```
Insufficient permissions to access MicroK8s.
You can either try again with sudo or add the user travis to the 'microk8s' group:
    sudo usermod -a -G microk8s travis
The new group will be available on the user's next login.
```

Although that would require a new login during a CI run, which I'm also
not a fan of.

[1] ubuntu/microk8s#640
  • Loading branch information...
juliogreff committed Sep 12, 2019
1 parent d44aab1 commit f18b24d7414e66995e8b1805374ffa86681a9f35
Showing with 5 additions and 4 deletions.
  1. +5 −4 .travis.yml
@@ -7,13 +7,14 @@ services:
- docker
before_install:
- sudo snap install microk8s --classic --channel=1.14/stable
- sudo snap alias microk8s.kubectl kubectl
- curl -L https://storage.googleapis.com/kubernetes-release/release/v1.15.3/bin/linux/amd64/kubectl > $(go env GOPATH)/bin/kubectl
- chmod +x $(go env GOPATH)/bin/kubectl
- mkdir ~/.kube
- microk8s.config > ~/.kube/config
- sudo microk8s.config > ~/.kube/config
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh |
sh -s -- -b $(go env GOPATH)/bin v1.17.1
- microk8s.status --wait-ready
- microk8s.enable registry
- sudo microk8s.status --wait-ready
- sudo microk8s.enable registry
install: true
script:
- "./ci/test.sh && ./ci/build.sh && ./ci/e2e.sh"

0 comments on commit f18b24d

Please sign in to comment.
You can’t perform that action at this time.