docs: update google-cloud-platform docs to use our marketplace image (#9549)
After Width: | Height: | Size: 318 KiB |
After Width: | Height: | Size: 284 KiB |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 166 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 149 KiB |
Before Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 74 KiB |
|
@ -56,7 +56,8 @@ or using the console:
|
|||
```shell
|
||||
ssh ubuntu@<ec2-public-IPv4>
|
||||
sudo vim /etc/coder.d/coder.env # edit config
|
||||
sudo service coder restart # restart Coder
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart coder # restart Coder
|
||||
```
|
||||
|
||||
## Give developers EC2 workspaces (optional)
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
# Google Cloud Platform
|
||||
|
||||
In this guide, you will learn how to deploy the Coder control plane instance and
|
||||
your first template.
|
||||
|
||||
## Requirements
|
||||
|
||||
This guide assumes you have `roles/compute.instanceAdmin.v1` access to your
|
||||
Google Cloud Platform project.
|
||||
|
||||
## Launch a Coder instance from the Google Cloud Marketplace
|
||||
|
||||
We publish an Ubuntu 22.04 VM image with Coder and Docker pre-installed. Search
|
||||
for `Coder v2` in the GCP Marketplace or
|
||||
[use direct link](https://console.cloud.google.com/marketplace/product/coder-enterprise-market-public/coder-v2).
|
||||
|
||||
![Coder on GCP Marketplace](../images/platforms/gcp/marketplace.png)
|
||||
|
||||
Be sure to keep the default firewall options checked so you can connect over
|
||||
HTTP, HTTPS, and SSH.
|
||||
|
||||
We recommend keeping the default instance type (`e2-standard-4`, 4 cores and 16
|
||||
GB memory) if you plan on provisioning Docker containers as workspaces on this
|
||||
VM instance. Keep in mind this platforms is intended for proof-of-concept
|
||||
deployments and you should adjust your infrastructure when preparing for
|
||||
production use. See: [Scaling Coder](../admin/scale.md)
|
||||
|
||||
<video autoplay playsinline loop>
|
||||
<source src="https://github.com/coder/coder/blob/main/docs/images/platforms/gcp/launch.mp4?raw=true" type="video/mp4">
|
||||
Your browser does not support the video tag.
|
||||
</video>
|
||||
|
||||
Be sure to add a keypair so that you can connect over SSH to further
|
||||
[configure Coder](../admin/configure.md).
|
||||
|
||||
After launching the instance, wait 30 seconds and navigate to the public IPv4
|
||||
address. You should be redirected to a public tunnel URL.
|
||||
|
||||
![Coder on GCP Marketplace start](../images/platforms/gcp/start.png)
|
||||
|
||||
That's all! Use the UI to create your first user, template, and workspace. We
|
||||
recommend starting with a Docker template since the instance has Docker
|
||||
pre-installed.
|
||||
|
||||
![Coder Workspace and IDE in GCP VM](../images/platforms/aws/workspace.png)
|
||||
|
||||
## Configuring Coder server
|
||||
|
||||
Coder is primarily configured by server-side flags and environment variables.
|
||||
Given you created or added key-pairs when launching the instance, you can
|
||||
[configure your Coder deployment](../admin/configure.md) by logging in via SSH
|
||||
or using the console:
|
||||
|
||||
```shell
|
||||
ssh ubuntu@<gcp-public-IPv4>
|
||||
sudo vim /etc/coder.d/coder.env # edit config
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart coder # restart Coder
|
||||
```
|
||||
|
||||
## Give developers VM workspaces (optional)
|
||||
|
||||
Instead of running containers on the Coder instance, you can offer developers
|
||||
full VM instances with the
|
||||
[gcp-linux](https://github.com/coder/coder/tree/main/examples/templates/gcp-linux)
|
||||
template.
|
||||
|
||||
Before you can use this template, you must authorize Coder to create VM
|
||||
instances in your GCP project. Follow the instructions in the
|
||||
[gcp-linux template README](https://github.com/coder/coder/tree/main/examples/templates/gcp-linux#authentication)
|
||||
to set up authentication.
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [IDEs with Coder](../ides.md)
|
||||
- [Writing custom templates for Coder](../templates/index.md)
|
||||
- [Configure the Coder server](../admin/configure.md)
|
||||
- [Use your own domain + TLS](../admin/configure.md#tls--reverse-proxy)
|
|
@ -1,145 +0,0 @@
|
|||
# Google Cloud Platform
|
||||
|
||||
In this guide, you will learn how to deploy the Coder control plane instance and
|
||||
your first template.
|
||||
|
||||
## Requirements
|
||||
|
||||
This guide assumes you have `roles/compute.instanceAdmin.v1` access to your
|
||||
Google Cloud Platform project.
|
||||
|
||||
## Setting Up your VM
|
||||
|
||||
If this is the first time you’re creating a VM on this project, you will need to
|
||||
enable the `Compute Engine API`. On the Compute Engine API page, click `enable`
|
||||
and wait for the service to finish connecting.
|
||||
|
||||
<img src="../images/platforms/google-cloud-platform/gcp0.png">
|
||||
|
||||
This will pull up the `Create an Instance` page - name the instance something
|
||||
relevant to this project, following your naming convention of choice. In
|
||||
addition, select a region and zone that is close to your physical location. For
|
||||
this instance, we will use the base suggested image.
|
||||
|
||||
<img src="../images/platforms/google-cloud-platform/gcp1.png">
|
||||
|
||||
Under `Identity and API Access`, click `Allow full access to all Cloud APIs`.
|
||||
Scroll down to `Firewall` and click `Allow HTTPS traffic` and
|
||||
`Allow HTTP traffic`.
|
||||
|
||||
<img src="../images/platforms/google-cloud-platform/gcp2.png">
|
||||
|
||||
Scroll down to the bottom and click `Create` to create and deploy the VM.
|
||||
|
||||
Congrats you’ve created your VM instance!
|
||||
|
||||
## SSH-ing into the VM
|
||||
|
||||
On the Compute Engine Dashboard, click on the VM for this project. Under
|
||||
`Details`, click `SSH` and select `Open in browser window`.
|
||||
|
||||
<img src="../images/platforms/google-cloud-platform/gcp3.png">
|
||||
|
||||
This will give you a terminal into the VM that we will use to install Coder.
|
||||
|
||||
## Install Coder
|
||||
|
||||
In the terminal, run the following command
|
||||
|
||||
```console
|
||||
curl -fsSL https://coder.com/install.sh | sh
|
||||
```
|
||||
|
||||
## Run Coder
|
||||
|
||||
For this tutorial, we will run Coder as a `systemd` service. You can run Coder
|
||||
in
|
||||
[a multitude of different ways](https://coder.com/docs/coder-oss/latest/install).
|
||||
|
||||
First, edit the `coder.env` file to enable `CODER_TUNNEL` by setting the value
|
||||
to true with the following command:
|
||||
|
||||
```console
|
||||
sudo vim /etc/coder.d/coder.env
|
||||
```
|
||||
|
||||
<img src="../images/platforms/google-cloud-platform/gcp4.png">
|
||||
|
||||
Exit vim and run the following command to start Coder as a system service:
|
||||
|
||||
```console
|
||||
sudo systemctl enable --now coder
|
||||
```
|
||||
|
||||
The following command shows the Coder service's logs, including the Access URL.
|
||||
The Access URL will be used to access the Coder control plane.
|
||||
|
||||
```console
|
||||
journalctl -u coder.service -b
|
||||
```
|
||||
|
||||
<img src="../images/platforms/google-cloud-platform/gcp5.png">
|
||||
|
||||
In this instance, Coder can be accessed at the URL
|
||||
`https://fcca2f3bfc9d2e3bf1b9feb50e723448.pit-1.try.coder.app`.
|
||||
|
||||
Copy the URL and run the following command to create the workspace admin:
|
||||
|
||||
```console
|
||||
coder login <url***.try.coder.app>
|
||||
```
|
||||
|
||||
Fill out the prompts and be sure to save use email and password. This is your
|
||||
admin login. Now, you can now access Coder from your local machine by navigating
|
||||
to the `***.try.coder.app` URL and logging in with that same username and
|
||||
password.
|
||||
|
||||
## Creating and Uploading your First Template
|
||||
|
||||
First, run `coder template init` to create your first template. You’ll be given
|
||||
a list of prefabricated templates. This tutorial shows you how to create a Linux
|
||||
based template on GCP.
|
||||
|
||||
<img src="../images/platforms/google-cloud-platform/gcp6.png">
|
||||
|
||||
Select the `Develop in Linux on Google Cloud`, then `cd ./gcp-linux`.
|
||||
|
||||
Run the following command:
|
||||
|
||||
```console
|
||||
coder templates create
|
||||
```
|
||||
|
||||
It will ask for your `project-id`, which you can find on the home page of your
|
||||
GCP Dashboard.
|
||||
|
||||
Given it’s your first time setting up Coder, it may give an error that will look
|
||||
like the following:
|
||||
|
||||
<img src="../images/platforms/google-cloud-platform/gcp7.png">
|
||||
|
||||
In the error message will be a link. In this case, the URL is
|
||||
`https://console.developes.google.com/apis/api/iam.googles.com/overview:?project=1073148106645`.
|
||||
Copy the respective URL from your error message, and visit it via your browser.
|
||||
It may ask you to enable `Identity and Access Management (IAM) API`.
|
||||
|
||||
Click `enable` and wait as the API initializes for your account.
|
||||
|
||||
Once initialized, click create credentials in the upper right-hand corner.
|
||||
Select the `Compute Engine API` from the dropdown, and select `Application Data`
|
||||
under `What data will you be accessing?`. In addition, select
|
||||
`Yes, I’m using one or more` under
|
||||
`Are you planning on using this API with Compute Engine, Kubernetes Engine, App Engine, or Cloud Functions?`.
|
||||
|
||||
<img src="../images/platforms/google-cloud-platform/gcp8.png">
|
||||
|
||||
Back in your GCP terminal, run the `coder templates create` one more time.
|
||||
|
||||
Congrats! You can now create new Linux-based workspaces that use Google Cloud
|
||||
Platform. Go onto your Coder dashboard, build your workspace, and get started
|
||||
coding!
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Learn more about template configuration](../templates/index.md)
|
||||
- [Configure more IDEs](../ides/web-ides.md)
|