Skip to content

Commit 6741e18

Browse files
authored
local preview: add docker desktop instructions (coder#484)
1 parent afda253 commit 6741e18

File tree

2 files changed

+53
-6
lines changed

2 files changed

+53
-6
lines changed
162 KB
Loading

setup/kubernetes/local-preview.md

+53-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ title: "Local preview"
33
description: Set up a Coder deployment locally for testing.
44
---
55

6-
Coder is typically deployed onto Kubernetes cluster, but if you would like to
7-
set up a lightweight preview deployment, you can do so locally using using
8-
[Docker][docker-url] and [kind][kind-url].
6+
Coder is typically deployed to a remote data center, but you can use
7+
[Docker][docker-url] to create a lightweight preview deployment of Coder.
98

109
> Coder currently supports local preview only on workstations running macOS or
1110
> Linux.
@@ -18,7 +17,8 @@ Before proceeding, please make sure that you have the following installed:
1817

1918
1. [Docker](https://hub.docker.com/search?q=docker&type=edition&offering=community)
2019
1. [helm](https://helm.sh/docs/intro/install)
21-
1. [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
20+
1. [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) or
21+
[Docker Desktop](docker-desktop-url)
2222
1. [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl)
2323

2424
## Limitations
@@ -33,7 +33,7 @@ deployment running entirely inside a Docker container.
3333

3434
### CVMs
3535

36-
The local preview supports [CVMs][cvm-url] if you meet the following
36+
The kind deployment supports [CVMs][cvm-url] if you meet the following
3737
requirements (if you choose not to try out CVMs, these requirements do not
3838
apply):
3939

@@ -64,11 +64,18 @@ workspace.
6464

6565
We are working on bringing Dev URL support to local previews in later releases.
6666

67+
### SSH
68+
69+
When using kind for your local preview, SSH is not configured to run by default.
70+
71+
When using Docker Desktop for your local preview, SSH works as long as your
72+
machine does not have an existing SSH server running on port `22`.
73+
6774
### Air-gapped clusters
6875

6976
The local preview option does not work in an air-gapped deployment.
7077

71-
## Installing Coder
78+
## Option 1: Kind
7279

7380
To install Coder, run:
7481

@@ -99,6 +106,44 @@ Password: yfu...yu2
99106
Visit the URL, and log in using the provided credentials. The platform is
100107
automatically configured for you, so there's no first-time setup to do.
101108

109+
## Option 2: Docker Desktop
110+
111+
[Docker Desktop](docker-desktop-url) includes a standalone Kubernetes server and
112+
client that you can use to run Coder.
113+
114+
1. [Enable the Kubernetes cluster](docker-k8s-docs) inside Docker.
115+
116+
1. Ensure that Docker has enough resources allocated to meet
117+
[Coder's requirements](https://coder.com/docs/coder/v1.20/setup/requirements)
118+
(you can do so by going to Docker preferences).
119+
120+
![Docker Desktop Resources](../../assets/setup/docker-desktop-resources.png)
121+
122+
1. Install [metrics-server](https://github.com/kubernetes-sigs/metrics-server)
123+
so that Coder gets valid metrics from your cluster:
124+
125+
```console
126+
helm repo add bitnami https://charts.bitnami.com/bitnami
127+
```
128+
129+
1. [Install Coder](../installation) on to your cluster.
130+
131+
If you run into `OutOfmemory` errors when installing, try increasing your
132+
resource allocation in Docker. If increasing the resource allocation doesn't fix
133+
the error, reinstall Coder using the following Helm values:
134+
135+
```console
136+
helm upgrade --install coder \
137+
--set ingress.useDefault=false \
138+
--set cemanager.resources.requests.cpu="0m" \
139+
--set cemanager.resources.requests.memory="0Mi" \
140+
--set envproxy.resources.requests.cpu="0m" \
141+
--set envproxy.resources.requests.memory="0Mi" \
142+
--set timescale.resources.requests.cpu="0m" \
143+
--set timescale.resources.requests.memory="0Mi" \
144+
coder/coder
145+
```
146+
102147
## Removing Coder
103148

104149
To remove the local Coder deployment, run:
@@ -111,6 +156,8 @@ Because Coder runs inside Docker, you should have nothing left on your machine
111156
after tear down.
112157

113158
[docker-url]: https://www.docker.com/
159+
[docker-desktop-url]: https://www.docker.com/products/docker-desktop
160+
[docker-k8s-docs]: https://docs.docker.com/desktop/kubernetes/
114161
[kind-url]: https://kind.sigs.k8s.io/
115162
[cvm-url]: https://coder.com/docs/workspaces/cvms
116163
[docker-mac-url]:

0 commit comments

Comments
 (0)