-
Notifications
You must be signed in to change notification settings - Fork 3
/
y-k3s-install
executable file
·25 lines (19 loc) · 1006 Bytes
/
y-k3s-install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
[ -z "$DEBUG" ] || set -x
set -eo pipefail
[ $(id -u) -ne 0 ] && echo "su privileges required for the k3s installer" && exec sudo -E $0 "$@"
export INSTALL_K3S_SKIP_START=true
export K3S_NODE_NAME=ystack-master
# For kubectl top to work with metrics-server, https://github.com/rancher/k3s/issues/252#issuecomment-482662774
export INSTALL_K3S_EXEC="--kubelet-arg=address=0.0.0.0 ${INSTALL_K3S_EXEC}"
INSTALLER_REVISION=bd04941a294793ec92e8703d5e5da14107902e88
export INSTALL_K3S_VERSION=v1.30.5+k3s1
curl -sfL https://github.com/k3s-io/k3s/raw/$INSTALLER_REVISION/install.sh | sh -
service k3s start
k3s crictl info
# The default storage class with k3s >= 0.10 is "local-path"
#k3s kubectl patch storageclass standard -p "{\"metadata\":{\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"true\"}}}"
ctx="--kubeconfig=/etc/rancher/k3s/k3s.yaml"
k3s kubectl $ctx get node
sleep 5
until k3s kubectl $ctl wait --for=condition=Ready node/ystack-master; do sleep 5; done