Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit 61d8594

Browse files
committed
Update README to reflect latest code and way for init
1 parent 3909011 commit 61d8594

File tree

1 file changed

+70
-32
lines changed

1 file changed

+70
-32
lines changed

docs/README.md

+70-32
Original file line numberDiff line numberDiff line change
@@ -22,65 +22,103 @@ cd cluster-api-provider-nested
2222
kind create cluster --name=capn
2323
```
2424

25-
### Install `cert-manager`
25+
### Clone CAPI and build `clusterctl` tool
2626

27-
Cert Manager is a soft dependency for the Cluster API components to enable mutating
28-
and validating webhooks to be auto deployed. For more detailed instructions
29-
go [Cert Manager Installion](https://cert-manager.io/docs/installation/kubernetes/#installing-with-regular-manifests).
27+
As a cluster API~(CAPI) provider, CAPN need build `clusterctl` tool
3028

3129
```shell
32-
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.3.1/cert-manager.yaml
30+
git clone [email protected]:kubernetes-sigs/cluster-api.git
31+
cd cluster-api
32+
make clusterctl
3333
```
3434

35-
### Clone CAPI and Deploy Dev release
35+
# Create Dev Repo
36+
mkdir -p ~/.cluster-api/dev-repository/
3637

37-
As a cluster API~(CAPI) provider, CAPN requires core components of CAPI to be setup.
38-
We need to deploy the unreleased version of CAPI for `v1alpha4` API support.
38+
# Update config for CAPI Beta
39+
cat <<EOF >>~/.cluster-api/dev-repository/config.yaml
40+
---
41+
providers:
42+
- name: "cluster-api"
43+
url: "https://github.com/kubernetes-sigs/cluster-api/releases/v0.4.0-beta.0/core-components.yaml"
44+
type: "CoreProvider"
45+
- name: "kubeadm"
46+
url: "https://github.com/kubernetes-sigs/cluster-api/releases/v0.4.0-beta.0/bootstrap-components.yaml"
47+
type: "BootstrapProvider"
48+
EOF
49+
50+
### Init control plane, infrastructure etc
3951

4052
```shell
41-
git clone [email protected]:kubernetes-sigs/cluster-api.git
42-
cd cluster-api
43-
make release-manifests
44-
# change feature flags on core
45-
sed -i'' -e 's@- --feature-gates=.*@- --feature-gates=MachinePool=false,ClusterResourceSet=true@' out/core-components.yaml
46-
kubectl apply -f out/core-components.yaml
47-
cd ..
53+
# ./bin/clusterctl init --core cluster-api:v0.4.0-beta.0 --control-plane nested:v0.1.0 --infrastructure nested:v0.1.0 --config ~/.cluster-api/dev-repository/config.yaml
4854
```
4955

50-
### Create Docker Images, Manifests and Load Images
56+
you should see something like:
57+
```
58+
Fetching providers
59+
Installing cert-manager Version="v1.1.0"
60+
Waiting for cert-manager to be available...
61+
Installing Provider="cluster-api" Version="v0.4.0-beta.0" TargetNamespace="capi-system"
62+
Installing Provider="bootstrap-kubeadm" Version="v0.4.0-beta.0" TargetNamespace="capi-kubeadm-bootstrap-system"
63+
Installing Provider="control-plane-nested" Version="v0.1.0" TargetNamespace="capn-nested-control-plane-system"
64+
Installing Provider="infrastructure-nested" Version="v0.1.0" TargetNamespace="capn-system"
5165
52-
```shell
53-
PULL_POLICY=Never TAG=dev make docker-build release-manifests
54-
kind load docker-image gcr.io/cluster-api-nested-controller-amd64:dev --name=capn
55-
kind load docker-image gcr.io/nested-controlplane-controller-amd64:dev --name=capn
66+
Your management cluster has been initialized successfully!
67+
68+
You can now create your first workload cluster by running the following:
69+
70+
clusterctl generate cluster [name] --kubernetes-version [version] | kubectl apply -f -
5671
```
5772

58-
### Deploy CAPN
73+
and wait for all pods to be `Running` before proceed to next step:
74+
```
75+
# kubectl get pods --all-namespaces
76+
NAMESPACE NAME READY STATUS RESTARTS AGE
77+
capi-kubeadm-bootstrap-system capi-kubeadm-bootstrap-controller-manager-c59c94d6f-l8f4v 1/1 Running 0 4m45s
78+
capi-system capi-controller-manager-6c555b545d-rtw8k 1/1 Running 0 4m46s
79+
capn-nested-control-plane-system capn-nested-control-plane-controller-manager-698c444c6d-nhddn 2/2 Running 0 4m45s
80+
capn-system capn-controller-manager-7f9757b67f-cp8d9 2/2 Running 0 4m43s
81+
cert-manager cert-manager-5597cff495-gwgr5 1/1 Running 0 5m7s
82+
cert-manager cert-manager-cainjector-bd5f9c764-vvbjf 1/1 Running 0 5m7s
83+
cert-manager cert-manager-webhook-5f57f59fbc-ccg5k 1/1 Running 0 5m7s
84+
kube-system coredns-74ff55c5b-9pspc 1/1 Running 0 6m16s
85+
kube-system coredns-74ff55c5b-nqnk9 1/1 Running 0 6m16s
86+
kube-system etcd-capn-control-plane 1/1 Running 0 6m29s
87+
kube-system kindnet-9g9z4 1/1 Running 0 6m16s
88+
kube-system kube-apiserver-capn-control-plane 1/1 Running 0 6m29s
89+
kube-system kube-controller-manager-capn-control-plane 1/1 Running 0 6m29s
90+
kube-system kube-proxy-jl46r 1/1 Running 0 6m16s
91+
kube-system kube-scheduler-capn-control-plane 1/1 Running 0 6m29s
92+
local-path-storage local-path-provisioner-78776bfc44-qcx49 1/1 Running 0 6m16s
93+
```
5994

60-
Next, we will deploy the CAPN related CRDs and controllers.
95+
### Set clustername (in our example, we set clustername to `cluster-sample`)
6196

6297
```shell
63-
kubectl apply -f out/cluster-api-provider-nested-components.yaml
98+
export CLUSTER_NAME=cluster-sample
6499
```
65100

66-
### Apply Sample Cluster
101+
### Generate custom resource (`Cluster`, `NestedCluster` etc) and apply to our cluster
67102

68103
```shell
69-
kubectl apply -f config/samples/
104+
# ./bin/clusterctl generate cluster ${CLUSTER_NAME} --infrastructure=nested:v0.1.0
70105
```
71106

72107
### Get `KUBECONFIG`
73108

74-
We will use the `clusterctl` command-line tool to generate the `KUBECONFIG`, which
75-
will be used to access the nested controlplane later.
76-
77109
```shell
78-
cd cluster-api
79-
make clusterctl
80-
./bin/clusterctl get kubeconfig cluster-sample > ../kubeconfig
81-
cd ..
110+
# ./bin/clusterctl get kubeconfig ${CLUSTER_NAME} > kubeconfig
111+
```
112+
113+
Note you might see following error, wait for a while and retry
114+
```
115+
Error: "cluster-sample-kubeconfig" not found in namespace "default": secrets "cluster-sample-kubeconfig" not found
82116
```
83117

118+
### Make sure `cluster-sample` related pods are running before proceed.
119+
120+
121+
84122
### Port Forward
85123

86124
To access the nested controlplane, in a separate shell, you will need

0 commit comments

Comments
 (0)