Skip to content

Commit f884b55

Browse files
authored
Update externally-managed-infrastructure docs (#122) (#123)
Added a callout and link to more documentation with more networking examples to better help users locate the more in-depth docs. fixes #121
1 parent 7b766aa commit f884b55

File tree

3 files changed

+53
-44
lines changed

3 files changed

+53
-44
lines changed

docs/src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
- [Install Cluster API for Oracle Cloud Infrastructure](./gs/install-cluster-api.md)
2020
- [Create Workload Cluster](./gs/create-workload-cluster.md)
2121
- [Create Workload Templates](./gs/create-workload-templates.md)
22-
- [Using externally managed infrastructure](./gs/externally-managed-infrastructure.md)
22+
- [Using externally managed infrastructure](./gs/externally-managed-cluster-infrastructure.md)
2323
- [Install Oracle Cloud Infrastructure Cloud Controller Manager](./gs/install-oci-ccm.md)
2424
- [Install Container Storage Interface (CSI)](./gs/install-csi.md)
2525
- [Provision a PVC on the Block Volume Service](./gs/pvc-bv.md)

docs/src/gs/externally-managed-infrastructure.md renamed to docs/src/gs/externally-managed-cluster-infrastructure.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,62 @@
1-
# Externally managed infrastructure
1+
# Externally managed Cluster infrastructure
22

33
By default, Cluster API will create resources on Oracle Cloud Infrastructure (OCI) when instantiating a new workload cluster. However, it is possible to have Cluster API re-use an existing OCI infrastructure instead of creating a new one. The existing infrastructure could include:
44

55
1. Virtual cloud networks (VCNs)
66
1. Network load balancers used as Kubernetes API Endpoint
77

8+
## Example spec for externally managed VCN infrastructure
9+
10+
CAPOCI can be used to create a cluster using existing VCN infrastructure. In this case, only the
11+
API Server Load Balancer will be managed by CAPOCI.
12+
13+
Example spec is given below
14+
15+
```yaml
16+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
17+
kind: OCICluster
18+
metadata:
19+
name: "${CLUSTER_NAME}"
20+
spec:
21+
compartmentId: "${OCI_COMPARTMENT_ID}"
22+
networkSpec:
23+
skipNetworkManagement: true
24+
vcn:
25+
id: <Insert VCN OCID Here>
26+
networkSecurityGroups:
27+
- id: <Insert Control Plane Endpoint NSG OCID Here>
28+
role: control-plane-endpoint
29+
name: control-plane-endpoint
30+
- id: <Insert Worker NSG OCID Here>
31+
role: worker
32+
name: worker
33+
- id: <Insert Control Plane NSG OCID Here>
34+
role: control-plane
35+
name: control-plane
36+
subnets:
37+
- id: <Insert Control Plane Endpoint Subnet OCID Here>
38+
role: control-plane-endpoint
39+
name: control-plane-endpoint
40+
- id: <Insert Worker Subnet OCID Here>
41+
role: worker
42+
name: worker
43+
- id: <Insert control Plane Subnet OCID Here>
44+
role: control-plane
45+
name: control-plane
46+
```
47+
48+
In the above spec, note that name has to be mentioned for Subnet/NSG. This is so that Kubernetes
49+
can merge the list properly when there is an update.
50+
51+
## Example `OCICluster` Spec with external infrastructure
52+
853
CAPOCI supports [externally managed cluster infrastructure](https://github.com/kubernetes-sigs/cluster-api/blob/10d89ceca938e4d3d94a1d1c2b60515bcdf39829/docs/proposals/20210203-externally-managed-cluster-infrastructure.md).
954

1055
If the `OCICluster` resource includes a `cluster.x-k8s.io/managed-by` annotation, then the [controller will skip any reconciliation](https://cluster-api.sigs.k8s.io/developer/providers/cluster-infrastructure.html#normal-resource).
1156

1257
This is useful for scenarios where a different persona is managing the cluster infrastructure out-of-band while still wanting to use CAPOCI for automated machine management.
1358

14-
## Example `OCICluster` Spec with external infrastructure
15-
16-
The following `OCICluster` Spec includes the mandatory fields to be specified for externally managed infrastructure to work properly.
59+
The following `OCICluster` Spec includes the mandatory fields to be specified for externally managed infrastructure to work properly. In this example neither the VCN nor the network load balancer will be managed by CAPOCI.
1760

1861
```yaml
1962
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
@@ -87,3 +130,4 @@ curl -o -s -X PATCH -H "Accept: application/json, */*" \
87130
https://<management-plane-api-endpoint>/apis/infrastructure.cluster.x-k8s.io/v1beta1/namespaces/<cluster-namespace>/ociclusters/<cluster-name>/status \
88131
--data '{"status":{"ready":true,"failureDomains":{"1":{"attributes":{"AvailabilityDomain":"zkJl:US-ASHBURN-1-AD-1"},"controlPlane":true},"2":{"attributes":{"AvailabilityDomain":"zkJl:US-ASHBURN-1-AD-2"},"controlPlane":true},"3":{"attributes":{"AvailabilityDomain":"zkJl:US-ASHBURN-1-AD-3"}}}}}'
89132
```
133+

docs/src/networking/custom-networking.md

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -275,45 +275,10 @@ Related documentation: [comparison of Security Lists and Network Security Groups
275275
276276
## Example spec for externally managed VCN infrastructure
277277
278-
CAPOCI can be used to create a cluster using existing VCN infrastructure. In this case, only the
279-
API Server Load Balancer will be managed by CAPOCI.
280-
281-
Example spec is given below
282-
283-
```yaml
284-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
285-
kind: OCICluster
286-
metadata:
287-
name: "${CLUSTER_NAME}"
288-
spec:
289-
compartmentId: "${OCI_COMPARTMENT_ID}"
290-
networkSpec:
291-
skipNetworkManagement: true
292-
vcn:
293-
id: <Insert VCN OCID Here>
294-
networkSecurityGroups:
295-
- id: <Insert Control Plane Endpoint NSG OCID Here>
296-
role: control-plane-endpoint
297-
name: control-plane-endpoint
298-
- id: <Insert Worker NSG OCID Here>
299-
role: worker
300-
name: worker
301-
- id: <Insert Control Plane NSG OCID Here>
302-
role: control-plane
303-
name: control-plane
304-
subnets:
305-
- id: <Insert Control Plane Endpoint Subnet OCID Here>
306-
role: control-plane-endpoint
307-
name: control-plane-endpoint
308-
- id: <Insert Worker Subnet OCID Here>
309-
role: worker
310-
name: worker
311-
- id: <Insert control Plane Subnet OCID Here>
312-
role: control-plane
313-
name: control-plane
278+
```admonish info
279+
See [externally managed infrastructure][externally-managed-cluster-infrastructure] for how to create a cluster
280+
using existing VCN infrastructure.
314281
```
315282

316-
In the above spec, note that name has to be mentioned for Subnet/NSG. This is so that Kubernetes
317-
can merge the list properly when there is an update.
318-
319283
[sl-vs-nsg]: https://docs.oracle.com/en-us/iaas/Content/Network/Concepts/securityrules.htm#comparison
284+
[externally-managed-cluster-infrastructure]: ../gs/externally-managed-cluster-infrastructure.md#example-spec-for-externally-managed-vcn-infrastructure

0 commit comments

Comments
 (0)