overview
DOK is a tool for creating Kubernetes clusters, please check the help information to find more usages.
# check the help information
dok --help
# create the Kubernetes cluster with 3 controlplane and 3 workers
dok createCluster -m 172.22.1.16,172.22.0.41,172.22.0.117 -w 172.22.1.89,172.22.0.136,172.22.0.19 -p /root/dok-release-without-app-image.gz --password Dokpwd2023
# join a Node to an existing cluster
dok joinNode -m 172.22.0.140 -w 172.22.0.43 --password Dokpwd2023
# delete a Node from an existing cluster
dok deleteNode -w 172.22.0.43
# reset a Node from an existing cluster
dok resetNode -m 10.9.204.77 -w 10.9.24.177
- Create the Kubernetes cluster without internet or any proxy
- Help to create Tencent Cloud CVM easily
- Create/Destroy Kubernetes cluster and Add/Delete Node
- Logs persist to file /tmp/dok.log
- Config Persist to file /tmp/dok-config.yaml
- Install git/zsh/k9s/nerdctl offline
- DOK is very easy to expand with shell or webhook(register to CMDB)
- DOK: acronym of Deployer of Kubernetes
- master0: the first controlplane node created by DOK deployment
- exec machine: it can only be a node that executes DOK to create a cluster operation without joining the Kubernetes cluster
- install pkg: refers to the file that DOK needs to use, generally less than 1G, named dok-release-without-app-image.gz
- master node: controlplane and master have the same meaning
- worker node: worker node and node have the same meaning
- pkg: generally refers to the installation package
- path: generally refers to the file itself, dir generally refers to the folder
# check targets in Makefile
make
Download these 3 files as follows from this link:
- dok
- dok-release-without-app-image.gz
- dok-release-without-app-image.gz.md5sum
After download these 3 files, please put them to the path /root
of master0 or execution machine, remember that, the path is not allowed to be changed for now.
[root@VM-1-169-centos ~]# ll -h /root/
-rwxr-xr-x 1 root root 8.2M dok
-rw-r----- 1 root root 820M dok-release-without-app-image.gz
-rw-r----- 1 root root 64 dok-release-without-app-image.gz.md5sum
# If master0 is used as the execution machine and uses password-free mode, it must be ensured that master0 can enter localhost without password
dok createCluster \
-m 172.22.1.108 \
-w 172.22.0.159 \
-p /root/dok-release-without-app-image.gz \
--password Dokpwd2023
DOK can enable the auto-completion function of the command. After executing the following command, restart bash. For more information, please check dok completion -h
.
# bash
dok completion bash > /etc/bash_completion.d/dok
# zsh
echo "autoload -U compinit; compinit" >> ~/.zshrc
dok completion zsh > "${fpath[1]}/_dok"