update README.md

This commit is contained in:
pixiake 2020-04-29 10:06:38 +08:00
parent 429d9aa90f
commit 039a656c9a
3 changed files with 61 additions and 18 deletions

View File

@ -17,41 +17,38 @@ Please follow the list to prepare environment.
### Usage
* Download binary
```shell script
curl -O -k https://kubesphere-installer.pek3b.qingstor.com/kubeocean/ko
chmod +x ko
curl -O -k https://kubernetes.pek3b.qingstor.com/tools/kubekey/kk
chmod +x kk
```
* Deploy a Allinone cluster
```shell script
./ko create cluster
# Kubesphere can be installed by "--add kubesphere"
./ko create cluster --add kubesphere
./kk create cluster
```
* Deploy a MultiNodes cluster
> Create a cluster config file by following command or [example config file](docs/cluster-info.yaml)
> Create a example configuration file by following command or [example configuration file](docs/config-example.md)
```shell script
./ko create config
./kk create config # Only kubernetes
./kk create config --add localVolume # Add plugins (eg: localVolume / nfsClient / localVolume,nfsClient)
# Please fill in the configuration file under the current path (k2cluster-example.yaml) according to the environmental information
```
> Deploy cluster
```shell script
./ko create cluster --cluster-info ./cluster-info.yaml
# Kubesphere can be installed by "--add kubesphere"
./ko create cluster --cluster-info ./cluster-info.yaml --add kubesphere
./kk create cluster -f ./k2cluster-example.yaml
```
* Add Nodes
> Add new node's information to the cluster config file
```shell script
./ko scale --cluster-info ./cluster-info.yaml
./kk scale -f ./k2cluster-example.yaml
```
* Reset Cluster
```shell script
# allinone
./ko reset
./kk reset
# multinodes
./ko reset --cluster-info /home/ubuntu/cluster-info.yaml
./kk reset -f ./k2cluster-example.yaml
```
### Supported
* Deploy allinone cluster
@ -60,9 +57,12 @@ chmod +x ko
### Build
```shell script
git clone https://github.com/pixiake/kubeocean.git
cd kubeocean
git clone https://github.com/pixiake/kubekey.git
cd kubekey
./build.sh
```
> Note: Docker needs to be installed before building.
## Quick Start
* CaaO (Cluster as a Object)
* Support more container runtimes: cri-o containerd

View File

@ -110,7 +110,7 @@ func GenerateK2ClusterObj(addons string) error {
if err != nil {
return errors.Wrap(err, "faild get current dir")
}
cmd := fmt.Sprintf("echo %s | base64 -d > %s/k2cluster-demo.yaml", K2ClusterObjStrBase64, currentDir)
cmd := fmt.Sprintf("echo %s | base64 -d > %s/k2cluster-example.yaml", K2ClusterObjStrBase64, currentDir)
err1 := exec.Command("/bin/sh", "-c", cmd).Run()
if err1 != nil {
return err1

43
docs/config-example.md Normal file
View File

@ -0,0 +1,43 @@
```yaml
apiVersion: kubekey.io/v1alpha1
kind: K2Cluster
metadata:
name: demo
spec:
hosts:
- hostName: node1
sshAddress: 172.16.0.2
internalAddress: 172.16.0.2
port: "22"
user: ubuntu
password: Qcloud@123
sshKeyPath: ""
role:
- etcd
- master
- worker
lbKubeapiserver:
domain: lb.kubesphere.local
address: ""
port: "6443"
kubeCluster:
version: v1.17.4
imageRepo: kubekey
clusterName: cluster.local
network:
plugin: calico
kube_pods_cidr: 10.233.64.0/18
kube_service_cidr: 10.233.0.0/18
registry:
registryMirrors: []
insecureRegistries: []
plugins:
localVolume:
isDefaultClass: true
nfsClient:
isDefaultClass: false
nfsServer: ""
nfsPath: ""
nfsVrs3Enabled: false
nfsArchiveOnDelete: false
```