Commit a8f88aa9 authored by Nikos Pitsillos's avatar Nikos Pitsillos Committed by Manuel Buil

test: add agent with auth file

parent aadec855
ENV['VAGRANT_NO_PARALLEL'] = 'no'
NODE_ROLES = (ENV['E2E_NODE_ROLES'] ||
["server-0", "agent-0" ])
["server-0", "agent-0", "agent-1" ])
NODE_BOXES = (ENV['E2E_NODE_BOXES'] ||
['generic/ubuntu2310', 'generic/ubuntu2310'])
['generic/ubuntu2310', 'generic/ubuntu2310', 'generic/ubuntu2310'])
GITHUB_BRANCH = (ENV['E2E_GITHUB_BRANCH'] || "master")
RELEASE_VERSION = (ENV['E2E_RELEASE_VERSION'] || "")
GOCOVER = (ENV['E2E_GOCOVER'] || "")
......@@ -45,13 +45,21 @@ def provision(vm, roles, role_num, node_num)
end
end
if roles.include?("agent")
vpn_auth = "name=tailscale,joinKey=#{TAILSCALE_KEY}"
vpn_auth_method = nil
if role_num == 0
vpn_auth_method = "vpn-auth"
else
vpn_auth_method = "vpn-auth-file"
File.write("./vpn-auth-file", vpn_auth)
end
vm.provision :k3s, run: 'once' do |k3s|
k3s.config_mode = '0644' # side-step https://github.com/k3s-io/k3s/issues/4321
k3s.args = "agent "
k3s.config = <<~YAML
server: https://TAILSCALEIP:6443
token: vagrant
vpn-auth: "name=tailscale,joinKey=#{TAILSCALE_KEY}"
#{vpn_auth_method}: #{vpn_auth}
YAML
k3s.env = ["K3S_KUBECONFIG_MODE=0644", "INSTALL_K3S_SKIP_START=true", install_type]
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment