@@ -22,65 +22,103 @@ cd cluster-api-provider-nested
22
22
kind create cluster --name=capn
23
23
```
24
24
25
- ### Install ` cert-manager `
25
+ ### Clone CAPI and build ` clusterctl ` tool
26
26
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
30
28
31
29
``` 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
33
33
```
34
34
35
- ### Clone CAPI and Deploy Dev release
35
+ # Create Dev Repo
36
+ mkdir -p ~ /.cluster-api/dev-repository/
36
37
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
39
51
40
52
``` 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
48
54
```
49
55
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"
51
65
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 -
56
71
```
57
72
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
+ ```
59
94
60
- Next, we will deploy the CAPN related CRDs and controllers.
95
+ ### Set clustername (in our example, we set clustername to ` cluster-sample ` )
61
96
62
97
``` shell
63
- kubectl apply -f out/ cluster-api-provider-nested-components.yaml
98
+ export CLUSTER_NAME= cluster-sample
64
99
```
65
100
66
- ### Apply Sample Cluster
101
+ ### Generate custom resource ( ` Cluster ` , ` NestedCluster ` etc) and apply to our cluster
67
102
68
103
``` shell
69
- kubectl apply -f config/samples/
104
+ # ./bin/clusterctl generate cluster ${CLUSTER_NAME} --infrastructure=nested:v0.1.0
70
105
```
71
106
72
107
### Get ` KUBECONFIG `
73
108
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
-
77
109
``` 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
82
116
```
83
117
118
+ ### Make sure ` cluster-sample ` related pods are running before proceed.
119
+
120
+
121
+
84
122
### Port Forward
85
123
86
124
To access the nested controlplane, in a separate shell, you will need
0 commit comments