Skip to content

Commit

Permalink
refactor yurtctl init (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peeknut authored Jan 4, 2022
1 parent bebc077 commit 2413a02
Show file tree
Hide file tree
Showing 12 changed files with 293 additions and 1,016 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ yurtctl convert --provider [minikube|kubeadm|kind] // To convert an existing Ku
yurtctl revert // To uninstall and revert back to the original cluster settings
yurtctl join // To allow a new node to join OpenYurt
yurtctl reset // To revert changes to the node made by the join command
yurtctl init // To init an OpenYurt Cluster
```

Please check [yurtctl tutorial](./docs/tutorial/yurtctl.md) for more details.
Expand Down
1 change: 1 addition & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ yurtctl convert --provider [minikube|kubeadm|kind] // 一键式转换原生Kube
yurtctl revert // 一键式恢复OpenYurt集群为Kubernetes集群
yurtctl join // 往OpenYurt中接入一个节点(在边缘节点上执行)
yurtctl reset // 从OpenYurt中清除边缘节点(在边缘节点上执行)
yurtctl init // 初始化OpenYurt集群
```

请查看 [yurtctl教程](./docs/tutorial/yurtctl.md)来获得更多使用细节。
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorial/yurtctl.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,14 @@ In addition, the path of the kubelet service configuration can be set by the opt
and the path of the directory on edge node containing static pod files can be set by the option `--pod-manifest-path`.

## Create OpenYurt cluster
`yurtctl init` will create an OpenYurt cluster, but the user needs to install the runtime in advance and ensure that the swap partition of the node has been closed.
`yurtctl init` will create an OpenYurt cluster, and the user doesn't need to do pre-work, such as install the runtime in advance or ensure that the swap partition of the node has been closed.

Using `yurtctl` to create an OpenYurt cluster can be done by doing the following:
```
$ _output/bin/yurtctl init --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers --kubernetes-version=v1.18.8 --pod-network-cidr=10.244.0.0/16
$ _output/bin/yurtctl init --apiserver-advertise-address 1.2.3.4 --openyurt-version v0.5.0 --passwd 1234
```
In addition, the OpenYurt components version can be set by the option `--yurt-version`,
and the OpenYurt components image registry can be set by the option `--yurt-image-registry`.
The `--apiserver-advertise-address` is the IP address of master, `--passwd` is ssh password of master, `--openyurt-version` is the the OpenYurt cluster version.
In addition, and the OpenYurt cluster image registry can be set by the option `--image-registry`. If user want to get more help, please use `yurtctl init -h`.

## Join Edge-Node/Cloud-Node to OpenYurt

Expand Down
2 changes: 1 addition & 1 deletion pkg/yurtctl/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ func NewYurtctlCommand() *cobra.Command {
cmds.AddCommand(revert.NewRevertCmd())
cmds.AddCommand(markautonomous.NewMarkAutonomousCmd())
cmds.AddCommand(clusterinfo.NewClusterInfoCmd())
cmds.AddCommand(yurtinit.NewCmdInit())
cmds.AddCommand(join.NewCmdJoin(os.Stdout, nil))
cmds.AddCommand(reset.NewCmdReset(os.Stdin, os.Stdout, nil))
cmds.AddCommand(yurtinit.NewCmdInit(os.Stdout, nil))

klog.InitFlags(nil)
// goflag.Parse()
Expand Down
Loading

0 comments on commit 2413a02

Please sign in to comment.