Fix the API version for cluster manifest and use --context instead of --cluster in the command line.
This commit is contained in:
@@ -113,7 +113,7 @@ Note that the file name should be `kubeconfig` since file name determines the na
|
|||||||
Now that the secret is created, we are ready to register the cluster. The YAML file for cluster will look like:
|
Now that the secret is created, we are ready to register the cluster. The YAML file for cluster will look like:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: v1beta1
|
apiVersion: federation/v1beta1
|
||||||
kind: Cluster
|
kind: Cluster
|
||||||
metadata:
|
metadata:
|
||||||
name: cluster1
|
name: cluster1
|
||||||
@@ -137,11 +137,11 @@ cluster.
|
|||||||
Assuming our YAML file is located at `/cluster1/cluster.yaml`, we can run the following command to register this cluster:
|
Assuming our YAML file is located at `/cluster1/cluster.yaml`, we can run the following command to register this cluster:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ kubectl create -f /cluster1/cluster.yaml --cluster=federation-cluster
|
$ kubectl create -f /cluster1/cluster.yaml --context=federation-cluster
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
By specifying `--cluster=federation-cluster`, we direct the request to federation apiserver.
|
By specifying `--context=federation-cluster`, we direct the request to federation apiserver.
|
||||||
we can ensure that the cluster registration was successful by running:
|
we can ensure that the cluster registration was successful by running:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
Reference in New Issue
Block a user