Skip to content

Commit

Permalink
Merge branch 'release/1.1.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
kdgyun committed May 23, 2024
2 parents 687af2e + dd51c40 commit a4385ed
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ The following shows the available options to run this bootstrap.
| ```-i / --ip``` | Host IP | Declare IP for master node (e.g, 10.0.0.1). <br /> In case of deploying k8s in a cloud (e.g, aws, gcp …) declare an IP with the scope of a private IP, not the public IP. | |
| ```-kv / --k8sversion``` | | Displays all versions of k8s this bootstrap can install | |
| ```-m / --master``` | | Use this option to install a master ```-m``` | The flag ```-i/--ip``` is a must if this option is utilized. |
| ```-ms / --metricserver``` | | To install the metrics-server for Kubernetes, use the `-ms` flag. | It can only be installed when configuring a master node, so the `-m/--master` flag is also required. |
| ```-p / --password``` | Master(Host) node password | Required for ssh login using a password. <br /> It is done so the worker node can access the master during installation to obtain the join token. Both master and worker must be in the same subnet. | The flag ```-u/--username``` is a must if this option is utilized. |
| ```-r / --regularuser``` <br /> **(\*beta)** | HOME_PATH of regular user | This bootstrap is executed with sudo permission, thus this option is used to allow regular users (such as the user `ubuntu` in ubuntu servers) to also use k8s. <br /> run this option as ```-r /home/username```. Crucial that HOME_PATH is the same as **the regular user's home directory($HOME)** | Not a must option. Utilized when initializing a master node with ```-m```. |
| ```-u / --username``` | Master(Host) node username | ```username``` for ssh login. <br /> Set so a newly created worker node within the same subnet as the master node can fetch the join token from the master node. | The floag ```-p/--password``` is a must if this option is utilized. |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ sudo ./k8s-cluster-bootstrap.sh [options] <value>
| ```-i / --ip``` | Host IP | host ip (e.g. 10.0.0.1) 입니다. <br /> 만약 클라우드(e.g, aws, gcp …) 등을 사용 할 경우, public IP가 아닌, private IP를 사용해야 합니다. | |
| ```-kv / --k8sversion``` | | 지원하는 쿠버네티스 버전을 보여줍니다. | |
| ```-m / --master``` | | master 노드를 생성하고자 하는 경우 ```-m``` 플래그를 사용하면 됩니다. | ```-i/--ip``` 플래그가 반드시 요구됩니다. |
| ```-ms / --metricserver``` | | kubernetes의 metrics-server를 설치하고자 하는 경우 ```-ms``` 플래그를 사용하면 됩니다. | master노드를 구성하는 경우에만 설치가 가능하기 때문에 ```-m/--master``` 플래그가 반드시 요구됩니다. |
| ```-p / --password``` | Master(Host) node password | ssh 로그인시 마스터 노드에 접속하기 위한 비밀번호입니다. <br /> 같은 서브넷 안에서 worker 노드 생성시 master 노드로부터 token을 갖고오기 위한 옵션입니다. | ```-u/--username``` 플래그와 반드시 같이 사용해야합니다. |
| ```-r / --regularuser``` <br /> **(\*beta)** | HOME_PATH of regular user | 현재 sudo 권한으로 실행한 user 외에 다른 일반 유저에 대해서도 접근 권한을 부여하고자 할 때 사용합니다. <br /> ```-r /home/username``` 과 같이 사용하며, 이 때 HOME_PATH는 반드시 **해당 계정의 홈 디렉토리($HOME)** 이어야 합니다. | 선택 옵션이나, ```-m``` (마스터 노드 생성) 때에만 사용되는 옵션입니다. |
| ```-u / --username``` | Master(Host) node username | ssh 로그인시 마스터 노드에 접속하기 위한 username입니다. <br /> 같은 서브넷 안에서 worker 노드 생성시 master 노드로부터 token을 갖고오기 위한 옵션입니다. | ```-p/--password``` 옵션과 반드시 같이 사용해야합니다. |
Expand Down
17 changes: 17 additions & 0 deletions k8s-cluster-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ CONTAINER_TYPE="docker"
USED_CONTAINERD=false
CRI_SOCKET=""
K8S_VERSION=""
METRICS_SERVER=false

while (( "$#" )); do
case "$1" in
Expand Down Expand Up @@ -171,6 +172,10 @@ while (( "$#" )); do
VALID_WORKER=true
shift
;;
-ms|--metricserver)
METRICS_SERVER=true
shift
;;
-c|--cni)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
WITH_CNI=true
Expand Down Expand Up @@ -234,6 +239,7 @@ while (( "$#" )); do
printstyle " -i | --ip <Host IP> host-private-ip(master node) configuration for kubernetes. \n"
printstyle " -kv | --k8sversion Shows a list of supported Kubernetes versions. \n"
printstyle " -m | --master Set to initialize this node a master node. \n"
printstyle " -ms | --metricserver Install the metrics-server in Kubernetes. \n"
printstyle " -p | --password <Password> Use password(master node) to access the master for a token copy when initialing worker node. \n"
printstyle " -r | --regularuser <HOME_PATH_OF_REGULAR_USER> Allow regular users to access kubernetes. \n"
printstyle " -u | --username <Username> Use username(master node) to access the master for a token copy when initialing worker node. \n"
Expand Down Expand Up @@ -629,6 +635,17 @@ if [[ $VALID_MASTER == true ]]; then
rm -rf $HOME_PATH/cni
printstyle "Success! \n" 'success'
fi

if [[ $METRICS_SERVER == true ]]; then
lineprint
printstyle "Installing metrics-server... \n" 'info'
lineprint
curl -L -o components.yaml https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
sed -i '/--metric-resolution=15s/a\ - --kubelet-insecure-tls' components.yaml
mv components.yaml kube-metrics-server.yaml
kubectl apply -f kube-metrics-server.yaml
printstyle "Success! \n" 'success'
fi
fi

if [[ $VALID_WORKER == true ]]; then
Expand Down

0 comments on commit a4385ed

Please sign in to comment.