Skip to content

Commit b13ade5

Browse files
committed
Do not need to clone the repo before test
1 parent b310408 commit b13ade5

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

docs/README.md

+17-24
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,17 @@ a `kind` cluster as the management cluster as well as the nested workload cluste
99
Please install the latest version of [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
1010
and [kubectl](https://kubernetes.io/docs/tasks/tools/)
1111

12-
### Clone CAPN
13-
14-
```shell
15-
git clone https://github.com/kubernetes-sigs/cluster-api-provider-nested
16-
cd cluster-api-provider-nested
17-
```
18-
1912
### Create `kind` cluster
2013

21-
```shell
14+
```console
2215
kind create cluster --name=capn
2316
```
2417

2518
### Clone CAPI and build `clusterctl` tool
2619

2720
As a Cluster API (CAPI) provider, CAPN needs the `clusterctl` binary to install and manage clusters.
2821

29-
```shell
22+
```console
3023
git clone [email protected]:kubernetes-sigs/cluster-api.git
3124
cd cluster-api
3225
make clusterctl
@@ -36,7 +29,7 @@ make clusterctl
3629

3730
If you aren't familar with CAPI & `clusterctl` this command will deploy the core components, as well as the Nested components for infra providers and for control plane providers.
3831

39-
```shell
32+
```console
4033
./bin/clusterctl init --core cluster-api:v0.4.0 --control-plane nested:v0.1.0 --infrastructure nested:v0.1.0
4134
```
4235

@@ -58,8 +51,8 @@ You can now create your first workload cluster by running the following:
5851
```
5952

6053
and wait for all pods to be `Running` before proceed to next step:
61-
```
62-
kubectl get pods --all-namespaces
54+
```console
55+
$ kubectl get pods --all-namespaces
6356
NAMESPACE NAME READY STATUS RESTARTS AGE
6457
capi-kubeadm-bootstrap-system capi-kubeadm-bootstrap-controller-manager-c59c94d6f-l8f4v 1/1 Running 0 4m45s
6558
capi-system capi-controller-manager-6c555b545d-rtw8k 1/1 Running 0 4m46s
@@ -81,13 +74,13 @@ local-path-storage local-path-provisioner-78776bfc44-qcx49
8174

8275
### Set clustername (in our example, we set clustername to `cluster-sample`)
8376

84-
```shell
77+
```console
8578
export CLUSTER_NAME=cluster-sample
8679
```
8780

8881
### Generate custom resource (`Cluster`, `NestedCluster` etc) and apply to our cluster
8982

90-
```shell
83+
```console
9184
./bin/clusterctl generate cluster ${CLUSTER_NAME} --infrastructure=nested:v0.1.0 | kubectl apply -f -
9285
```
9386

@@ -96,7 +89,7 @@ export CLUSTER_NAME=cluster-sample
9689
We will use the `clusterctl` command-line tool to generate the `KUBECONFIG`, which
9790
will be used to access the nested controlplane later.
9891

99-
```shell
92+
```console
10093
./bin/clusterctl get kubeconfig ${CLUSTER_NAME} > ../kubeconfig
10194
```
10295

@@ -106,16 +99,16 @@ Error: "cluster-sample-kubeconfig" not found in namespace "default": secrets "cl
10699
```
107100

108101
Run following command and make sure the `Ready` is true before retry above command.
109-
```
110-
kubectl get nestedcluster -w
102+
```console
103+
$ kubectl get nestedcluster -w
111104
NAME READY AGE
112105
cluster-sample true 26h
113106
```
114107

115108
### Make sure `cluster-sample` related pods are running before proceed.
116109

117-
```
118-
kubectl get pods
110+
```console
111+
$ kubectl get pods
119112
NAME READY STATUS RESTARTS AGE
120113
cluster-sample-apiserver-0 1/1 Running 0 25h
121114
cluster-sample-controller-manager-0 1/1 Running 0 25h
@@ -127,8 +120,8 @@ cluster-sample-etcd-0 1/1 Running 0 25h
127120
To access the nested controlplane, in a separate shell, you will need
128121
to `port-forward` the apiserver service.
129122

130-
```shell
131-
kubectl port-forward svc/cluster-sample-apiserver 6443:6443
123+
```console
124+
$ kubectl port-forward svc/cluster-sample-apiserver 6443:6443
132125
Forwarding from 127.0.0.1:6443 -> 6443
133126
Forwarding from [::1]:6443 -> 6443
134127
```
@@ -145,15 +138,15 @@ following line to `/etc/hosts`.
145138

146139
### Connect to the Cluster! :tada:
147140

148-
```shell
149-
kubectl --kubeconfig kubeconfig get all -A
141+
```console
142+
$ kubectl --kubeconfig kubeconfig get all -A
150143
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
151144
default service/kubernetes ClusterIP 10.32.0.1 <none> 443/TCP 25h
152145

153146
```
154147

155148
### Clean Up
156149

157-
```shell
150+
```console
158151
kind delete cluster --name=capn
159152
```

0 commit comments

Comments
 (0)