https://github.com/flytrap/k8s-tool
https://github.com/flytrap/k8s-tool
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/flytrap/k8s-tool
- Owner: flytrap
- License: apache-2.0
- Created: 2024-07-23T05:37:00.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-04T02:25:09.000Z (7 months ago)
- Last Synced: 2025-11-04T04:22:07.062Z (7 months ago)
- Language: Go
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# K8s tool
k8s install from kubeadm
## usage
unzip resource.zip to resource directory
example: ubuntu 22.04 64bit offline resource
```bash
unzip resource.zip
```
install
```bash
k8s-tools help
k8s-tools install
k8s-tools install --config config.yaml # default config file path
k8s-tools install --config config.yaml --steps # print install steps
k8s-tools install --config config.yaml --step 3,4 # only execute 3,4 steps, refer to above print (1 must be executed, other operations must be executed first)
```
## deploy
```bash
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/k8s-tool-linux .
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o build/k8s-tool-darwin .
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o build/k8s-tool.exe .
```
## config file
```yaml
# config file
# config path: config/config.yaml
namespace: default
registry: registry.cn-hangzhou.aliyuncs.com
ntp:
server: 192.168.1.101
allow: 192.168.1.101/16
timezone: Asia/Shanghai
vip: 192.168.56.151
nodes:
- address: 192.168.56.101
hostname: master1
role: [etcd, controlplane, worker]
port: 22
username: ZGVwbG95
password: ZGVwbG95
keyPath:
# - address: 192.168.56.102
# hostname: master2
# role: [etcd, controlplane, worker]
# port: 22
# username: ZGVwbG95
# password: ZGVwbG95
nfs:
server: 192.168.57.101
path: /data/nfs
```