Skip to content

Commit ee294e2

Browse files
committed
🐛 Change nodeName with nodeSelector
1 parent 11c2b77 commit ee294e2

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ $ cuber info
7272

7373
Check out the [Cuberfile configuration](https://cuber.cloud/docs/cuberfile) and the [Cuber CLI commands](https://cuber.cloud/docs/cli) for more information.
7474

75+
## Node Pool Keys
76+
GKE: cloud.google.com/gke-nodepool
77+
Digital Ocean: doks.digitalocean.com/node-pool
78+
7579
## Production-ready
7680

7781
Cuber has been used in production for [Pushpad](https://pushpad.xyz) for over a year and it is stable and reliable.
@@ -85,4 +89,3 @@ Cuber is released under the [Apache-2.0 license](https://opensource.org/licenses
8589
## Learn more
8690

8791
You can find more information and documentation on [cuber.cloud](https://cuber.cloud).
88-

lib/cuber/cuberfile_parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def migrate cmd, check: nil
6565
@migrate = { cmd: cmd, check: check }
6666
end
6767

68-
def proc name, cmd, scale: 1, cpu: nil, ram: nil, term: 60, env: {}, node_name: nil
69-
@procs[name] = { cmd: cmd, scale: scale, cpu: cpu, ram: ram, term: term, env: env, node_name: node_name }
68+
def proc name, cmd, scale: 1, cpu: nil, ram: nil, term: 60, env: {}, node_pool_key: nil, node_pool_name: nil
69+
@procs[name] = { cmd: cmd, scale: scale, cpu: cpu, ram: ram, term: term, env: env, node_pool_key: node_pool_key, node_pool_name: node_pool_name }
7070
end
7171

7272
def cron name, schedule, cmd

lib/cuber/templates/deployment.yml.erb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ spec:
149149
app.kubernetes.io/managed-by: cuber
150150
app: <%= procname %>-proc
151151
spec:
152-
<%- if proc[:node_name] -%>
153-
nodeName: <%= proc[:node_name]%>
152+
<%- if proc[:node_pool_key] && proc[:node_pool_name] -%>
153+
nodeSelector:
154+
<%= proc[:node_pool_key] %>: <%= proc[:node_pool_name]%>
154155
<%- end -%>
155156
containers:
156157
- name: <%= procname %>-proc

0 commit comments

Comments
 (0)