Skip to content

docs: restructure docs #14182

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

Closed
wants to merge 96 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
13d4f56
docs offsite day 1
bpmct May 22, 2024
3cf73ed
updated coder tour and screenshots
stirby May 23, 2024
5bcaf81
edit manifest
bpmct May 23, 2024
e97dcba
incomplete info on schedule
stirby May 23, 2024
1352640
changes
bpmct May 23, 2024
56ef29e
rebase on `main`
matifali Aug 6, 2024
d9b2b76
removed stub on coder tour
stirby May 23, 2024
de4599c
workspace README page and tour cleanup
stirby May 23, 2024
2c277df
fixed tour MD linksg
stirby May 23, 2024
ad4bb0c
replaced broken pngs
stirby May 23, 2024
920ac48
moved workspace access to a directory
stirby May 23, 2024
133721a
rebase on `main`
matifali Aug 6, 2024
762b680
workspace access docs
stirby May 23, 2024
f74f54d
user guides manifest
stirby May 23, 2024
eab79b3
rebase on `main`
matifali Aug 6, 2024
af700c3
vscode
stirby May 23, 2024
442b6fd
add schedule
bpmct May 23, 2024
c4de546
title case for user guides
stirby May 24, 2024
248bbc2
workspace scheduling
stirby May 24, 2024
48bdc86
added workspace updating to main user guide
stirby May 24, 2024
39185ed
dotfiles page done
stirby May 24, 2024
0cc2d32
fleshed out vscode page
stirby May 24, 2024
bec25cb
weekend
stirby May 26, 2024
79ee974
templates
bpmct May 24, 2024
a3f2e84
integrations
stirby May 26, 2024
c0784a4
removed other platforms page
stirby May 26, 2024
1753902
cleanup
stirby May 29, 2024
90d92e1
some reorg and writing
bpmct May 27, 2024
03f5a93
migrated guides to tutorials
stirby May 30, 2024
ee2c576
infrastructure landing page
bpmct Jun 8, 2024
2dcf91e
add guide for creating templates
bpmct Jun 8, 2024
1907108
new format
bpmct Jun 8, 2024
1215e22
consider linking to tf
bpmct Jun 8, 2024
ca1a458
install landing page
bpmct Jun 8, 2024
9b55009
post pto sync
stirby Jun 12, 2024
6267964
in flight admin-workspace changes
stirby Jun 12, 2024
13716a1
fixing images in about page
stirby Jun 12, 2024
17fcea1
reference/cli proper structure
bpmct Jun 15, 2024
fc159ce
rebase on `main`
matifali Aug 6, 2024
330132b
rebase on `main`
matifali Aug 6, 2024
1efad16
fixups for cli and api gen
bpmct Jun 15, 2024
215a3ac
modify to look for Command Line nested in manifest
bpmct Jun 15, 2024
0041e8c
rebase on `main`
matifali Aug 6, 2024
822130a
wip
matifali Aug 6, 2024
293e07c
wip
matifali Aug 6, 2024
259668b
add screenshots
bpmct Jun 15, 2024
bcfe8ba
workspace lifecycle WIP
stirby Jun 20, 2024
dd73049
added workspace lifecycle to manifest for preview
stirby Jun 20, 2024
d6f2a8c
moved resource definition outside of user guides
stirby Jun 20, 2024
15592cb
fixed manifext typo
stirby Jun 20, 2024
875274d
rough draft of workspace lifecycle
stirby Jun 20, 2024
ce0cd54
cleaned up user guide for workspace scheduling
stirby Jun 20, 2024
d47245b
linked workspace scheduling guide in workspace lifecycle
stirby Jun 20, 2024
bc7db22
started 'extending templates' rearranged resource persistence
stirby Jun 22, 2024
2da48b9
copied secrets.md under admin/security
stirby Jun 24, 2024
5d07ed9
wip
matifali Aug 6, 2024
1235238
partial completion of admin/templates/extending-templates
stirby Jun 24, 2024
22c4a55
additional extending templates refactors
stirby Jun 24, 2024
8add1d7
finished 'extending templates' with variables.md from old docs
stirby Jun 24, 2024
51365cd
added manifest for extending templates
stirby Jun 24, 2024
3a46ccd
added secrets to manifest
stirby Jun 24, 2024
6c269eb
added FAQs as a subsection of guides. Going to keep them for now.
stirby Jul 19, 2024
9ac4f3f
migrated networking docs
stirby Jul 19, 2024
cf13803
added control plane configuration docs
stirby Jul 19, 2024
4098a8c
add integration guides
matifali Aug 6, 2024
34b2ed6
fix manifest
matifali Aug 6, 2024
5ca11b0
fmt and typos
matifali Aug 6, 2024
1447aea
fixup!
matifali Aug 6, 2024
d00cc9b
fix some links
matifali Aug 6, 2024
cafa035
fixup!
matifali Aug 6, 2024
7963a1a
`make fmt`
matifali Aug 6, 2024
aa7d43c
`make gen`
matifali Aug 6, 2024
adfc34c
`make fmt`
matifali Aug 6, 2024
1d21c9a
fixup!
matifali Aug 6, 2024
5f5b3d9
fix capitalization
matifali Aug 6, 2024
4e43821
add scaling to manifest
matifali Aug 6, 2024
0d20438
fix link
matifali Aug 6, 2024
0763b35
rebase on `main`
matifali Aug 7, 2024
bf5535c
rebase on `main`
matifali Aug 7, 2024
2e4b218
fmt and typos
matifali Aug 6, 2024
0996219
`make fmt`
matifali Aug 7, 2024
990d440
`make gen`
matifali Aug 7, 2024
66ff05e
chore: bump github.com/ory/dockertest/v3 from 3.10.0 to 3.11.0 (#14237)
dependabot[bot] Aug 12, 2024
3b099fd
added workspace proxies from lost branch
stirby Aug 13, 2024
2f14a08
chore(docs): move scaling docs under admin/infrastructure (#14270)
stirby Aug 15, 2024
ad16573
chore(docs): add WebRDP to restructure docs (#14385)
stirby Aug 21, 2024
579778e
wip
matifali Aug 22, 2024
e8eb3e4
fixup!
matifali Aug 22, 2024
4b9c2c6
fmt
matifali Aug 22, 2024
01707ec
add snap
matifali Aug 22, 2024
e034239
fixup!
matifali Aug 22, 2024
c021161
fix IDEs mess
matifali Aug 22, 2024
3ef9932
fmt
matifali Aug 23, 2024
d3b4b78
link change management
matifali Aug 23, 2024
18a498d
add terraform modules
matifali Aug 23, 2024
801d4fa
delete filebrowser
matifali Aug 23, 2024
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
Prev Previous commit
Next Next commit
add guide for creating templates
  • Loading branch information
bpmct authored and matifali committed Aug 12, 2024
commit 2dcf91e3a402811e014751ecc38de30e2096c448
2 changes: 2 additions & 0 deletions docs/admin/monitoring/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Monitoring Coder

ssss
46 changes: 16 additions & 30 deletions docs/admin/templates/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,27 @@
# Template Management
# Template

Templates define the underlying infrastructure that Coder workspaces run on. All workspaces are created from templates.
Templates are written in [Terraform](https://developer.hashicorp.com/terraform/intro) and define the underlying infrastructure that all Coder workspaces run on.

## Creating templates
![Starter templates](../../images/admin/templates/starter-templates.png)

The following are tutorials on creating templates in Coder for various platforms
<small>The "Starter Templates" page within the Coder dashboard.</small>

<!-- TODO: Use the tutorials widget component -->
## Getting Started

- [From scratch](../../tutorials/template-from-scratch.md)
- Kubernetes
- GCP Compute Engine
- AWS EC2
- Azure
- Template Registry
Learn the underlying concepts by [creating your first template](../../tutorials/template-from-scratch.md). After that, visit the [Coder Registry](https://registry.coder.com/templates) to learn how to install example templates for various cloud providers and platforms (e.g. AWS, Kubernetes).

## Best practices
## Best Practices

Learn about best practices running templates
We recommend starting with a universal template that can be used for basic tasks. As your Coder deployment grows, you can create more templates to meet the needs of different teams.

- [Image Management](../../tutorials/image-management.md)
- Dev Container support
- Protecting resources (user disks)
- Manage templates with Ci/Cd pipelines
- [Image management](../../tutorials/image-management.md): Learn how to create and publish images for use within Coder workspaces & templates.
- [Dev Container support](#): Enable dev containers to allow teams to bring their own tools into Coder workspaces.
- [Template hardening](./): Configure your template to prevent certain resources from being destroyed (e.g. user disks).
- [Manage templates with Ci/Cd pipelines](#): Learn how to source control your templates and use GitOps to ensure template changes are reviewed and tested.

## Workspace Lifecycle
## Template Features

- Keep workspaces up to date
- Clean up unused workspaces
- Stop workspaces when not in use
## Template Settings

## Concepts

- Variables
- Parameters
- Resource Persistance
- Modules
- Resource metadata
- Resource ordering
- Agent metadata
- [Template Permissions]()
- [Display name]
9 changes: 0 additions & 9 deletions docs/admin/templates/best-practices.md

This file was deleted.

165 changes: 103 additions & 62 deletions docs/admin/templates/creating-templates.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,134 @@
# Working with templates
# Creating Templates

You create and edit Coder templates as [Terraform](./tour.md) configuration
files (`.tf`) and any supporting files, like a README or configuration files for
other services.
Users with the `Template Administrator` role or above can create templates
within Coder.

## Who creates templates?
## From a starter template

The [Template Admin](../admin/users.md) role (and above) can create templates.
End users, like developers, create workspaces from them. Templates can also be
[managed with git](./change-management.md), allowing any developer to propose
changes to a template.
In most cases, it is best to start with a starter template.

You can give different users and groups access to templates with
[role-based access control](../admin/rbac.md).
<div class="tabs">

## Starter templates
### Web UI

We provide starter templates for common cloud providers, like AWS, and
orchestrators, like Kubernetes. From there, you can modify them to use your own
images, VPC, cloud credentials, and so on. Coder supports all Terraform
resources and properties, so fear not if your favorite cloud provider isn't
here!
After navigating to the Templates page in the Coder dashboard, choose
`Create Template > Choose a starter template`.

![Starter templates](../../images/templates/starter-templates.png)
![Create a template](../../images/admin/templates/create-template.png)

If you prefer to use Coder on the [command line](../cli.md), use
`coder templates init`.
From there, select a starter template for desired underlying infrastructure for
workspaces.

> Coder starter templates are also available on our
> [GitHub repo](https://github.com/coder/coder/tree/main/examples/templates).
![Starter templates](../../images/admin/templates/starter-templates.png)

## Community Templates
Give your template a name, description, and icon and press `Create template`.

As well as Coder's starter templates, you can see a list of community templates
by our users
[here](https://github.com/coder/coder/blob/main/examples/templates/community-templates.md).
![Name and icon](../../images/admin/templates/import-template.png)

## Editing templates
> **⚠️ Note**: If template creation fails, Coder is likely not authorized to
> deploy infrastructure in the given location. Learn how to configure
> [provisioner authentication](#TODO).

Our starter templates are meant to be modified for your use cases. You can edit
any template's files directly in the Coder dashboard.
### CLI

![Editing a template](../../images/templates/choosing-edit-template.gif)
You can the [Coder CLI](../../install/cli.md) to manage templates for Coder.
After [logging in](#TODO) to your deployment, create a folder to store your
templates:

If you'd prefer to use the CLI, use `coder templates pull`, edit the template
files, then `coder templates push`.

> Even if you are a Terraform expert, we suggest reading our
> [guided tour](./tour.md).
```sh
# This snippet applies to macOS and Linux only
mkdir $HOME/coder-templates
cd $HOME/coder-templates
```

## Updating templates
Use the [`templates init`](../../reference/cli/templates_init.md) command to
pull a starter template:

Coder tracks a template's versions, keeping all developer workspaces up-to-date.
When you publish a new version, developers are notified to get the latest
infrastructure, software, or security patches. Learn more about
[change management](./change-management.md).
```sh
coder templates init
```

![Updating a template](../../images/templates/update.png)
After pulling the template to your local machine (e.g. `aws-linux`), you can
rename it:

## Delete templates
```sh
# This snippet applies to macOS and Linux only
mv aws-linux universal-template
cd universal-template
```

You can delete a template using both the coder CLI and UI. Only
[template admins and owners](../admin/users.md) can delete a template, and the
template must not have any running workspaces associated to it.
Next, push it to Coder with the
[`templates push`](../../reference/cli/templates_push.md) command:

In the UI, navigate to the template you want to delete, and select the dropdown
in the right-hand corner of the page to delete the template.
```sh
coder templates push
```

![delete-template](../../images/delete-template.png)
> ⚠️ Note: If `template push` fails, Coder is likely not authorized to deploy
> infrastructure in the given location. Learn how to configure
> [provisioner authentication](#TODO).

Using the CLI, login to Coder and run the following command to delete a
template:
You can edit the metadata of the template such as the display name with the
[`templates edit`](../../reference/cli/templates_edit.md) command:

```shell
coder templates delete <template-name>
```sh
coder templates edit universal-template \
--display-name "Universal Template" \
--description "Virtual machine configured with Java, Python, Typescript, IntelliJ IDEA, and Ruby. Use this for starter projects. " \
--icon "/emojis/2b50.png"
```

### Delete workspaces
### Git

Follow our tutorial to [manage templates via GitOps](#TODO).

</div>

## From an existing template

You can duplicate an existing template in your Coder deployment. This will copy
the template code and metadata, allowing you to make changes without affecting
the original template.

<div class="tabs">

### Web UI

After navigating to the page for a template, use the dropdown menu on the right
to `Duplicate`.

![Duplicate menu](../../images/admin/templates/duplicate-menu.png)

Give the new template a name, icon, and description.

![Duplicate page](../../images/admin/templates/duplicate-page.png)

Press `Create template`. After the build, you will be taken to the new template
page.

![New template](../../images/admin/templates/new-duplicate-template.png)

### CLI

</div>

## From scratch (advanced)

There may be cases where you want to create a template from scratch. You can use
[any Terraform provider](https://registry.terraform.com) with Coder to create
templates for additional clouds (e.g. Hetzner, Alibaba) or orchestrators
(VMware, Proxmox) that we do not provide example templates for.

When a workspace is deleted, the Coder server essentially runs a
[terraform destroy](https://www.terraform.io/cli/commands/destroy) to remove all
resources associated with the workspace.
Refer to the following resources:

> Terraform's
> [prevent-destroy](https://www.terraform.io/language/meta-arguments/lifecycle#prevent_destroy)
> and
> [ignore-changes](https://www.terraform.io/language/meta-arguments/lifecycle#ignore_changes)
> meta-arguments can be used to prevent accidental data loss.
- [Tutorial: Create a template from scratch](../../tutorials/template-from-scratch.md)
- [Extending templates](./editing-templates.md): Features and concepts around
templates (agents, parameters, variables, etc)
- [Coder Registry](https://registry.coder.com/templates): Official and community
templates for Coder
- [Coder Terraform Provider Reference](https://registry.terraform.io/providers/coder/coder)

## Next steps

- [Your first template](../templates/tutorial.md)
- [Extending templates](#TODO)
- [TODO](#TODO)
93 changes: 93 additions & 0 deletions docs/admin/templates/managing-templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Working with templates

You create and edit Coder templates as [Terraform](./tour.md) configuration
files (`.tf`) and any supporting files, like a README or configuration files for
other services.

## Who creates templates?

The [Template Admin](../admin/users.md) role (and above) can create templates.
End users, like developers, create workspaces from them. Templates can also be
[managed with git](./change-management.md), allowing any developer to propose
changes to a template.

You can give different users and groups access to templates with
[role-based access control](../admin/rbac.md).

## Starter templates

We provide starter templates for common cloud providers, like AWS, and
orchestrators, like Kubernetes. From there, you can modify them to use your own
images, VPC, cloud credentials, and so on. Coder supports all Terraform
resources and properties, so fear not if your favorite cloud provider isn't
here!

![Starter templates](../../images/templates/starter-templates.png)

If you prefer to use Coder on the [command line](../cli.md), use
`coder templates init`.

> Coder starter templates are also available on our
> [GitHub repo](https://github.com/coder/coder/tree/main/examples/templates).

## Community Templates

As well as Coder's starter templates, you can see a list of community templates
by our users
[here](https://github.com/coder/coder/blob/main/examples/templates/community-templates.md).

## Editing templates

Our starter templates are meant to be modified for your use cases. You can edit
any template's files directly in the Coder dashboard.

![Editing a template](../../images/templates/choosing-edit-template.gif)

If you'd prefer to use the CLI, use `coder templates pull`, edit the template
files, then `coder templates push`.

> Even if you are a Terraform expert, we suggest reading our
> [guided tour](./tour.md).

## Updating templates

Coder tracks a template's versions, keeping all developer workspaces up-to-date.
When you publish a new version, developers are notified to get the latest
infrastructure, software, or security patches. Learn more about
[change management](./change-management.md).

![Updating a template](../../images/templates/update.png)

## Delete templates

You can delete a template using both the coder CLI and UI. Only
[template admins and owners](../admin/users.md) can delete a template, and the
template must not have any running workspaces associated to it.

In the UI, navigate to the template you want to delete, and select the dropdown
in the right-hand corner of the page to delete the template.

![delete-template](../../images/delete-template.png)

Using the CLI, login to Coder and run the following command to delete a
template:

```shell
coder templates delete <template-name>
```

### Delete workspaces

When a workspace is deleted, the Coder server essentially runs a
[terraform destroy](https://www.terraform.io/cli/commands/destroy) to remove all
resources associated with the workspace.

> Terraform's
> [prevent-destroy](https://www.terraform.io/language/meta-arguments/lifecycle#prevent_destroy)
> and
> [ignore-changes](https://www.terraform.io/language/meta-arguments/lifecycle#ignore_changes)
> meta-arguments can be used to prevent accidental data loss.

## Next steps

- [Your first template](../templates/tutorial.md)
2 changes: 1 addition & 1 deletion docs/admin/users/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Users

By default, Coder is accessible via password authentication. Coder does not recommend using password authentication in production, and recommends using an authentication provider with properly configured multi-factor authentication (MFA). It is your responsibility to ensure the auth provider enforces MFA correctly.
By default, Coder is accessible via password authentication. For production deployments, we recommend using an SSO authentication provider with multi-factor authentication (MFA). It is your responsibility to ensure the auth provider enforces MFA correctly.

## Configuring SSO

Expand Down
Binary file added docs/images/admin/templates/create-template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/admin/templates/duplicate-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/admin/templates/duplicate-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/admin/templates/import-template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
]
},
{
"title": "User Management",
"title": "Users",
"description": "Learn how to manage and audit users",
"path": "./admin/users/README.md",
"children": [
Expand Down Expand Up @@ -209,7 +209,7 @@
"path": "./admin/templates/creating-templates.md"
},
{
"title": "Template Best Practices",
"title": "Managing Templates",
"description": "Learn best practices managing templates",
"path": "./admin/templates/best-practices.md"
},
Expand Down