-
Notifications
You must be signed in to change notification settings - Fork 24
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
ENDOC-734 Docker Desktop blog post #766
Conversation
--- | ||
Setting up a local development environment and optimizing it for daily use is a critical task. Although most development tasks for Entando-compatible components do not require a local Entando instance, there are times when you want to test a new bundle and do not have a full remote cluster available. This blog post explores setting up a small cluster in [Docker Desktop](https://www.docker.com/products/docker-desktop/) for this purpose. | ||
|
||
There are numerous options available when setting up a local development environment using Kubernetes. Entando's [Getting Started Guide](../v7.2/docs/getting-started/README.md) makes use of [Multipass](https://multipass.run/) for this purpose but this approach isn't always possible, say in some enterprise environments where Docker Desktop is allowed but direct use of Windows Subsystem for Linux is not. In this situation, enabling Kubernetes in Docker Desktop can be the simplest path forward. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are numerous options available when setting up a local development environment using Kubernetes. Entando's [Getting Started Guide](../v7.2/docs/getting-started/README.md) makes use of [Multipass](https://multipass.run/) for this purpose but this approach isn't always possible, say in some enterprise environments where Docker Desktop is allowed but direct use of Windows Subsystem for Linux is not. In this situation, enabling Kubernetes in Docker Desktop can be the simplest path forward. | |
There are numerous options available when setting up a local development environment using Kubernetes. Entando's [Getting Started Guide](../v7.2/docs/getting-started/README.md) makes use of [Multipass](https://multipass.run/) for this purpose but this approach isn't always feasible, for instance, in some enterprise environments Docker Desktop is allowed but direct use of Windows Subsystem for Linux is not. In this situation, enabling Kubernetes in Docker Desktop can be the simplest path forward. |
|
||
There are numerous options available when setting up a local development environment using Kubernetes. Entando's [Getting Started Guide](../v7.2/docs/getting-started/README.md) makes use of [Multipass](https://multipass.run/) for this purpose but this approach isn't always possible, say in some enterprise environments where Docker Desktop is allowed but direct use of Windows Subsystem for Linux is not. In this situation, enabling Kubernetes in Docker Desktop can be the simplest path forward. | ||
|
||
>*Note:* The following steps were tested on Windows 11 with Docker Desktop (current at the time)including K8s 1.24. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>*Note:* The following steps were tested on Windows 11 with Docker Desktop (current at the time)including K8s 1.24. | |
>*Note:* The following steps were tested on Windows 11 with Docker Desktop (current at the time), including K8s 1.24. |
# Enable Kubernetes in Docker Desktop | ||
1. Start by enabling [Kubernetes in Docker Desktop](https://docs.docker.com/desktop/kubernetes/). In most cases this just involves enabling the option in the Docker Desktop UI and restarting Docker Desktop but there are some edge cases noted in the documentation. | ||
|
||
>*Optional:* For local development, connecting the entando CLI to your local cluster can be very useful. That can be done by [creating or selecting your ent profile](../v7.2/docs/getting-started/entando-cli.md) and then connecting your profile to the Kubernetes context using `ent profile link docker-desktop`. The following commands will reference `kubectl` but as always this can be replaced by `ent kubectl` or the shorter `ent k`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>*Optional:* For local development, connecting the entando CLI to your local cluster can be very useful. That can be done by [creating or selecting your ent profile](../v7.2/docs/getting-started/entando-cli.md) and then connecting your profile to the Kubernetes context using `ent profile link docker-desktop`. The following commands will reference `kubectl` but as always this can be replaced by `ent kubectl` or the shorter `ent k`. | |
>*Optional:* For local development, connecting the Entando CLI to your local cluster can be very useful. That can be done by [creating or selecting your ent profile](../v7.2/docs/getting-started/entando-cli.md) and then connecting your profile to the Kubernetes context using `ent profile link docker-desktop`. The following commands will reference `kubectl`, but as always this can be replaced by `ent kubectl` or the shorter `ent k`. |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.8.1/deploy/static/provider/cloud/deploy.yaml | ||
``` | ||
|
||
2. Access an arbitrary URL against localhost and you should now see an NGINX 404 error, for example `http://localhost/some-path`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Access an arbitrary URL against localhost and you should now see an NGINX 404 error, for example `http://localhost/some-path`. | |
2. Access an arbitrary URL against localhost and you should now see an NGINX 404 error, for example, `http://localhost/some-path`. |
kubectl apply -n entando -f https://raw.githubusercontent.com/entando/entando-releases/v7.2.2/dist/ge-1-1-6/namespace-scoped-deployment/namespace-resources.yaml | ||
``` | ||
|
||
7. Determine your IP address (YOUR-IP) using `hostname -I | awk '{print $1}'` or by visiting `https://whatismyip.com`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7. Determine your IP address (YOUR-IP) using `hostname -I | awk '{print $1}'` or by visiting `https://whatismyip.com`. | |
7. Determine your IP address (YOUR-IP in step 9) using `hostname -I | awk '{print $1}'` or by visiting `https://whatismyip.com`. |
``` | ||
|
||
9. Edit the template and set the ingressHostName to `entando.YOUR-IP.nip.io` or another address that will route to your local machine. | ||
> *Note:* Some connections from one pod to another will use a public address, rather than a cluster-level address. If the component manager and de-app deployments fail to start correctly, this is the most likely cause. See the [tips and tricks page](../v7.2/docs/reference/local-tips-and-tricks.md) for troubleshooting tips. In my testing I realized my router had recently upgraded and was blocking all port forwarding so I had to re-enable that setting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> *Note:* Some connections from one pod to another will use a public address, rather than a cluster-level address. If the component manager and de-app deployments fail to start correctly, this is the most likely cause. See the [tips and tricks page](../v7.2/docs/reference/local-tips-and-tricks.md) for troubleshooting tips. In my testing I realized my router had recently upgraded and was blocking all port forwarding so I had to re-enable that setting. | |
> *Note:* Some connections from one pod to another will use a public address, rather than a cluster-level address. If the Component Manager and `entando-de-app` deployments fail to start correctly, this is the most likely cause. See the [tips and tricks page](../v7.2/docs/reference/local-tips-and-tricks.md) for troubleshooting tips. In my testing, I realized my router had recently upgraded, blocking all port forwarding, so I had to re-enable that setting. |
* You can easily turn off Kubernetes (and come back to it later) by disabling the option in Docker Desktop | ||
|
||
*Cons* | ||
* I didn't do a thorough comparison but anecdotally Docker Desktop with Kubernetes consumes more resources, CPU and memory, than Entando's Multipass-based approach due to the overhead of Docker Desktop itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* I didn't do a thorough comparison but anecdotally Docker Desktop with Kubernetes consumes more resources, CPU and memory, than Entando's Multipass-based approach due to the overhead of Docker Desktop itself. | |
* I didn't do a thorough comparison, but anecdotally, Docker Desktop with Kubernetes consumes more resources, CPU and memory than Entando's Multipass-based approach due to the overhead of Docker Desktop itself. |
I can see a few pros and cons for this configuration: | ||
|
||
*Pros* | ||
* Docker Desktop has broad adoption so making use of its built-in support for Kubernetes can be very straightforward |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Docker Desktop has broad adoption so making use of its built-in support for Kubernetes can be very straightforward | |
* Docker Desktop has broad adoption so making use of its built-in support for Kubernetes can be very straightforward. |
|
||
*Pros* | ||
* Docker Desktop has broad adoption so making use of its built-in support for Kubernetes can be very straightforward | ||
* Networking is a typical challenge for local Kubernetes environments but I didn't observe anything more difficult with this setup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Networking is a typical challenge for local Kubernetes environments but I didn't observe anything more difficult with this setup | |
* Networking is a typical challenge for local Kubernetes environments but I didn't observe anything more difficult with this setup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because the cons have periods and these are full complex sentences
*Pros* | ||
* Docker Desktop has broad adoption so making use of its built-in support for Kubernetes can be very straightforward | ||
* Networking is a typical challenge for local Kubernetes environments but I didn't observe anything more difficult with this setup | ||
* You can easily turn off Kubernetes (and come back to it later) by disabling the option in Docker Desktop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* You can easily turn off Kubernetes (and come back to it later) by disabling the option in Docker Desktop | |
* You can easily turn off Kubernetes (and come back to it later) by disabling the option in Docker Desktop. |
No description provided.