You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 28, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: proposals/20201026-creating-control-plane-components.md
+20-59Lines changed: 20 additions & 59 deletions
Original file line number
Diff line number
Diff line change
@@ -155,61 +155,19 @@ type NestedControlPlaneSpec struct {
155
155
}
156
156
```
157
157
158
-
After applying the NCP CR, the NCP controller will find the three associated components and set their `metav1.OwnerReference` as the NCP CR. Then, when creating the component workload, the component controller can find other CRs through the owner NCP.
158
+
After applying the NCP CR, the NCP controller will find the three associated components and set their `metav1.OwnerReference` as the NCP CR. Then, the component controller can find other CRs through the owner NCP, when creating the component workload.
159
159
160
160
### Creation
161
-
End-users can create component CRs manually and apply them to the cluster with an NCP to create the resources. In the future, we might introduce the `Template` CR, which will handle the creation of the component CRs in it's controller. If the end-user intend to use out-of-tree controllers, they can specify them in the NCP spec, we define three new types:
End-users can create component CRs manually and apply them to the cluster with an NCP to create the resources. In the future, we might introduce the `Template` CR, which will handle the creation of the component CRs in it's controller. We assume that at any given time, there will be only component controller for each component, and it is cluster administrator's responsibility to setup the proper component controllers.
180
163
181
-
and adds three new fields into the NCP spec:
164
+
#### In-tree
182
165
183
-
```go
184
-
typeNestedControlPlaneSpecstruct {
185
-
// other fields ...
186
-
187
-
// EtcdProvider specifies which EtcdProvider will be used to create the Etcd
If no component provider is specified, the component controller will create the component under the native mode, which will create the component using the default manifests. The readiness and liveness probe will be used, and we will mark each component as ready only when the corresponding workload is ready. As the KAS cannot work without available Etcd and the KCM cannot run without KAS, the three components need to be created by their respective controllers in the order of Etcd, KAS, and KCM. Creation order is maintained using cross resource status checks to "wait" until the dependencies are provisioned before booting.
205
-
206
-
Except using `OwnerReference` and `CAPI.Status.Selector`, another option of sharing status across components are adding initContainer to each component. The component controllers will then create the component workload without polling the status of other CRs while having the initContainer to check and wait for other components to be ready.
207
-
208
-
We will host sets of default templates in this repositor. Users can specify which set of templates they intend to use by specifying the corresponding `version` or `channel` in the embedded `CommonSpec` in the component's CR.
166
+
The component controller will create the component under the in-tree mode, which will create the component using the default manifests. The readiness and liveness probe will be used, and we will mark each component as ready only when the corresponding workload is ready. As the KAS cannot work without available Etcd and the KCM cannot run without KAS, the three components need to be created by their respective controllers in the order of Etcd, KAS, and KCM. Creation order is maintained using cross resource status checks to "wait" until the dependencies are provisioned before booting. We will host sets of default templates in this repository. Users can specify which set of templates they intend to use by specifying the corresponding `version` or `channel` in the embedded `CommonSpec` in the component's CR.
209
167
210
168
Each component's controller will generate necessary certificates for the component and store them to the [secret resources](https://cluster-api.sigs.k8s.io/tasks/certs/using-custom-certificates.html) defined by CAPI. Also, The KAS controller will store the content of the kubeconfig file in a secret named `[clustername]-kubeconfig`.
211
169
212
-

170
+

213
171
214
172
The creating process will include six steps:
215
173
@@ -225,24 +183,27 @@ The creating process will include six steps:
225
183
226
184
#### Using out-of-tree provisioners
227
185
228
-
If users intend to use an external component controller, they can disable any or all of the component controllers within the CAPN Manager. For example, if you wanted to use the [etcd-cluster-operator](https://github.com/improbable-eng/etcd-cluster-operator) this requires the [EtcdCluster](https://github.com/improbable-eng/etcd-cluster-operator/blob/master/api/v1alpha1/etcdcluster_types.go) CR. To support this you would implement a custom controller that listens for `Etcd` resource and will create the necessary CRs for that implementation and update the required status fields on `Etcd` to allow dependent services to be provisioned. This can be done using the [kubebuilder-declarative-pattern](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern) like is done for in-tree component controllers.
186
+
If users intend to use an external component controller, they can disable any or all of the component controllers within the CAPN Manager. For example, if you wanted to use the [etcd-cluster-operator](https://github.com/improbable-eng/etcd-cluster-operator) this requires the [EtcdCluster](https://github.com/improbable-eng/etcd-cluster-operator/blob/master/api/v1alpha1/etcdcluster_types.go) CR. To support this you would implement a custom controller that listens for `NestedEtcd` resource and will create the necessary CRs for that implementation and update the required status fields on `NestedEtcd` to allow dependent services to be provisioned. This can be done using the [kubebuilder-declarative-pattern](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern) like is done for in-tree component controllers.
229
187
230
-
In the following example, we assume that the user intend to use Etcd-cluster-operator(ECO) as the Etcd controller, and an ECO controller has been deployed on the super cluster. The creating process will include seven steps:
231
188

232
189
233
-
1. The user generates all CRs and apply them.
190
+
In the following example, we assume that the user intend to use Etcd-cluster-operator(ECO) as the Etcd controller. The creating process will include seven steps:
191
+
192
+
1. The cluster administrator deletes the in-tree Etcd controller and deploys the custom Etcd controller (ECO controller).
193
+
194
+
2. The user generates all CRs and apply them.
234
195
235
-
2. As the user chooses to use the etcd-cluster-operator(ECO), the ECO controller will create the EtcdCluster CR
196
+
3. As the user chooses to use the etcd-cluster-operator(ECO), the ECO controller will create the EtcdCluster CR.
236
197
237
-
3. The ECO creates the Etcd workload.
198
+
4. The ECO creates the Etcd workload.
238
199
239
-
4. At the meantime, the ECO controller keeps watching the EtcdCluster CR, stores the Etcd CA into the `secret/[cluster-name]-etcd`, and update the `Etcd` CR accordingly.
200
+
5. At the meantime, the ECO controller keeps watching the EtcdCluster CR, stores the Etcd CA into the `secret/[cluster-name]-etcd`, and update the `Etcd` CR accordingly.
240
201
241
-
5. The KAS controller creates the KAS service, generates certificates, creates the KAS workload, stores certificates into `secret/[cluster-name]-ca`, creates the kubeconfig and stores it into the `secret/[cluster-name]-kubeconfig`
202
+
6. The KAS controller creates the KAS service, generates certificates, creates the KAS workload, stores certificates into `secret/[cluster-name]-ca`, creates the kubeconfig and stores it into the `secret/[cluster-name]-kubeconfig`
242
203
243
-
6. The KCM controller generates the KCM kubeconfig and creates the KCM workload.
204
+
7. The KCM controller generates the KCM kubeconfig and creates the KCM workload.
244
205
245
-
7. Once all the three components are ready, the NCP controller marks the NCP CR as ready.
206
+
8. Once all the three components are ready, the NCP controller marks the NCP CR as ready.
246
207
247
208
### Control Plane Custom Resources
248
209
@@ -273,7 +234,7 @@ type NestedEtcdStatus struct {
0 commit comments