-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
125 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,75 @@ | ||
# Build an OpenYurt ClusterImage | ||
# OpenYurt ClusterImage | ||
|
||
`yurtadm init` is implemented by sealer, you can modify the kubefile to make your own openyurt cluster image. | ||
Currently, `yurtadm init` is implemented by sealer v0.8.5 to create kubernetes master nodes. | ||
|
||
## install sealer | ||
|
||
```bash | ||
wget https://github.com/sealerio/sealer/releases/download/v0.8.5/sealer-v0.8.5-linux-amd64.tar.gz | ||
tar -zxvf sealer-v0.8.5-linux-amd64.tar.gz -C /usr/bin | ||
``` | ||
|
||
## Build your own OpenYurt Cluster | ||
|
||
Modify the Kubefile to build your own OpenYurt cluster image. | ||
|
||
### 1. Build OpenYurt Cluster Image | ||
|
||
```bash | ||
cd openyurt-latest | ||
|
||
# build openyurt ClusterImage | ||
sealer build -t registry-1.docker.io/your_dockerhub_username/openyurt-cluster:latest-k8s-1198 -f Kubefile . | ||
sealer build -t registry-1.docker.io/your_dockerhub_username/openyurt-cluster:latest-k8s-1.19.8 -f Kubefile . | ||
|
||
# push to dockerhub | ||
sealer push registry-1.docker.io/your_dockerhub_username/openyurt-cluster:latest-k8s-1198 | ||
``` | ||
sealer push registry-1.docker.io/your_dockerhub_username/openyurt-cluster:latest-k8s-1.19.8 | ||
``` | ||
|
||
### 2. Make a Clusterfile | ||
|
||
A sample Clusterfile: | ||
|
||
```yaml | ||
apiVersion: sealer.cloud/v2 | ||
kind: Cluster | ||
metadata: | ||
name: my-cluster | ||
spec: | ||
hosts: | ||
- ips: [ 1.2.3.4 ] | ||
roles: [ master ] | ||
image: registry-1.docker.io/your_dockerhub_username/openyurt-cluster:latest-k8s-1.19.8 | ||
ssh: | ||
passwd: xxx | ||
pk: /root/.ssh/id_rsa | ||
user: root | ||
env: | ||
- PodCIDR=10.244.0.0/16 | ||
--- | ||
|
||
## Custom configurations must specify kind, will be merged to default kubeadm configs | ||
kind: ClusterConfiguration | ||
networking: | ||
podSubnet: 10.244.0.0/16 | ||
serviceSubnet: 10.96.0.0/12 | ||
controllerManager: | ||
extraArgs: | ||
controllers: -nodelifecycle,*,bootstrapsigner,tokencleaner | ||
|
||
--- | ||
|
||
## Custom configurations must specify kind | ||
kind: KubeProxyConfiguration | ||
bindAddress: 0.0.0.0 | ||
clusterCIDR: 10.244.0.0/16 | ||
featuregates: | ||
EndpointSliceProxying: true | ||
``` | ||
### 3. Run OpenYurt Cluster | ||
```bash | ||
sealer apply -f Clusterfile | ||
``` | ||
|
||
Note: `yurtadm init` only creates master nodes. For worker nodes, you should use `yurtadm join`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters