From f30965d8f0c17354f99e1886d66c544dd4dc7187 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 25 May 2022 16:07:15 -0500 Subject: [PATCH 1/2] chore: remove local preview script --- manifest.json | 15 +- setup/kubernetes/k3s.md | 2 +- setup/kubernetes/local-preview.md | 258 ------------------------------ 3 files changed, 10 insertions(+), 265 deletions(-) delete mode 100644 setup/kubernetes/local-preview.md diff --git a/manifest.json b/manifest.json index 2d6d42e5a..b9dc6bc47 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,12 @@ { - "versions": ["v1.31", "v1.30", "v1.29", "v1.28", "v1.27", "v1.26"], + "versions": [ + "v1.31", + "v1.30", + "v1.29", + "v1.28", + "v1.27", + "v1.26" + ], "routes": [ { "path": "./index.md", @@ -154,10 +161,6 @@ { "path": "./setup/kubernetes/index.md", "children": [ - { - "path": "./setup/kubernetes/local-preview.md", - "navigable": false - }, { "path": "./setup/kubernetes/k3s.md" }, @@ -823,4 +826,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/setup/kubernetes/k3s.md b/setup/kubernetes/k3s.md index c21787ac1..db675c813 100644 --- a/setup/kubernetes/k3s.md +++ b/setup/kubernetes/k3s.md @@ -8,7 +8,7 @@ machine for use with Coder. [K3s](https://k3s.io/) is a lightweight Kubernetes distribution that works well for single-node or multi-node clusters. For single-user trial purposes, you may -want to consider the options in [local preview](./local-preview.md). +want to consider the options in [Coder for Docker](../coder-for-docker/index.md). > This installation method is not officially supported or tested by Coder. If > you have questions or run into issues, feel free to reach out using our diff --git a/setup/kubernetes/local-preview.md b/setup/kubernetes/local-preview.md deleted file mode 100644 index 1b7a077fb..000000000 --- a/setup/kubernetes/local-preview.md +++ /dev/null @@ -1,258 +0,0 @@ ---- -title: "Local preview" -description: Set up a Coder deployment locally for testing. ---- - -> :warning: This article is archived. For a local preview of Coder, we recommend -> [Coder for Docker](../coder-for-docker/index.md). - - - -Coder is typically deployed to a remote data center, but you can use -[Docker][docker-url] to create a lightweight preview deployment of Coder. - -> Coder currently supports local preview only on workstations running macOS or -> Linux. - -## Prerequisites - -Before proceeding, please make sure that you have the following installed: - -1. [Docker](https://hub.docker.com/search?q=docker&type=edition&offering=community) -1. [helm](https://helm.sh/docs/intro/install) -1. [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) or - [Docker Desktop][docker-desktop-url] -1. [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) - -You will also need to [generate a free Coder license](https://coder.com/trial), -which you can upload upon installation. - -## Limitations - -**We do not recommend using local previews for production deployments of -Coder.** - -The local preview does not work as a workspace provider for Coder's hosted beta. - -### Resource allocation and performance - -Your experience with the local Coder preview is dependent on your system specs, -but please note that you can expect slightly degraded performance due to the -deployment running entirely inside a Docker container. - -### CVMs - -The kind deployment supports [CVMs][cvm-url] if you meet the following -requirements (if you choose not to try out CVMs, these requirements do not -apply): - -1. Your Linux hosts must be running Linux Kernel 5 and above. - -1. You must have the `linux-headers` package corresponding to your Kernel - version installed. You should see the following folders all corresponding to - your Kernel version: - - ```console - $ uname -r - 5.11.4-arch1-1 - $ ls /usr/lib/modules - 5.11.4-arch1-1 - $ ls /usr/src/ - linux linux-headers-5.11.4-arch1-1 - ``` - -1. Docker Desktop for Mac **must** use version [2.5.0.1][docker-mac-url]. This - specific version is required because of a recent downgrade to Linux Kernel - 4.9 due to a [bug][docker-bug-url]. - -### Air-gapped clusters - -The local preview option does not work in an air-gapped deployment. - -## Option 1: Kind - -To install Coder, run: - -```console -curl -fsSL https://coder.com/try.sh | PORT="80" sh -s -- -``` - -> You can edit the value of `PORT` to control where the Coder dashboard will be -> available. However, dev URLs will only work when `PORT` is set to `80`. - -When the installation process completes, you'll see the URL and login -credentials you need to access Coder: - -```txt -You can now access Coder at - - http://localhost:80 - -You can tear down the deployment with - - curl -fsSL https://coder.com/try.sh | sh -s -- down - -Platform credentials -User: admin -Password: yfu...yu2 -``` - -Visit the URL shown, and log in using the provided credentials. - -## Option 2: Docker Desktop - -[Docker Desktop][docker-desktop-url] includes a standalone Kubernetes server and -client that you can use to run Coder. - -1. [Enable the Kubernetes cluster][docker-k8s-docs] inside Docker. - -1. Ensure that Docker has enough resources allocated to meet - [Coder's requirements](../requirements) (you can do so by going to Docker - preferences). - - ![Docker Desktop Resources](../../assets/setup/docker-desktop-resources.png) - -1. Install [metrics-server](https://github.com/kubernetes-sigs/metrics-server) - so that Coder gets valid metrics from your cluster: - - ```console - helm repo add bitnami https://charts.bitnami.com/bitnami - ``` - -1. [Install Coder](../installation) on to your cluster. - -If you run into `OutOfmemory` errors when installing, try increasing your -resource allocation in Docker. If increasing the resource allocation doesn't fix -the error, reinstall Coder using the following Helm values: - -```console -helm upgrade --install coder \ - coder/coder -``` - -> For Coder v1.21+, you will need to update your access URL (go to **Manage** > -> **Admin**) to your private IP address (e.g `192.168.1.x`) instead of using -> `localhost`. - -## Using Dev URLs with local preview - -Coder allows you to access services you're developing in your workspace via -[dev URLs](../../workspaces/devurls.md). You can enable dev URLs after you've -installed Coder. - -> If you do not want to enable dev URLs, you can use SSH port forwarding or -> tools like [ngrok][ngrok-url] to preview webpages from inside you workspace. - -1. To use dev URLs, you must have a wildcard subdomain. One option to meet this - requirement is to use a service such as [nip.io][nip-url] to route domains to - a local IP address. - -1. [Update Coder](../upgrade/index.md#update-coder) with the following Helm - values added for either your local (`127.0.0.1`) or private (e.g., - `192.168.1.x`) address: - - ```yaml - coderd: - devurlsHost: "*.127.0.0.1.nip.io" - ``` - -Alternatively, you can use [dnsmasq][dnsmasq-url] to create local domains (e.g., -`http://dashboard.coder` and `http://*.coder`). This may be useful if you do not -want to rely on an external service/network or if your network has DNS rebinding -protection. Here's how to do this: - -1. Install dnsmasq - - ```console - # Mac OS - brew install dnsmasq - - # Linux (Ubuntu) - sudo apt-get install dnsmasq - ``` - -1. Create a dnsmasq configuration for the `.coder` domain - - ```console - # Mac OS - sudo touch $(brew --prefix)/etc/dnsmasq.d/coder.conf - sudo vim $(brew --prefix)/etc/dnsmasq.d/coder.conf - - # Linux (Ubuntu) - sudo touch /etc/dnsmasq.d/coder.conf - sudo vim /etc/dnsmasq.d/coder.conf - ``` - - ```text - # coder.conf - address=/coder/127.0.0.1 - ``` - -1. Add dnsmasq as DNS resolver on your machine - - ```console - # Mac OS: this will only route - # .coder domains to dnsmasq - sudo mkdir -p /etc/resolver - sudo touch /etc/resolver/ - sudo vim /etc/resolver/coder - - # Linux (Ubuntu) - # add to top of the file - sudo vim /etc/resolv.conf - ``` - - ```text - nameserver 127.0.0.1 - ``` - -1. [Update Coder](../upgrade/index.md#update-coder) with these Helm values added - to use your new domains: - - ```yaml - coderd: - devurlsHost: "*.coder" - ``` - -## Removing Coder - -To remove the local Coder deployment, run: - -```console -curl -fsSL https://coder.com/try.sh | sh -s -- down -``` - -Because Coder runs inside Docker, you should have nothing left on your machine -after tear down. - -If you added a custom DNS to use [dev URLs](#dev-urls), you can revert these -changes by uninstalling dnsmasq and removing the resolver config: - -```console -# MacOS -brew remove dnsmasq -sudo rm -r /etc/resolver/coder - -# Linux (Ubuntu) -sudo apt-get remove dnsmasq -sudo vim /etc/resolv.conf -# remove "nameserver 127.0.0.1" -# and ensure you have another -# nameserver specified -# e.g "nameserver 127.0.0.53" -``` - -[docker-url]: https://www.docker.com/ -[dnsmasq-url]: https://linux.die.net/man/8/dnsmasq -[docker-desktop-url]: https://www.docker.com/products/docker-desktop -[docker-k8s-docs]: https://docs.docker.com/desktop/kubernetes/ -[kind-url]: https://kind.sigs.k8s.io/ -[cvm-url]: https://coder.com/docs/workspaces/cvms -[docker-mac-url]: - https://docs.docker.com/docker-for-mac/release-notes/#docker-desktop-community-2501 -[docker-windows-url]: - https://docs.docker.com/docker-for-windows/release-notes/#docker-desktop-community-2501 -[docker-bug-url]: https://github.com/docker/for-mac/issues/5044 -[ngrok-url]: https://ngrok.com -[devurl-url]: https://coder.com/docs/workspaces/devurls -[nip-url]: https://nip.io From 5f4d252b4ababb41140775357ff56e38c9b36282 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 25 May 2022 16:25:02 -0500 Subject: [PATCH 2/2] fix formatting --- manifest.json | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/manifest.json b/manifest.json index b9dc6bc47..1255e0e14 100644 --- a/manifest.json +++ b/manifest.json @@ -1,12 +1,5 @@ { - "versions": [ - "v1.31", - "v1.30", - "v1.29", - "v1.28", - "v1.27", - "v1.26" - ], + "versions": ["v1.31", "v1.30", "v1.29", "v1.28", "v1.27", "v1.26"], "routes": [ { "path": "./index.md", @@ -826,4 +819,4 @@ ] } ] -} \ No newline at end of file +}