Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crictl within VM fails with "connection is unavailable" due to missing /etc/crictl.yaml #3043

Closed
afbjorklund opened this issue Aug 3, 2018 · 6 comments
Labels
area/guest-vm General configuration issues with the minikube guest VM co/runtime/crio CRIO related issues kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@afbjorklund
Copy link
Collaborator

Is this a BUG REPORT or FEATURE REQUEST? (choose one):

FEATURE REQUEST

** Details**

When configuring CRI-O as the container runtime, we should configure crictl to use it by default.

$ cat /etc/crictl.yaml
runtime-endpoint: unix:///var/run/dockershim.sock
image-endpoint: unix:///var/run/dockershim.sock
$ cat /etc/crictl.yaml
runtime-endpoint: unix:///var/run/crio/crio.sock
image-endpoint: unix:///var/run/crio/crio.sock

Otherwise using crictl will give an error, or maybe some ugly looking deprecation warning etc.

$ sudo crictl version
FATA[0000] getting the runtime version failed: rpc error: code = Unavailable desc = grpc: the connection is unavailable 
$ sudo crictl -r /var/run/crio/crio.sock version
W0803 12:03:56.591607   15155 util_unix.go:75] Using "/var/run/crio/crio.sock" as endpoint is deprecated, please consider using full url format "unix:///var/run/crio/crio.sock".
Version:  0.1.0
RuntimeName:  cri-o
RuntimeVersion:  1.10.0
RuntimeApiVersion:  v1alpha1
@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Sep 8, 2018

Related to #3024 ($CONTAINER_RUNTIME_ENDPOINT)

@tstromberg tstromberg added the co/runtime/crio CRIO related issues label Sep 18, 2018
@tstromberg
Copy link
Contributor

tstromberg commented Sep 18, 2018

Confirmed. When this is used:

minikube start \
         --network-plugin=cni \
         --container-runtime=cri-o \
         --bootstrapper=kubeadm --vm-driver=kvm2

crictl version fails within "minikube ssh":

FATA[0000] getting the runtime version failed: rpc error: code = Unavailable desc = grpc: the connection is unavailable 

This fixes it:

cat > /etc/crictl.yaml
runtime-endpoint: unix:///var/run/crio/crio.sock
image-endpoint: unix:///var/run/crio/crio.sock

@tstromberg tstromberg changed the title Configure crictl.yaml "crictl version" fails with "connection is unavailable" because of missing /etc/crictl.yaml file Sep 18, 2018
@tstromberg tstromberg changed the title "crictl version" fails with "connection is unavailable" because of missing /etc/crictl.yaml file crictl within VM fails with "connection is unavailable" due to missing /etc/crictl.yaml Sep 18, 2018
@tstromberg tstromberg added area/guest-vm General configuration issues with the minikube guest VM kind/bug Categorizes issue or PR as related to a bug. labels Sep 18, 2018
@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Sep 30, 2018

Sadly this needs to be set up by the provisioner, which I am not even sure knows the container-runtime...

https://github.com/kubernetes/minikube/blob/master/pkg/provision/buildroot.go#L188

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Sep 30, 2018

No, the provisioner indeed only knows about Docker - and only the subset config hardcoded by machine.

https://github.com/kubernetes/minikube/blob/master/vendor/github.com/docker/machine/libmachine/engine/engine.go#L7:L21

This means that setting up registries and setting up the crictl configuration needs to be in bootstrapper.

https://github.com/kubernetes/minikube/blob/master/pkg/minikube/bootstrapper/kubeadm/kubeadm.go#L208

Which is probably wrong, since crictl doesn't have anything to do with kubeadm (it's a requirement).

But we can't install it with crictl, since we don't know which of the three endpoints will ultimately be used.

@afbjorklund
Copy link
Collaborator Author

@tstromberg : should be fixed now...

Note that you will still get the error above, unless you remember to run: sudo crictl version

                         _             _            
            _         _ ( )           ( )           
  ___ ___  (_)  ___  (_)| |/')  _   _ | |_      __  
/' _ ` _ `\| |/' _ `\| || , <  ( ) ( )| '_`\  /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )(  ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)

$ crictl version
FATA[0000] getting the runtime version failed: rpc error: code = Unavailable desc = grpc: the connection is unavailable 
$ sudo crictl version
Version:  0.1.0
RuntimeName:  cri-o
RuntimeVersion:  1.10.0
RuntimeApiVersion:  v1alpha1
$ 

At least it doesn't segfault anymore, when running crictl version ? Always something...

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/guest-vm General configuration issues with the minikube guest VM co/runtime/crio CRIO related issues kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

4 participants