Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add examples/templates/do-linux for Digital Ocean Droplets#1749

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mafredri merged 13 commits intomainfrommafredri/example-digital-ocean-droplet
May 27, 2022

Conversation

mafredri
Copy link
Member

@mafredrimafredri commentedMay 25, 2022
edited
Loading

This PR adds an example that provisions workspaces as Digital Ocean Droplets and mounts a persistent volume for the users (coder) home directory.

I wanted to provision the workspaces in a specified Digital Ocean Project, but due to terraform detecting this as two workspace volumes, there's a side-effect of not being able to SSH into the workspace.

For now, the project specification is commented out:

# resource "digitalocean_project_resources" "project" {#   project = var.step2_do_project_id#   # Workaround for terraform plan when using count.#   resources = length(digitalocean_droplet.workspace) > 0 ? [#     digitalocean_volume.home_volume.urn,#     digitalocean_droplet.workspace[0].urn#     ] : [#     digitalocean_volume.home_volume.urn#   ]# }

See#1750 for details on the issue.

@@ -0,0 +1,46 @@
#cloud-config
users:
- name: coder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We could even make the username their Coder username 👀

mafredri reacted with heart emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Oh I love that!

kylecarbs reacted with hooray emoji
@mafredrimafredriforce-pushed themafredri/example-digital-ocean-droplet branch fromaa51940 to8d73582CompareMay 25, 2022 17:30
@coadler
Copy link
Contributor

Super small nit, butdo-droplet seems slightly redundant. For the other clouds we havegcp-linux,aws-linux, etc instead ofgcp-gce-linux andaws-ec2-linux.

kylecarbs reacted with thumbs up emoji

@mafredri
Copy link
MemberAuthor

@coadler My motivation for usingdroplet was that DO offers managed k8s as well, and if we'd want to have one for that as well, what would we call it? I'm OK with making the change though.

@coadler
Copy link
Contributor

This is true for the other clouds too though. Maybe we should have subfolders for each cloud? Don't mean to derail this at all, just thinking out loud!

@mafredri
Copy link
MemberAuthor

Good point. How about I make the change here to standard naming scheme, then we can consolidate later? At the risk of bike-shedding, I do kind of like that the name explains exactly what it is since the name is often inherited from the folder name. So we'd havegcp-gce-linux instead ofgce-linux (viagcp/gce-linux).

coadler reacted with thumbs up emoji

@coadler
Copy link
Contributor

Works for me!

description = "Which Droplet image would you like to use for your workspace?"
default = "ubuntu-22-04-x64"
validation {
condition = contains(["ubuntu-22-04-x64", "ubuntu-20-04-x64", "fedora-36-x64", "fedora-35-x64", "debian-11-x64", "debian-10-x64", "centos-stream-9-x64", "centos-stream-8-x64", "rockylinux-8-x64", "rockylinux-8-4-x64"], var.droplet_image)
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I wanted to conditionally include Fedora images based on if SSH key is set, but it's not possible, unfortunately :/hashicorp/terraform#25609

Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looking great!

Co-authored-by: Cian Johnston <cian@coder.com>
@mafredri
Copy link
MemberAuthor

Right now we leave the SSH server running on the Droplet. I think this is OK, if someone doesn't want that, they can edit thecloud-config to disable it. Or should it be an option?

With the last commit (08483d8) we could in theory use remote-exec instead of cloud-config (when SSH key is provided). But perhaps that could be left for an alternative implementation of this template.

@mafredrimafredri marked this pull request as ready for reviewMay 27, 2022 12:01
@mafredrimafredri changed the titlefeat: Add examples/do-droplet-linux for Digital Ocean Dropletsfeat: Add examples/templates/do-linux for Digital Ocean DropletsMay 27, 2022
@mafredrimafredri merged commit1a70298 intomainMay 27, 2022
@mafredrimafredri deleted the mafredri/example-digital-ocean-droplet branchMay 27, 2022 17:04
kylecarbs pushed a commit that referenced this pull requestJun 10, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

@kylecarbskylecarbskylecarbs approved these changes

Assignees

@mafredrimafredri

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@mafredri@coadler@johnstcn@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp