Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
add support for setting providerId with custom prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
poblin-orange committed May 14, 2022
1 parent 6081c3e commit 2c5f92f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jobs/k3s-agent/spec
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ properties:
description: (agent/node) Registering kubelet with set of taints.format is key=value:Effect)
default: []

k3s.set-provider-id-prefix:
description: If set, the default provider id (k3s://<instance>-<index> will be set as kubelet arg as <prefix>://<instance>-<index>


## drain options
k3s.drain.kubeconfig:
Expand Down
4 changes: 4 additions & 0 deletions jobs/k3s-agent/templates/bin/ctl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ case $1 in
#adapt kubelet root dir to match bosh fs
export FLAGS="$FLAGS --kubelet-arg=root-dir=/var/vcap/data/k3s-agent/kubelet"

<% if_p('k3s.set-provider-id-prefix') do |prefix| %>
export FLAGS="$FLAGS --kubelet-arg=provider-id=<%= prefix %>://<%= spec.name %>-<%= spec.index %>"
<% end %>


<% if_p('k3s.node-labels') do |value| %>
<% p('k3s.node-labels').each do |label| %>
Expand Down
5 changes: 5 additions & 0 deletions jobs/k3s-server/spec
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ properties:
description: (components) If set, Disable k3s default cloud controller manager


k3s.set-provider-id-prefix:
description: If set, the default provider id (k3s://<instance>-<index> will be set as kubelet arg as <prefix>://<instance>-<index>



## additional label and taints (added to k3s and bosh default labels)
k3s.node-labels:
description: (agent/node) Registering and starting kubelet with set of labels
Expand Down
5 changes: 5 additions & 0 deletions jobs/k3s-server/templates/bin/ctl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ case $1 in
#adapt kubelet root dir to match bosh fs
export FLAGS="$FLAGS --kubelet-arg=root-dir=/var/vcap/data/k3s-server/kubelet"

<% if_p('k3s.set-provider-id-prefix') do |prefix| %>
export FLAGS="$FLAGS --kubelet-arg=provider-id=<%= prefix %>://<%= spec.name %>-<%= spec.index %>"
<% end %>


<% if_p('k3s.disable') do |value| %>
<% p('k3s.disable').each do |components| %>
export FLAGS="$FLAGS --disable <%= components %>"
Expand Down

0 comments on commit 2c5f92f

Please sign in to comment.