Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kubernetes_on-prim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Toth
kubernetes_on-prim
Commits
764bb4db
Commit
764bb4db
authored
2 years ago
by
Peter Toth
Browse files
Options
Downloads
Patches
Plain Diff
Vagrantfile
parent
b9f301ed
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kube8s-containerd/Vagrantfile
+103
-0
103 additions, 0 deletions
kube8s-containerd/Vagrantfile
with
103 additions
and
0 deletions
kube8s-containerd/Vagrantfile
0 → 100644
+
103
−
0
View file @
764bb4db
Vagrant
.
configure
(
"2"
)
do
|
config
|
if
Vagrant
.
has_plugin?
(
"vagrant-timezone"
)
config
.
timezone
.
value
=
"Europe/Vienna"
end
# https://app.vagrantup.com/boxes/search?utf8=%E2%9C%93&sort=downloads&provider=virtualbox&q=jammy
config
.
vm
.
box
=
"ubuntu/jammy64"
config
.
vm
.
box_version
=
"20221120.0.0"
config
.
vm
.
box_url
=
"ubuntu/jammy64"
WORKERNODES
=
2
config
.
vm
.
define
"master-node"
do
|
m
|
m
.
vm
.
hostname
=
"master-node"
m
.
vm
.
network
"private_network"
,
ip:
"192.168.56.10"
m
.
vm
.
provider
"virtualbox"
do
|
vb
|
# Display the VirtualBox GUI when booting the machine
# vb.gui = true
# Customize the amount of memory on the VM:
vb
.
memory
=
"2048"
vb
.
name
=
"master-node"
end
# the shell part of the k8s here
m
.
vm
.
provision
"setup-hosts"
,
:type
=>
"shell"
,
:path
=>
"k8s-setup-master.sh"
do
|
s
|
end
#of the shell part
m
.
vm
.
provision
"setup-user"
,
:type
=>
"shell"
,
:path
=>
"adduser-sysopans.sh"
do
|
s
|
end
#of the shell part
m
.
vm
.
provision
"shell"
do
|
s
|
ssh_pub_key
=
File
.
readlines
(
"/home/master/.ssh/sysopans-id_rsa.pub"
).
first
.
strip
s
.
inline
=
<<-
SHELL
echo
#{
ssh_pub_key
}
>> /home/sysopans/.ssh/authorized_keys
SHELL
end
m
.
vm
.
provision
"setup-user-perm"
,
:type
=>
"shell"
,
:path
=>
"setpermission-sysopans.sh"
do
|
s
|
end
#of the shell part
# m.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y nginx
# SHELL
end
# master-node
(
1
..
WORKERNODES
).
each
do
|
i
|
# worker-nodeX:
config
.
vm
.
define
"worker-node
#{
i
}
"
do
|
w
|
w
.
vm
.
hostname
=
"worker-node
#{
i
}
"
w
.
vm
.
network
"private_network"
,
ip:
"192.168.56.
#{
10
+
i
}
"
w
.
vm
.
provider
"virtualbox"
do
|
vb
|
# Display the VirtualBox GUI when booting the machine
# vb.gui = true
# Customize the amount of memory on the VM:
vb
.
memory
=
"1024"
vb
.
name
=
"worker-node
#{
i
}
"
end
# the shell part of the k8s here
w
.
vm
.
provision
"setup-hosts"
,
:type
=>
"shell"
,
:path
=>
"k8s-setup-master.sh"
do
|
s
|
end
#of the shell part
w
.
vm
.
provision
"setup-user"
,
:type
=>
"shell"
,
:path
=>
"adduser-sysopans.sh"
do
|
s
|
end
#of the shell part
w
.
vm
.
provision
"shell"
do
|
s
|
ssh_pub_key
=
File
.
readlines
(
"/home/master/.ssh/sysopans-id_rsa.pub"
).
first
.
strip
s
.
inline
=
<<-
SHELL
echo
#{
ssh_pub_key
}
>> /home/sysopans/.ssh/authorized_keys
SHELL
end
w
.
vm
.
provision
"setup-user-perm"
,
:type
=>
"shell"
,
:path
=>
"setpermission-sysopans.sh"
do
|
s
|
end
#of the shell part
# w.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y nginx
# SHELL
end
# worker-nodeX
end
# loop
# hapr-node:
config
.
vm
.
define
"hapr-node"
do
|
h
|
h
.
vm
.
hostname
=
"hapr-node"
h
.
vm
.
network
"private_network"
,
ip:
"192.168.56.9"
h
.
vm
.
provider
"virtualbox"
do
|
vb
|
# Display the VirtualBox GUI when booting the machine
# vb.gui = true
# Customize the amount of memory on the VM:
vb
.
memory
=
"1024"
vb
.
name
=
"hapr-node"
end
h
.
vm
.
provision
"shell"
,
inline:
<<-
SHELL
apt-get update
apt-get install -y haproxy
SHELL
h
.
vm
.
provision
"setup-user"
,
:type
=>
"shell"
,
:path
=>
"adduser-sysopans.sh"
do
|
s
|
end
#of the shell part
h
.
vm
.
provision
"shell"
do
|
s
|
ssh_pub_key
=
File
.
readlines
(
"/home/master/.ssh/sysopans-id_rsa.pub"
).
first
.
strip
s
.
inline
=
<<-
SHELL
echo
#{
ssh_pub_key
}
>> /home/sysopans/.ssh/authorized_keys
SHELL
end
h
.
vm
.
provision
"setup-user-perm"
,
:type
=>
"shell"
,
:path
=>
"setpermission-sysopans.sh"
do
|
s
|
end
#of the shell part
end
# hapr-node
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment