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

Minikube: more options for connectivity #2312

Merged
merged 3 commits into from
Oct 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletions site/content/en/docs/Installation/Creating Cluster/minikube.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,33 @@ may be required for your platform of choice.

{{< alert title="Note" color="info">}}
You may need to increase the `--cpu` or `--memory` values for your minikube instance, depending on what resources are
available on the host and/or how many GameServers you wish to run locally.
available on the host and/or how many GameServers you wish to run locally.

Depending on your Operating System, you may also need to change the `--vm-driver`
([driver list](https://minikube.sigs.k8s.io/docs/drivers/)) to enable `GameServer` connectivity with or without
some workarounds listed below.
{{< /alert >}}

### Known working drivers

Other operating systems and drivers may work, but at this stage have not been verified to work with UDP connections
via Agones exposed ports.

**Linux**
* kvm2

**Mac**
* Docker (default)
* Hyperkit

**Windows**
* hyper-v (might need
[this blog post](https://blog.thepolyglotprogrammer.com/setting-up-kubernetes-on-wsl-to-work-with-minikube-on-windows-10-90dac3c72fa1)
and/or [this comment](https://github.com/microsoft/WSL/issues/4288#issuecomment-652259640) for WSL support)

_If you have successfully tested with other platforms and drivers, please click "edit this page" in the top right hand
side and submit a pull request to let us know._

## Local connection workarounds

Depending on your operating system and virtualization platform that you are using with Minikube, it may not be
Expand All @@ -44,8 +68,8 @@ If you are unable to do so, the following workarounds are available, and may wor

### minikube ip

Rather than using the published IP of a `GameServer` to connect, run `minikube ip` to get the local IP for the
minikube node, and connect to that address.
Rather than using the published IP of a `GameServer` to connect, run `minikube ip -p agones` to get the local IP for
the minikube node, and connect to that address.

### Create a service

Expand Down Expand Up @@ -77,6 +101,19 @@ Running `minikube service list -p agones` will show you the IP and port to conne
To connect to a different `GameServer`, run `kubectl edit service agones-gameserver` and edit the `${GAMESERVER_NAME}`
value to point to the new `GameServer` instance and/or the `${GAMESERVER_CONTAINER_PORT}` value as appropriate.

{{< alert title="Warning" color="warning">}}
`minikube tunnel` ([docs](https://minikube.sigs.k8s.io/docs/handbook/accessing/))
does not support UDP ([Github Issue](https://github.com/kubernetes/minikube/issues/12362)) on some combination of
operating system, platforms and drivers, but is required when using the `Service` workaround.
{{< /alert >}}
Comment on lines +105 to +108
Copy link
Contributor

@mvlabat mvlabat Oct 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I gathered when testing the workarounds locally, minikube tunnel is actually a self-sufficient workaround itself and can be used without creating a separate service.

minikube tunnel tunnels the traffic itself, thus making gameserver pods accessible from the host. On the setups where the address returned by minikube ip isn't accessible from the host, the service workaround will be useless, as the service is still behind the minikube ip address.

So if the purpose of the "Create a service" workaround is to tunnel the traffic to the host, I'm afraid it doesn't work at all (it'll be accessible if using minikube tunnel, but that defeats the purpose of the service then). Please correct me if I misinterpreted what the service workaround is supposed to do or if it did work in some cases. So my suggestion is to remove "Create a service" section completely and just mention minikube tunnel -p agones command as the workaround.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy pasting from https://minikube.sigs.k8s.io/docs/handbook/accessing/

Services of type LoadBalancer can be exposed via the minikube tunnel command. It must be run in a separate terminal window to keep the LoadBalancer running.

From: https://minikube.sigs.k8s.io/docs/commands/tunnel/

tunnel creates a route to services deployed with type LoadBalancer and sets their Ingress to their ClusterIP. for a detailed example see https://minikube.sigs.k8s.io/docs/tasks/loadbalancer

So as far as I read it, minikube tunnel can only be used with a Service. As far as I can tell it doesn't do anything else, so I don't think we should remove the Service workaround section, since it's part of the possible workaround solution.

I don't see anything in the documentation that states that minikube tunnel connects the node to the host machine for generalised traffic (maybe it does do that though on some platforms??? 🤔 )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think you're right. I believe I tested it on a service that happened to be also a load balancer (and didn't notice that), so this is why I got such an impression.

I've got no other comments or suggestions then. Thanks a lot for updating the documentation!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working through so much of this with me!


### Use a different driver

If you cannot connect through the `Service`or use other workarounds, you may want to try a different
[minikube driver](https://minikube.sigs.k8s.io/docs/drivers/), and if that doesn't work, connection via UDP may not
be possible with minikube, and you may want to try either a
[different local Kubernetes tool](https://kubernetes.io/docs/tasks/tools/) or use a cloud hosted Kubernetes cluster.

## Next Steps

- Continue to [Install Agones]({{< relref "../Install Agones/_index.md" >}}).