Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
331ce706
Commit
331ce706
authored
May 17, 2024
by
Nikos Pitsillos
Committed by
Manuel Buil
May 28, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve tailscale test & add extra log in e2e tests
Signed-off-by:
Manuel Buil
<
mbuil@suse.com
>
parent
d53cf93a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
Vagrantfile
tests/e2e/tailscale/Vagrantfile
+15
-3
tailscale_test.go
tests/e2e/tailscale/tailscale_test.go
+2
-1
testutils.go
tests/e2e/testutils.go
+1
-0
No files found.
tests/e2e/tailscale/Vagrantfile
View file @
331ce706
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,25 @@ def provision(vm, roles, role_num, node_num)
end
end
if
roles
.
include?
(
"agent"
)
vpn_auth
=
nil
vpn_auth_method
=
nil
auth_info
=
"name=tailscale,joinKey=
#{
TAILSCALE_KEY
}
"
if
role_num
==
0
vpn_auth_method
=
"vpn-auth"
vpn_auth
=
auth_info
else
vpn_auth_method
=
"vpn-auth-file"
File
.
write
(
"./vpn-auth-file"
,
auth_info
)
vm
.
provision
"file"
,
source:
"./vpn-auth-file"
,
destination:
"/home/vagrant/vpn-auth-file"
vpn_auth
=
"/home/vagrant/vpn-auth-file"
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
...
...
tests/e2e/tailscale/tailscale_test.go
View file @
331ce706
...
...
@@ -14,7 +14,7 @@ import (
// Valid nodeOS: generic/ubuntu2310, opensuse/Leap-15.3.x86_64
var
nodeOS
=
flag
.
String
(
"nodeOS"
,
"generic/ubuntu2310"
,
"VM operating system"
)
var
serverCount
=
flag
.
Int
(
"serverCount"
,
1
,
"number of server nodes"
)
var
agentCount
=
flag
.
Int
(
"agentCount"
,
1
,
"number of agent nodes"
)
var
agentCount
=
flag
.
Int
(
"agentCount"
,
2
,
"number of agent nodes"
)
var
ci
=
flag
.
Bool
(
"ci"
,
false
,
"running on CI"
)
var
local
=
flag
.
Bool
(
"local"
,
false
,
"deploy a locally built K3s binary"
)
...
...
@@ -82,6 +82,7 @@ var _ = Describe("Verify Tailscale Configuration", Ordered, func() {
Eventually
(
func
(
g
Gomega
)
{
nodes
,
err
:=
e2e
.
ParseNodes
(
kubeConfigFile
,
false
)
g
.
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
g
.
Expect
(
len
(
nodes
))
.
To
(
Equal
(
*
agentCount
+
*
serverCount
))
for
_
,
node
:=
range
nodes
{
g
.
Expect
(
node
.
Status
)
.
Should
(
Equal
(
"Ready"
))
}
...
...
tests/e2e/testutils.go
View file @
331ce706
...
...
@@ -121,6 +121,7 @@ func CreateCluster(nodeOS string, serverCount, agentCount int) ([]string, []stri
errg
,
_
:=
errgroup
.
WithContext
(
context
.
Background
())
for
_
,
node
:=
range
append
(
serverNodeNames
[
1
:
],
agentNodeNames
...
)
{
cmd
:=
fmt
.
Sprintf
(
`%s %s vagrant up %s &>> vagrant.log`
,
nodeEnvs
,
testOptions
,
node
)
fmt
.
Println
(
cmd
)
errg
.
Go
(
func
()
error
{
if
_
,
err
:=
RunCommand
(
cmd
);
err
!=
nil
{
return
newNodeError
(
cmd
,
node
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment