Skip to content

Commit fa60b7c

Browse files
committed
Upload coder templates
1 parent bc14264 commit fa60b7c

File tree

20 files changed

+3221
-0
lines changed

20 files changed

+3221
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
terraform {
2+
required_providers {
3+
coder = {
4+
source = "coder/coder"
5+
version = "~> 0.7.0"
6+
}
7+
kubernetes = {
8+
source = "hashicorp/kubernetes"
9+
version = "~> 2.18"
10+
}
11+
}
12+
}
13+
14+
provider "coder" {}
15+
16+
provider "kubernetes" {
17+
config_path = null # always use host
18+
}
19+
20+
data "coder_workspace" "me" {}
21+
22+
resource "coder_agent" "main" {
23+
os = "linux"
24+
arch = "amd64"
25+
startup_script_timeout = 180
26+
startup_script = ""
27+
}
28+
29+
resource "kubernetes_pod" "main" {
30+
count = data.coder_workspace.me.start_count
31+
metadata {
32+
name = "coder-${lower(data.coder_workspace.me.owner)}-${lower(data.coder_workspace.me.name)}"
33+
namespace = "coder-big"
34+
labels = {
35+
"app.kubernetes.io/name" = "coder-workspace"
36+
"app.kubernetes.io/instance" = "coder-workspace-${lower(data.coder_workspace.me.owner)}-${lower(data.coder_workspace.me.name)}"
37+
}
38+
}
39+
spec {
40+
security_context {
41+
run_as_user = "1000"
42+
fs_group = "1000"
43+
}
44+
container {
45+
name = "dev"
46+
image = "docker.io/codercom/enterprise-minimal:ubuntu"
47+
image_pull_policy = "Always"
48+
command = ["sh", "-c", coder_agent.main.init_script]
49+
security_context {
50+
run_as_user = "1000"
51+
}
52+
env {
53+
name = "CODER_AGENT_TOKEN"
54+
value = coder_agent.main.token
55+
}
56+
resources {
57+
requests = {
58+
"cpu" = "4"
59+
"memory" = "4Gi"
60+
}
61+
limits = {
62+
"cpu" = "4"
63+
"memory" = "4Gi"
64+
}
65+
}
66+
}
67+
68+
affinity {
69+
node_affinity {
70+
required_during_scheduling_ignored_during_execution {
71+
node_selector_term {
72+
match_expressions {
73+
key = "cloud.google.com/gke-nodepool"
74+
operator = "In"
75+
values = ["big-workspaces"]
76+
}
77+
}
78+
}
79+
}
80+
}
81+
}
82+
}
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
terraform {
2+
required_providers {
3+
coder = {
4+
source = "coder/coder"
5+
version = "~> 0.7.0"
6+
}
7+
kubernetes = {
8+
source = "hashicorp/kubernetes"
9+
version = "~> 2.18"
10+
}
11+
}
12+
}
13+
14+
provider "coder" {}
15+
16+
provider "kubernetes" {
17+
config_path = null # always use host
18+
}
19+
20+
data "coder_workspace" "me" {}
21+
22+
resource "coder_agent" "main" {
23+
os = "linux"
24+
arch = "amd64"
25+
startup_script_timeout = 180
26+
startup_script = ""
27+
28+
# Greedy metadata (3072 bytes base64 encoded is 4097 bytes).
29+
metadata {
30+
display_name = "Meta 01"
31+
key = "01_meta"
32+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
33+
interval = 1
34+
timeout = 10
35+
}
36+
metadata {
37+
display_name = "Meta 02"
38+
key = "0_meta"
39+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
40+
interval = 1
41+
timeout = 10
42+
}
43+
metadata {
44+
display_name = "Meta 03"
45+
key = "03_meta"
46+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
47+
interval = 1
48+
timeout = 10
49+
}
50+
metadata {
51+
display_name = "Meta 04"
52+
key = "04_meta"
53+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
54+
interval = 1
55+
timeout = 10
56+
}
57+
metadata {
58+
display_name = "Meta 05"
59+
key = "05_meta"
60+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
61+
interval = 1
62+
timeout = 10
63+
}
64+
metadata {
65+
display_name = "Meta 06"
66+
key = "06_meta"
67+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
68+
interval = 1
69+
timeout = 10
70+
}
71+
metadata {
72+
display_name = "Meta 07"
73+
key = "07_meta"
74+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
75+
interval = 1
76+
timeout = 10
77+
}
78+
metadata {
79+
display_name = "Meta 08"
80+
key = "08_meta"
81+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
82+
interval = 1
83+
timeout = 10
84+
}
85+
metadata {
86+
display_name = "Meta 09"
87+
key = "09_meta"
88+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
89+
interval = 1
90+
timeout = 10
91+
}
92+
metadata {
93+
display_name = "Meta 10"
94+
key = "10_meta"
95+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
96+
interval = 1
97+
timeout = 10
98+
}
99+
metadata {
100+
display_name = "Meta 11"
101+
key = "11_meta"
102+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
103+
interval = 1
104+
timeout = 10
105+
}
106+
metadata {
107+
display_name = "Meta 12"
108+
key = "12_meta"
109+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
110+
interval = 1
111+
timeout = 10
112+
}
113+
metadata {
114+
display_name = "Meta 13"
115+
key = "13_meta"
116+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
117+
interval = 1
118+
timeout = 10
119+
}
120+
metadata {
121+
display_name = "Meta 14"
122+
key = "14_meta"
123+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
124+
interval = 1
125+
timeout = 10
126+
}
127+
metadata {
128+
display_name = "Meta 15"
129+
key = "15_meta"
130+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
131+
interval = 1
132+
timeout = 10
133+
}
134+
metadata {
135+
display_name = "Meta 16"
136+
key = "16_meta"
137+
script = "dd if=/dev/urandom bs=3072 count=1 status=none | base64"
138+
interval = 1
139+
timeout = 10
140+
}
141+
}
142+
143+
resource "kubernetes_pod" "main" {
144+
count = data.coder_workspace.me.start_count
145+
metadata {
146+
name = "coder-${lower(data.coder_workspace.me.owner)}-${lower(data.coder_workspace.me.name)}"
147+
namespace = "coder-big"
148+
labels = {
149+
"app.kubernetes.io/name" = "coder-workspace"
150+
"app.kubernetes.io/instance" = "coder-workspace-${lower(data.coder_workspace.me.owner)}-${lower(data.coder_workspace.me.name)}"
151+
}
152+
}
153+
spec {
154+
security_context {
155+
run_as_user = "1000"
156+
fs_group = "1000"
157+
}
158+
container {
159+
name = "dev"
160+
image = "docker.io/codercom/enterprise-minimal:ubuntu"
161+
image_pull_policy = "Always"
162+
command = ["sh", "-c", coder_agent.main.init_script]
163+
security_context {
164+
run_as_user = "1000"
165+
}
166+
env {
167+
name = "CODER_AGENT_TOKEN"
168+
value = coder_agent.main.token
169+
}
170+
resources {
171+
requests = {
172+
"cpu" = "2"
173+
"memory" = "2Gi"
174+
}
175+
limits = {
176+
"cpu" = "2"
177+
"memory" = "2Gi"
178+
}
179+
}
180+
}
181+
182+
affinity {
183+
node_affinity {
184+
required_during_scheduling_ignored_during_execution {
185+
node_selector_term {
186+
match_expressions {
187+
key = "cloud.google.com/gke-nodepool"
188+
operator = "In"
189+
values = ["big-workspaces"]
190+
}
191+
}
192+
}
193+
}
194+
}
195+
}
196+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
terraform {
2+
required_providers {
3+
coder = {
4+
source = "coder/coder"
5+
version = "~> 0.7.0"
6+
}
7+
kubernetes = {
8+
source = "hashicorp/kubernetes"
9+
version = "~> 2.18"
10+
}
11+
}
12+
}
13+
14+
provider "coder" {}
15+
16+
provider "kubernetes" {
17+
config_path = null # always use host
18+
}
19+
20+
data "coder_workspace" "me" {}
21+
22+
resource "coder_agent" "main" {
23+
os = "linux"
24+
arch = "amd64"
25+
startup_script_timeout = 180
26+
startup_script = ""
27+
}
28+
29+
resource "kubernetes_pod" "main" {
30+
count = data.coder_workspace.me.start_count
31+
metadata {
32+
name = "coder-${lower(data.coder_workspace.me.owner)}-${lower(data.coder_workspace.me.name)}"
33+
namespace = "coder-big"
34+
labels = {
35+
"app.kubernetes.io/name" = "coder-workspace"
36+
"app.kubernetes.io/instance" = "coder-workspace-${lower(data.coder_workspace.me.owner)}-${lower(data.coder_workspace.me.name)}"
37+
}
38+
}
39+
spec {
40+
security_context {
41+
run_as_user = "1000"
42+
fs_group = "1000"
43+
}
44+
container {
45+
name = "dev"
46+
image = "docker.io/codercom/enterprise-minimal:ubuntu"
47+
image_pull_policy = "Always"
48+
command = ["sh", "-c", coder_agent.main.init_script]
49+
security_context {
50+
run_as_user = "1000"
51+
}
52+
env {
53+
name = "CODER_AGENT_TOKEN"
54+
value = coder_agent.main.token
55+
}
56+
resources {
57+
requests = {
58+
"cpu" = "2"
59+
"memory" = "2Gi"
60+
}
61+
limits = {
62+
"cpu" = "2"
63+
"memory" = "2Gi"
64+
}
65+
}
66+
}
67+
68+
affinity {
69+
node_affinity {
70+
required_during_scheduling_ignored_during_execution {
71+
node_selector_term {
72+
match_expressions {
73+
key = "cloud.google.com/gke-nodepool"
74+
operator = "In"
75+
values = ["big-workspaces"]
76+
}
77+
}
78+
}
79+
}
80+
}
81+
}
82+
}

0 commit comments

Comments
 (0)