-
Notifications
You must be signed in to change notification settings - Fork 59
feat: add Linode instance template with persistent storageLinode template bounty #270
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
+397
β0
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
registry/toti85/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
| Name | Description | Author | Icon | Contact | Website | Official | | ||
| --- | --- | --- | --- | --- | --- | --- | | ||
| Toti85 | Community templates and modules for Coder workspaces | toti85 | ./images/avatar.svg | | https://github.com/toti85 | false | | ||
|
||
# Toti85 | ||
|
||
Community-contributed templates and modules for extending Coder workspaces with additional cloud providers and functionality. |
38 changes: 38 additions & 0 deletions
registry/toti85/templates/linode-linux/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
display_name: Linode Instance (Linux) | ||
description: Provision Linode instances as Coder workspaces | ||
icon: ../../../../.icons/cloud.svg | ||
verified: false | ||
tags: [vm, linux, linode] | ||
--- | ||
|
||
# Remote Development on Linode Instances | ||
|
||
Provision Linode instances as [Coder workspaces](https://coder.com/docs/workspaces) with this example template. | ||
|
||
<!-- TODO: Add screenshot --> | ||
|
||
## Prerequisites | ||
|
||
To deploy workspaces as Linode instances, you'll need: | ||
|
||
- Linode [personal access token (PAT)](https://www.linode.com/docs/products/tools/api/guides/manage-api-tokens/) | ||
|
||
### Authentication | ||
|
||
This template assumes that the Coder Provisioner is run in an environment that is authenticated with Linode. | ||
|
||
Obtain a [Linode Personal Access Token](https://cloud.linode.com/profile/tokens) and set the `LINODE_TOKEN` environment variable to the access token. | ||
For other ways to authenticate [consult the Terraform provider's docs](https://registry.terraform.io/providers/linode/linode/latest/docs). | ||
|
||
## Architecture | ||
|
||
This template provisions the following resources: | ||
|
||
- Linode instance (ephemeral, deleted on stop) | ||
- Linode volume (persistent, mounted to `/home/coder`) | ||
|
||
This means, when the workspace restarts, any tools or files outside of the home directory are not persisted. To pre-bake tools into the workspace (e.g. `python3`), modify the VM image, or use a [startup script](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/script). | ||
|
||
> [!NOTE] | ||
> This template is designed to be a starting point! Edit the Terraform to extend the template to support your use case. |
46 changes: 46 additions & 0 deletions
registry/toti85/templates/linode-linux/cloud-config.yaml.tftpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#cloud-config | ||
users: | ||
- name: ${username} | ||
sudo: ["ALL=(ALL) NOPASSWD:ALL"] | ||
groups: sudo | ||
shell: /bin/bash | ||
packages: | ||
- git | ||
mounts: | ||
- [ | ||
"LABEL=${home_volume_label}", | ||
"/home/${username}", | ||
auto, | ||
"defaults,uid=1000,gid=1000", | ||
] | ||
write_files: | ||
- path: /opt/coder/init | ||
permissions: "0755" | ||
encoding: b64 | ||
content: ${init_script} | ||
- path: /etc/systemd/system/coder-agent.service | ||
permissions: "0644" | ||
content: | | ||
[Unit] | ||
Description=Coder Agent | ||
After=network-online.target | ||
Wants=network-online.target | ||
|
||
[Service] | ||
User=${username} | ||
ExecStart=/opt/coder/init | ||
Environment=CODER_AGENT_TOKEN=${coder_agent_token} | ||
Restart=always | ||
RestartSec=10 | ||
TimeoutStopSec=90 | ||
KillMode=process | ||
|
||
OOMScoreAdjust=-900 | ||
SyslogIdentifier=coder-agent | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
runcmd: | ||
- chown ${username}:${username} /home/${username} | ||
- systemctl enable coder-agent | ||
- systemctl start coder-agent |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.