mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 10:09:07 +00:00
Kubernetes: Autoinit and persistent state by default
Signed-off-by: Robin Winkelewski <w9ncontact@gmail.com>
This commit is contained in:
parent
8f12286b77
commit
7b16f41540
@ -18,6 +18,10 @@ Boot Kubernetes master OS image using `hyperkit` on macOS: or `qemu` on Linux:
|
|||||||
```
|
```
|
||||||
./boot.sh
|
./boot.sh
|
||||||
```
|
```
|
||||||
|
or, to automatically initialise the cluster upon boot with no additional options
|
||||||
|
```
|
||||||
|
KUBE_MASTER_AUTOINIT="" ./boot.sh
|
||||||
|
```
|
||||||
|
|
||||||
Get IP address of the master:
|
Get IP address of the master:
|
||||||
```
|
```
|
||||||
@ -29,7 +33,7 @@ Login to the kubelet container:
|
|||||||
./ssh_into_kubelet.sh <master-ip>
|
./ssh_into_kubelet.sh <master-ip>
|
||||||
```
|
```
|
||||||
|
|
||||||
Manually initialise master with `kubeadm`:
|
Manually initialise master with `kubeadm` if booted without `KUBE_MASTER_AUTOINIT`:
|
||||||
```
|
```
|
||||||
kubeadm-init.sh
|
kubeadm-init.sh
|
||||||
```
|
```
|
||||||
|
@ -15,7 +15,7 @@ set -e
|
|||||||
: ${KUBE_RUN_ARGS:=}
|
: ${KUBE_RUN_ARGS:=}
|
||||||
: ${KUBE_EFI:=}
|
: ${KUBE_EFI:=}
|
||||||
: ${KUBE_MAC:=}
|
: ${KUBE_MAC:=}
|
||||||
: ${KUBE_PRESERVE_STATE:=}
|
: ${KUBE_CLEAR_STATE:=}
|
||||||
|
|
||||||
[ "$(uname -s)" = "Darwin" ] && KUBE_EFI=1
|
[ "$(uname -s)" = "Darwin" ] && KUBE_EFI=1
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ if [ $# -eq 0 ] ; then
|
|||||||
: ${KUBE_VCPUS:=$KUBE_MASTER_VCPUS}
|
: ${KUBE_VCPUS:=$KUBE_MASTER_VCPUS}
|
||||||
: ${KUBE_MEM:=$KUBE_MASTER_MEM}
|
: ${KUBE_MEM:=$KUBE_MASTER_MEM}
|
||||||
: ${KUBE_DISK:=$KUBE_MASTER_DISK}
|
: ${KUBE_DISK:=$KUBE_MASTER_DISK}
|
||||||
elif [ $# -gt 1 ] || [ $# -eq 1 -a -n "${KUBE_PRESERVE_STATE}" ] ; then
|
elif [ $# -ge 1 ] ; then
|
||||||
case $1 in
|
case $1 in
|
||||||
''|*[!0-9]*)
|
''|*[!0-9]*)
|
||||||
echo "Node number must be a number"
|
echo "Node number must be a number"
|
||||||
@ -58,7 +58,11 @@ elif [ $# -gt 1 ] || [ $# -eq 1 -a -n "${KUBE_PRESERVE_STATE}" ] ; then
|
|||||||
img="kube-node"
|
img="kube-node"
|
||||||
name="node-${1}"
|
name="node-${1}"
|
||||||
shift
|
shift
|
||||||
data="{\"kubeadm\": {\"join\": \"${*}\"} }"
|
|
||||||
|
if [ $# -ge 1 ] ; then
|
||||||
|
data="{\"kubeadm\": {\"join\": \"${*}\"} }"
|
||||||
|
fi
|
||||||
|
|
||||||
state="kube-${name}-state"
|
state="kube-${name}-state"
|
||||||
|
|
||||||
: ${KUBE_VCPUS:=$KUBE_NODE_VCPUS}
|
: ${KUBE_VCPUS:=$KUBE_NODE_VCPUS}
|
||||||
@ -73,7 +77,7 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
set -x
|
set -x
|
||||||
if [ -z "${KUBE_PRESERVE_STATE}" ] ; then
|
if [ -n "${KUBE_CLEAR_STATE}" ] ; then
|
||||||
rm -rf "${state}"
|
rm -rf "${state}"
|
||||||
mkdir "${state}"
|
mkdir "${state}"
|
||||||
if [ -n "${KUBE_MAC}" ] ; then
|
if [ -n "${KUBE_MAC}" ] ; then
|
||||||
|
Loading…
Reference in New Issue
Block a user