Code Review
/
iec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Update kernel configuration to support cilium"
[iec.git]
/
src
/
foundation
/
scripts
/
k8s_master.sh
diff --git
a/src/foundation/scripts/k8s_master.sh
b/src/foundation/scripts/k8s_master.sh
index
1782769
..
cdcf8bc
100755
(executable)
--- a/
src/foundation/scripts/k8s_master.sh
+++ b/
src/foundation/scripts/k8s_master.sh
@@
-1,4
+1,5
@@
#!/bin/bash -ex
#!/bin/bash -ex
+# shellcheck source=/dev/null
# For host setup as Kubernetes master
MGMT_IP=$1
# For host setup as Kubernetes master
MGMT_IP=$1
@@
-19,12
+20,16
@@
if ! kubectl get nodes; then
if [ "$(id -u)" = 0 ]; then
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" | \
if [ "$(id -u)" = 0 ]; then
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" | \
- tee -a "${HOME}/.
profile
"
+ tee -a "${HOME}/.
bashrc
"
# shellcheck disable=SC1090
# shellcheck disable=SC1090
- source "${HOME}/.profile"
- else
- mkdir -p "${HOME}/.kube"
- sudo cp -i /etc/kubernetes/admin.conf "${HOME}/.kube/config"
- sudo chown "$(id -u)":"$(id -g)" "${HOME}/.kube/config"
+ source "${HOME}/.bashrc"
fi
fi
+
+ mkdir -p "${HOME}/.kube"
+ # shellcheck disable=SC2216
+ yes | sudo cp -rf /etc/kubernetes/admin.conf "${HOME}/.kube/config"
+ sudo chown "$(id -u)":"$(id -g)" "${HOME}/.kube/config"
+
+ sleep 5
+ sudo swapon -a
fi
fi