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
e20a0db1
Commit
e20a0db1
authored
Jan 12, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19001 from endocode/fix-libvirt-coreos-cluster
Auto commit by PR queue bot
parents
9b540638
7f4848cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
7 deletions
+44
-7
.gitignore
.gitignore
+3
-0
README.md
cluster/libvirt-coreos/README.md
+31
-0
util.sh
cluster/libvirt-coreos/util.sh
+10
-7
No files found.
.gitignore
View file @
e20a0db1
...
...
@@ -84,3 +84,6 @@ doc_tmp/
# Config directories created by gcloud and gsutil on Jenkins
/.config/gcloud/
/.gsutil/
# CoreOS stuff
cluster/libvirt-coreos/coreos_*.img
cluster/libvirt-coreos/README.md
0 → 100644
View file @
e20a0db1
# Kubernetes CoreOS cluster
With this tutorial one creates a Kubernetes CoreOS cluster containing of one
master and three minions (workers) running on
`192.168.10.1`
-
`192.168.10.4`
.
For working correctly you need to create the directory addressed as
`POOL_PATH`
in
`util.sh`
:
```
$ sudo mkdir /var/lib/libvirt/images/kubernetes
$ sudo chown -R $USER:$USER /var/lib/libvirt/images/kubernetes/
```
Then we follow the instructions in the main
`kubernetes`
directory.
For debugging set
`export UTIL_SH_DEBUG=1`
.
```
$ export KUBERNETES_PROVIDER=libvirt-coreos
$ make release-skip-tests
$ ./cluster/kube-up.sh
```
To bring the cluster down again, execute:
```
$ ./cluster/kube-down.sh
```
Have fun!
[

]()
cluster/libvirt-coreos/util.sh
View file @
e20a0db1
...
...
@@ -16,6 +16,8 @@
# A library of helper functions that each provider hosting Kubernetes must implement to use cluster/kube-*.sh scripts.
[
!
-z
${
UTIL_SH_DEBUG
+x
}
]
&&
set
-x
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../..
readonly
ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
source
"
$ROOT
/
${
KUBE_CONFIG_FILE
:-
"config-default.sh"
}
"
...
...
@@ -25,7 +27,9 @@ export LIBVIRT_DEFAULT_URI=qemu:///system
export
SERVICE_ACCOUNT_LOOKUP
=
${
SERVICE_ACCOUNT_LOOKUP
:-
false
}
export
ADMISSION_CONTROL
=
${
ADMISSION_CONTROL
:-
NamespaceLifecycle
,LimitRanger,ServiceAccount,ResourceQuota
}
readonly
POOL
=
kubernetes
readonly
POOL_PATH
=
"
$(
cd
$ROOT
&&
pwd
)
/libvirt_storage_pool"
readonly
POOL_PATH
=
/var/lib/libvirt/images/kubernetes
[
!
-d
"
${
POOL_PATH
}
"
]
&&
(
echo
"
$POOL_PATH
"
does not exist
;
exit
1
)
# join <delim> <list...>
# Concatenates the list elements with the delimiter passed as first parameter
...
...
@@ -130,12 +134,11 @@ function initialize-pool {
if
[[
"
$ROOT
/coreos_production_qemu_image.img.bz2"
-nt
"
$POOL_PATH
/coreos_base.img"
]]
;
then
bunzip2
-f
-k
"
$ROOT
/coreos_production_qemu_image.img.bz2"
virsh vol-delete coreos_base.img
--pool
$POOL
2> /dev/null
||
true
mv
"
$ROOT
/coreos_production_qemu_image.img"
"
$POOL_PATH
/coreos_base.img"
fi
#
if ! virsh vol-list $POOL | grep -q coreos_base.img; then
#
virsh vol-create-as $POOL coreos_base.img 10G --format qcow2
#
virsh vol-upload coreos_base.img "$ROOT/coreos_production_qemu_image.img" --pool $POOL
#
fi
if
!
virsh vol-list
$POOL
|
grep
-q
coreos_base.img
;
then
virsh vol-create-as
$POOL
coreos_base.img 10G
--format
qcow2
virsh vol-upload coreos_base.img
"
$ROOT
/coreos_production_qemu_image.img"
--pool
$POOL
fi
mkdir
-p
"
$POOL_PATH
/kubernetes"
kube-push-internal
...
...
@@ -202,7 +205,7 @@ function kube-up {
set_service_accounts
initialize-network
readonly
ssh_keys
=
"
$(
cat
~/.ssh/
id_
*
.pub |
sed
's/^/ - /'
)
"
readonly
ssh_keys
=
"
$(
cat
~/.ssh/
*
.pub |
sed
's/^/ - /'
)
"
readonly
kubernetes_dir
=
"
$POOL_PATH
/kubernetes"
local
i
...
...
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