Commit 8af28bec authored by Wen Wei Li's avatar Wen Wei Li

complete install k8s

parent 0422a180
#!/bin/bash
# need to change to the dedicated home directory
HOME=/home/prlab
check_root(){
root=`whoami`
if [[ "$root" == "root" ]]; then
......@@ -115,7 +118,7 @@ mkdir -p /opt/deploy/k8s/
cat > /opt/deploy/k8s/kubeadm-config.yaml << EOF
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
controlPlaneEndpoint: "pk8scp1:6443"
controlPlaneEndpoint: "dk8scp1:6443"
bootstrapTokens:
- token: "abcdef.0123456789abcdef"
description: "kubeadm bootstrap token"
......@@ -209,6 +212,12 @@ cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config
}
copy_k8s_config(){
mkdir -p $HOME/.kube
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config
}
copy_host_file(){
if [[ -z $1 ]]; then
......@@ -223,10 +232,13 @@ main(){
if check_root; then
#update_system
echo "Installing"
copy_host_file $1
prerequisite
install_cri
install_k8s
copy_k8s_config
echo "Finish Setup K8S"
exit
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment