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
3307d53f
Unverified
Commit
3307d53f
authored
Apr 18, 2022
by
Derek Nola
Committed by
GitHub
Apr 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E Validation Improvements (#5444)
* Add basic none option EXTERNAL_DB, uses internal sqlite * Move to Leap as default Signed-off-by:
Derek Nola
<
derek.nola@suse.com
>
parent
3e3549e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
Vagrantfile
tests/e2e/splitserver/Vagrantfile
+5
-5
Vagrantfile
tests/e2e/validatecluster/Vagrantfile
+10
-7
No files found.
tests/e2e/splitserver/Vagrantfile
View file @
3307d53f
...
@@ -17,9 +17,10 @@ def provision(vm, role, role_num, node_num)
...
@@ -17,9 +17,10 @@ def provision(vm, role, role_num, node_num)
# An expanded netmask is required to allow VM<-->VM communication, virtualbox defaults to /32
# An expanded netmask is required to allow VM<-->VM communication, virtualbox defaults to /32
vm
.
network
"private_network"
,
ip:
"
#{
NETWORK_PREFIX
}
.
#{
100
+
node_num
}
"
,
netmask:
"255.255.255.0"
vm
.
network
"private_network"
,
ip:
"
#{
NETWORK_PREFIX
}
.
#{
100
+
node_num
}
"
,
netmask:
"255.255.255.0"
vagrant_defaults
=
'../vagrantdefaults.rb'
scripts_location
=
Dir
.
exists?
(
"./scripts"
)
?
"./scripts"
:
"../scripts"
load
vagrant_defaults
if
File
.
exists?
(
vagrant_defaults
)
vagrant_defaults
=
File
.
exists?
(
"./vagrantdefaults.rb"
)
?
"./vagrantdefaults.rb"
:
"../vagrantdefaults.rb"
load
vagrant_defaults
defaultOSConfigure
(
vm
)
defaultOSConfigure
(
vm
)
if
!
RELEASE_VERSION
.
empty?
if
!
RELEASE_VERSION
.
empty?
...
@@ -27,7 +28,7 @@ def provision(vm, role, role_num, node_num)
...
@@ -27,7 +28,7 @@ def provision(vm, role, role_num, node_num)
else
else
# Grabs the last 5 commit SHA's from the given branch, then purges any commits that do not have a passing CI build
# Grabs the last 5 commit SHA's from the given branch, then purges any commits that do not have a passing CI build
# MicroOS requires it not be in a /tmp/ or other root system folder
# MicroOS requires it not be in a /tmp/ or other root system folder
vm
.
provision
"Acquire latest commit"
,
type:
"shell"
,
path:
"../scripts
/latest_commit.sh"
,
args:
[
GITHUB_BRANCH
,
"/home/vagrant/k3s_commits"
]
vm
.
provision
"Acquire latest commit"
,
type:
"shell"
,
path:
scripts_location
+
"
/latest_commit.sh"
,
args:
[
GITHUB_BRANCH
,
"/home/vagrant/k3s_commits"
]
install_type
=
"INSTALL_K3S_COMMIT=$(head
\
-n
\
1
\
/home/vagrant/k3s_commits)"
install_type
=
"INSTALL_K3S_COMMIT=$(head
\
-n
\
1
\
/home/vagrant/k3s_commits)"
end
end
vm
.
provision
"ping k3s.io"
,
type:
"shell"
,
inline:
"ping -c 2 k3s.io"
vm
.
provision
"ping k3s.io"
,
type:
"shell"
,
inline:
"ping -c 2 k3s.io"
...
@@ -46,7 +47,6 @@ def provision(vm, role, role_num, node_num)
...
@@ -46,7 +47,6 @@ def provision(vm, role, role_num, node_num)
disable-controller-manager: true
disable-controller-manager: true
disable-scheduler: true
disable-scheduler: true
YAML
YAML
k3s
.
args
=
"server --cluster-init --disable-apiserver --disable-controller-manager --disable-scheduler --node-external-ip=
#{
NETWORK_PREFIX
}
.100 --flannel-iface=eth1"
k3s
.
env
=
%W[K3S_KUBECONFIG_MODE=0644 K3S_TOKEN=vagrant
#{
install_type
}
]
k3s
.
env
=
%W[K3S_KUBECONFIG_MODE=0644 K3S_TOKEN=vagrant
#{
install_type
}
]
k3s
.
config_mode
=
'0644'
# side-step https://github.com/k3s-io/k3s/issues/4321
k3s
.
config_mode
=
'0644'
# side-step https://github.com/k3s-io/k3s/issues/4321
end
end
...
...
tests/e2e/validatecluster/Vagrantfile
View file @
3307d53f
...
@@ -2,7 +2,7 @@ ENV['VAGRANT_NO_PARALLEL'] = 'no'
...
@@ -2,7 +2,7 @@ ENV['VAGRANT_NO_PARALLEL'] = 'no'
NODE_ROLES
=
(
ENV
[
'E2E_NODE_ROLES'
]
||
NODE_ROLES
=
(
ENV
[
'E2E_NODE_ROLES'
]
||
[
"server-0"
,
"server-1"
,
"server-2"
,
"agent-0"
,
"agent-1"
])
[
"server-0"
,
"server-1"
,
"server-2"
,
"agent-0"
,
"agent-1"
])
NODE_BOXES
=
(
ENV
[
'E2E_NODE_BOXES'
]
||
NODE_BOXES
=
(
ENV
[
'E2E_NODE_BOXES'
]
||
[
'
generic/ubuntu2004'
,
'generic/ubuntu2004'
,
'generic/ubuntu2004'
,
'generic/ubuntu2004'
,
'generic/ubuntu200
4'
])
[
'
opensuse/Leap-15.3.x86_64'
,
'opensuse/Leap-15.3.x86_64'
,
'opensuse/Leap-15.3.x86_64'
,
'opensuse/Leap-15.3.x86_64'
,
'opensuse/Leap-15.3.x86_6
4'
])
GITHUB_BRANCH
=
(
ENV
[
'E2E_GITHUB_BRANCH'
]
||
"master"
)
GITHUB_BRANCH
=
(
ENV
[
'E2E_GITHUB_BRANCH'
]
||
"master"
)
RELEASE_VERSION
=
(
ENV
[
'E2E_RELEASE_VERSION'
]
||
""
)
RELEASE_VERSION
=
(
ENV
[
'E2E_RELEASE_VERSION'
]
||
""
)
EXTERNAL_DB
=
(
ENV
[
'E2E_EXTERNAL_DB'
]
||
"etcd"
)
EXTERNAL_DB
=
(
ENV
[
'E2E_EXTERNAL_DB'
]
||
"etcd"
)
...
@@ -19,11 +19,12 @@ def provision(vm, role, role_num, node_num)
...
@@ -19,11 +19,12 @@ def provision(vm, role, role_num, node_num)
vm
.
hostname
=
role
vm
.
hostname
=
role
# An expanded netmask is required to allow VM<-->VM communication, virtualbox defaults to /32
# An expanded netmask is required to allow VM<-->VM communication, virtualbox defaults to /32
node_ip
=
"
#{
NETWORK_PREFIX
}
.
#{
100
+
node_num
}
"
node_ip
=
"
#{
NETWORK_PREFIX
}
.
#{
100
+
node_num
}
"
vm
.
network
"private_network"
,
ip:
node_ip
,
netmask:
"24"
vm
.
network
"private_network"
,
ip:
node_ip
,
netmask:
"255.255.255.0"
scripts_location
=
Dir
.
exists?
(
"./scripts"
)
?
"./scripts"
:
"../scripts"
vagrant_defaults
=
File
.
exists?
(
"./vagrantdefaults.rb"
)
?
"./vagrantdefaults.rb"
:
"../vagrantdefaults.rb"
load
vagrant_defaults
vagrant_defaults
=
'../vagrantdefaults.rb'
load
vagrant_defaults
if
File
.
exists?
(
vagrant_defaults
)
defaultOSConfigure
(
vm
)
defaultOSConfigure
(
vm
)
if
!
RELEASE_VERSION
.
empty?
if
!
RELEASE_VERSION
.
empty?
...
@@ -31,7 +32,7 @@ def provision(vm, role, role_num, node_num)
...
@@ -31,7 +32,7 @@ def provision(vm, role, role_num, node_num)
else
else
# Grabs the last 5 commit SHA's from the given branch, then purges any commits that do not have a passing CI build
# Grabs the last 5 commit SHA's from the given branch, then purges any commits that do not have a passing CI build
# MicroOS requires it not be in a /tmp/ or other root system folder
# MicroOS requires it not be in a /tmp/ or other root system folder
vm
.
provision
"Get latest commit"
,
type:
"shell"
,
path:
"../scripts
/latest_commit.sh"
,
args:
[
GITHUB_BRANCH
,
"/home/vagrant/k3s_commits"
]
vm
.
provision
"Get latest commit"
,
type:
"shell"
,
path:
scripts_location
+
"
/latest_commit.sh"
,
args:
[
GITHUB_BRANCH
,
"/home/vagrant/k3s_commits"
]
install_type
=
"INSTALL_K3S_COMMIT=$(head
\
-n
\
1
\
/home/vagrant/k3s_commits)"
install_type
=
"INSTALL_K3S_COMMIT=$(head
\
-n
\
1
\
/home/vagrant/k3s_commits)"
end
end
vm
.
provision
"shell"
,
inline:
"ping -c 2 k3s.io"
vm
.
provision
"shell"
,
inline:
"ping -c 2 k3s.io"
...
@@ -39,7 +40,7 @@ def provision(vm, role, role_num, node_num)
...
@@ -39,7 +40,7 @@ def provision(vm, role, role_num, node_num)
db_type
=
getDBType
(
role
,
role_num
,
vm
)
db_type
=
getDBType
(
role
,
role_num
,
vm
)
if
!
HARDENED
.
empty?
if
!
HARDENED
.
empty?
vm
.
provision
"Set kernel parameters"
,
type:
"shell"
,
path:
"../scripts
/harden.sh"
vm
.
provision
"Set kernel parameters"
,
type:
"shell"
,
path:
scripts_location
+
"
/harden.sh"
hardened_arg
=
"protect-kernel-defaults: true
\n
kube-apiserver-arg:
\"
enable-admission-plugins=NodeRestriction,PodSecurityPolicy,ServiceAccount
\"
"
hardened_arg
=
"protect-kernel-defaults: true
\n
kube-apiserver-arg:
\"
enable-admission-plugins=NodeRestriction,PodSecurityPolicy,ServiceAccount
\"
"
end
end
...
@@ -122,6 +123,8 @@ def getDBType(role, role_num, vm)
...
@@ -122,6 +123,8 @@ def getDBType(role, role_num, vm)
if
role
.
include?
(
"server"
)
&&
role_num
==
0
if
role
.
include?
(
"server"
)
&&
role_num
==
0
return
"cluster-init: true"
return
"cluster-init: true"
end
end
elsif
(
EXTERNAL_DB
==
"none"
)
# Use internal sqlite
else
else
puts
"Unknown EXTERNAL_DB: "
+
EXTERNAL_DB
puts
"Unknown EXTERNAL_DB: "
+
EXTERNAL_DB
abort
abort
...
...
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