You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get the corresponding binary files from the [release](https://github.com/kubesphere/kubekey/releases) page.
22
+
## Method 1: Release Page
30
23
31
-
## Download Binary with UI
24
+
Get the corresponding binary files from the [Release](https://github.com/kubesphere/kubekey/releases) page.
32
25
33
-
**UI only support after v4.0.0**
34
-
35
-
**Prerequisite:**`hack/downloadKubekey.sh` downloads the web-installer bundle unless **`SKIP_WEB_INSTALLER` is set to `true`**.
26
+
## Method 2: Run Script
36
27
37
28
```shell
38
-
export SKIP_WEB_INSTALLER=false
39
29
curl -sfL https://get-kk.kubesphere.io | sh -
40
-
# run with UI
41
-
kk web --schema-path schema --ui-path dist
42
-
```
43
-
44
-
### Build an offline package with config.yaml
45
-
46
-
After `hack/downloadKubekey.sh` finishes, you may have `package.sh` in the current directory (depending on version and options). Put your `config.yaml` there and run `./package.sh config.yaml` to produce the offline bundle. To generate or fill in `config.yaml`—including image lists and related fields—use the online tool **[KubeSphere Images](https://get-images.kubesphere.io/)**.
47
-
48
-
# Deploy Kubernetes
49
-
50
-
- Supported deployment environments: Linux distributions
- One or more computers running Linux operating systems compatible with deb/rpm; for example: Ubuntu or CentOS.
62
-
- Each machine should have more than 2 GB of memory; applications will be limited if memory is insufficient.
63
-
- Control plane nodes should have at least 2 CPUs.
64
-
- Full network connectivity among all machines in the cluster. You can use public or private networks.
65
-
66
-
## Define node information
67
-
68
-
kubekey uses the `inventory` resource to define node connection information.
69
-
You can use `kk create inventory` to get the default inventory.yaml resource. The default `inventory.yaml` configuration is as follows:
70
-
```yaml
71
-
apiVersion: kubekey.kubesphere.io/v1
72
-
kind: Inventory
73
-
metadata:
74
-
name: default
75
-
spec:
76
-
hosts: # your can set all nodes here. or set nodes on special groups.
77
-
# node1:
78
-
# connector:
79
-
# type: ssh
80
-
# host: node1
81
-
# port: 22
82
-
# user: root
83
-
# password: 123456
84
-
groups:
85
-
# all kubernetes nodes.
86
-
k8s_cluster:
87
-
groups:
88
-
- kube_control_plane
89
-
- kube_worker
90
-
# control_plane nodes
91
-
kube_control_plane:
92
-
hosts:
93
-
- localhost
94
-
# worker nodes
95
-
kube_worker:
96
-
hosts:
97
-
- localhost
98
-
# etcd nodes when etcd_deployment_type is external
99
-
etcd:
100
-
hosts:
101
-
- localhost
102
-
# image_registry:
103
-
# hosts:
104
-
# - localhost
105
-
# nfs nodes for registry storage. and kubernetes nfs storage
106
-
# nfs:
107
-
# hosts:
108
-
# - localhost
109
-
110
-
```
111
-
The inventory contains the following built-in groups:
112
-
1. k8s_cluster: Kubernetes cluster. Contains two subgroups: kube_control_plane, kube_worker
113
-
2. kube_control_plane: control_plane node group in the Kubernetes cluster
114
-
3. kube_worker: worker node group in the Kubernetes cluster.
115
-
4. etcd: node group for installing etcd cluster.
116
-
5. image_registry: node group for installing image registry (including harbor, registry)
117
-
6. nfs: node group for installing nfs.
118
-
119
-
## Define key configuration information
120
-
121
-
kubekey uses the `config` resource to define node connection information.
122
-
You can use `kk create config --with-kubernetes v1.33.1` to get the default inventory.yaml resource. The default `config.yaml` configuration is as follows:
123
-
124
-
Default config configurations are provided as references for different Kubernetes versions:
125
-
-[Config for installing Kubernetes v1.23.x](builtin/core/defaults/config/v1.23.yaml)
126
-
-[Config for installing Kubernetes v1.24.x](builtin/core/defaults/config/v1.24.yaml)
127
-
-[Config for installing Kubernetes v1.25.x](builtin/core/defaults/config/v1.25.yaml)
128
-
-[Config for installing Kubernetes v1.26.x](builtin/core/defaults/config/v1.26.yaml)
129
-
-[Config for installing Kubernetes v1.27.x](builtin/core/defaults/config/v1.27.yaml)
130
-
-[Config for installing Kubernetes v1.28.x](builtin/core/defaults/config/v1.28.yaml)
131
-
-[Config for installing Kubernetes v1.29.x](builtin/core/defaults/config/v1.29.yaml)
132
-
-[Config for installing Kubernetes v1.30.x](builtin/core/defaults/config/v1.30.yaml)
133
-
-[Config for installing Kubernetes v1.31.x](builtin/core/defaults/config/v1.31.yaml)
134
-
-[Config for installing Kubernetes v1.32.x](builtin/core/defaults/config/v1.32.yaml)
135
-
-[Config for installing Kubernetes v1.33.x](builtin/core/defaults/config/v1.33.yaml)
136
-
-[Config for installing Kubernetes v1.34.x](builtin/core/defaults/config/v1.34.yaml)
137
-
138
-
## Install cluster
139
-
140
-
You can create a cluster in **two ways**: use the **Web UI**, or use the **command line**. The prerequisites and the meaning of `inventory` / `config` are described in the sections above.
141
-
142
-
### Method one: Web (UI)
143
-
144
-
Requires **KubeKey v4.0.0 or newer** with the web installer bundle. Install or download that build (see **Download Binary with UI** under *Install kubekey*), then start the UI:
145
-
146
-
```shell
147
-
kk web --schema-path schema --ui-path dist
148
30
```
149
31
150
-
In the browser, edit inventory and configuration, then follow the UI flow to run the cluster creation playbook (equivalent to `playbooks/create_cluster.yaml`).
Prepare `inventory.yaml` and `config.yaml`, then run the built-in `kk create cluster` subcommand; it runs `playbooks/create_cluster.yaml` for you, so you do not pass the playbook path explicitly.
40
+
## Method 1: Command Line
155
41
156
42
```shell
157
-
kk create cluster -i inventory.yaml -c config.yaml
43
+
kk create cluster
158
44
```
159
45
160
-
If `-i inventory.yaml` is not provided, the default inventory.yaml is used. Kubernetes will only be installed on the executing machine.
161
-
If `-c config.yaml` is not provided, the default config.yaml is used. Installs Kubernetes version v1.34.1.
162
-
163
-
Other useful flags:
46
+
## Method 2: Web UI
164
47
165
-
-`--workdir`: KubeKey working directory (default: `<current-dir>/kubekey`).
166
-
-`--with-kubernetes`: Kubernetes version (for example `v1.33.1`) when it is not set in `config.yaml`.
167
-
-`-a` / `--artifact`: path to an offline KubeKey artifact package (`.tgz`); also turns off online fetching when set.
168
-
-`--set`: override config fields, for example `--set download.fetch=false` or nested keys supported by KubeKey.
169
-
-`-n` / `--namespace`: namespace for local runtime resources tied to the playbook.
0 commit comments