Skip to content

Commit 5f2445a

Browse files
Update test files and template form bump to v1beta2 (#233)
* Update templates and test files to bump to v1beta2 api version
1 parent f620d39 commit 5f2445a

File tree

86 files changed

+3031
-2872
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+3031
-2872
lines changed

Makefile

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -272,26 +272,26 @@ serve-book: build-book ## Build and serve the book with live-reloading enabled
272272

273273
.PHONY: generate-e2e-templates ## Generate OCI infrastructure templates for e2e test suite.
274274
generate-e2e-templates: $(KUSTOMIZE)
275-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template.yaml
276-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-alternative-region --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-alternative-region.yaml
277-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-bare-metal --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-bare-metal.yaml
278-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-md-remediation --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-md-remediation.yaml
279-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-kcp-remediation --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-kcp-remediation.yaml
280-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-node-drain --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-node-drain.yaml
281-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-antrea --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-antrea.yaml
282-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-oracle-linux --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-oracle-linux.yaml
283-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-custom-networking-seclist --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-custom-networking-seclist.yaml
275+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template.yaml
276+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-alternative-region --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-alternative-region.yaml
277+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-bare-metal --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-bare-metal.yaml
278+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-md-remediation --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-md-remediation.yaml
279+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-kcp-remediation --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-kcp-remediation.yaml
280+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-node-drain --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-node-drain.yaml
281+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-antrea --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-antrea.yaml
282+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-oracle-linux --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-oracle-linux.yaml
283+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-custom-networking-seclist --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-custom-networking-seclist.yaml
284284
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-custom-networking-nsg --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-custom-networking-nsg.yaml
285-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-multiple-node-nsg --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-multiple-node-nsg.yaml
286-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-cluster-class --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-cluster-class.yaml
287-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-local-vcn-peering --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-local-vcn-peering.yaml
288-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-remote-vcn-peering --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-remote-vcn-peering.yaml
289-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-externally-managed-vcn --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-externally-managed-vcn.yaml
290-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-machine-pool --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-machine-pool.yaml
291-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-managed --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-managed.yaml
292-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-managed-cluster-identity --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-managed-cluster-identity.yaml
293-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-cluster-identity --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-cluster-identity.yaml
294-
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta1/cluster-template-windows-calico --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta1/cluster-template-windows-calico.yaml
285+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-multiple-node-nsg --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-multiple-node-nsg.yaml
286+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-cluster-class --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-cluster-class.yaml
287+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-local-vcn-peering --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-local-vcn-peering.yaml
288+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-remote-vcn-peering --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-remote-vcn-peering.yaml
289+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-externally-managed-vcn --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-externally-managed-vcn.yaml
290+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-machine-pool --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-machine-pool.yaml
291+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-managed --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-managed.yaml
292+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-managed-cluster-identity --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-managed-cluster-identity.yaml
293+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-cluster-identity --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-cluster-identity.yaml
294+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-windows-calico --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-windows-calico.yaml
295295

296296
.PHONY: test-e2e-run
297297
test-e2e-run: generate-e2e-templates $(GINKGO) $(ENVSUBST) ## Run e2e tests

api/v1beta1/ocicluster_conversion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"sigs.k8s.io/controller-runtime/pkg/conversion"
2323
)
2424

25-
// ConvertTo converts the v1beta1 AWSCluster receiver to a v1beta2 AWSCluster.
25+
// ConvertTo converts the v1beta1 OCICluster receiver to a v1beta2 OCICluster.
2626
func (src *OCICluster) ConvertTo(dstRaw conversion.Hub) error {
2727
dst := dstRaw.(*v1beta2.OCICluster)
2828

docs/src/gs/create-gpu-workload-cluster.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ spec:
199199
cidrBlocks:
200200
- ${SERVICE_CIDR:="10.128.0.0/12"}
201201
infrastructureRef:
202-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
202+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
203203
kind: OCICluster
204204
name: "${CLUSTER_NAME}"
205205
namespace: "${NAMESPACE}"
@@ -209,7 +209,7 @@ spec:
209209
name: "${CLUSTER_NAME}-control-plane"
210210
namespace: "${NAMESPACE}"
211211
---
212-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
212+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
213213
kind: OCICluster
214214
metadata:
215215
labels:
@@ -229,7 +229,7 @@ spec:
229229
machineTemplate:
230230
infrastructureRef:
231231
kind: OCIMachineTemplate
232-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
232+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
233233
name: "${CLUSTER_NAME}-control-plane"
234234
namespace: "${NAMESPACE}"
235235
kubeadmConfigSpec:
@@ -256,7 +256,7 @@ spec:
256256
provider-id: oci://{{ ds["id"] }}
257257
---
258258
kind: OCIMachineTemplate
259-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
259+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
260260
metadata:
261261
name: "${CLUSTER_NAME}-control-plane"
262262
spec:
@@ -271,7 +271,7 @@ spec:
271271
ssh_authorized_keys: "${OCI_SSH_KEY}"
272272
isPvEncryptionInTransitEnabled: ${OCI_CONTROL_PLANE_PV_TRANSIT_ENCRYPTION=true}
273273
---
274-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
274+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
275275
kind: OCIMachineTemplate
276276
metadata:
277277
name: "${CLUSTER_NAME}-md"
@@ -320,7 +320,7 @@ spec:
320320
kind: KubeadmConfigTemplate
321321
infrastructureRef:
322322
name: "${CLUSTER_NAME}-md"
323-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
323+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
324324
kind: OCIMachineTemplate
325325
# Cluster-API calls them Failure Domains while OCI calls them Availability Domains
326326
# In the example this would be targeting US-ASHBURN-AD-2

docs/src/gs/customize-worker-node.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Use the following configuration in `OCIMachineTemplate` to use a [customer
44
managed boot volume encryption key][customer_managed_keys].
55
```yaml
66
kind: OCIMachineTemplate
7-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
7+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
88
spec:
99
template:
1010
spec:
@@ -19,7 +19,7 @@ for an enumeration of all the possible configurations.
1919

2020
```yaml
2121
kind: OCIMachineTemplate
22-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
22+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
2323
spec:
2424
template:
2525
spec:
@@ -38,7 +38,7 @@ for an enumeration of all the possible configurations.
3838

3939
```yaml
4040
kind: OCIMachineTemplate
41-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
41+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
4242
spec:
4343
template:
4444
spec:
@@ -52,7 +52,7 @@ Use the following configuration in `OCIMachineTemplate` to create [preemtible in
5252

5353
```yaml
5454
kind: OCIMachineTemplate
55-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
55+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
5656
spec:
5757
template:
5858
spec:
@@ -66,7 +66,7 @@ Use the following configuration in `OCIMachineTemplate` to use [capacity reserva
6666

6767
```yaml
6868
kind: OCIMachineTemplate
69-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
69+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
7070
spec:
7171
template:
7272
spec:
@@ -79,7 +79,7 @@ The example below enables Bastion plugin.
7979

8080
```yaml
8181
kind: OCIMachineTemplate
82-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
82+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
8383
spec:
8484
template:
8585
spec:
@@ -98,7 +98,7 @@ The following values are supported for `baselineOcpuUtilization`.
9898

9999
```yaml
100100
kind: OCIMachineTemplate
101-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
101+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
102102
spec:
103103
template:
104104
spec:

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

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ API Server Load Balancer will be managed by CAPOCI.
1313
Example spec is given below
1414

1515
```yaml
16-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
16+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
1717
kind: OCICluster
1818
metadata:
1919
name: "${CLUSTER_NAME}"
@@ -23,16 +23,17 @@ spec:
2323
skipNetworkManagement: true
2424
vcn:
2525
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
26+
networkSecurityGroup:
27+
list:
28+
- id: <Insert Control Plane Endpoint NSG OCID Here>
29+
role: control-plane-endpoint
30+
name: control-plane-endpoint
31+
- id: <Insert Worker NSG OCID Here>
32+
role: worker
33+
name: worker
34+
- id: <Insert Control Plane NSG OCID Here>
35+
role: control-plane
36+
name: control-plane
3637
subnets:
3738
- id: <Insert Control Plane Endpoint Subnet OCID Here>
3839
role: control-plane-endpoint
@@ -59,7 +60,7 @@ This is useful for scenarios where a different persona is managing the cluster i
5960
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.
6061

6162
```yaml
62-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
63+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
6364
kind: OCICluster
6465
metadata:
6566
labels:
@@ -77,13 +78,14 @@ spec:
7778
loadBalancerId: <OCID of Control Plane Endpoint LoadBalancer>
7879
vcn:
7980
id: <OCID of VCN>
80-
networkSecurityGroups:
81-
- id: <OCID of Control Plane NSG>
82-
name: <Name of Control Plane NSG>
83-
role: control-plane
84-
- id: <OCID of Worker NSG>
85-
name: <Name of Worker NSG>
86-
role: worker
81+
networkSecurityGroup:
82+
list:
83+
- id: <OCID of Control Plane NSG>
84+
name: <Name of Control Plane NSG>
85+
role: control-plane
86+
- id: <OCID of Worker NSG>
87+
name: <Name of Worker NSG>
88+
role: worker
8789
subnets:
8890
- id: <OCID of Control Plane Subnet>
8991
role: control-plane
@@ -115,7 +117,7 @@ curl -o -s -X PATCH -H "Accept: application/json, */*" \
115117
--cacert ca.crt \
116118
--cert client.crt \
117119
--key client.key \
118-
https://<management-plane-api-endpoint>/apis/infrastructure.cluster.x-k8s.io/v1beta1/namespaces/<cluster-namespace>/ociclusters/<cluster-name>/status \
120+
https://<management-plane-api-endpoint>/apis/infrastructure.cluster.x-k8s.io/v1beta2/namespaces/<cluster-namespace>/ociclusters/<cluster-name>/status \
119121
--data '{"status":{"ready":true,"failureDomains":{"1":{"attributes":{"AvailabilityDomain":"zkJl:AP-HYDERABAD-1-AD-1","FaultDomain":"FAULT-DOMAIN-1"},"controlPlane":true},"2":{"attributes":{"AvailabilityDomain":"zkJl:AP-HYDERABAD-1-AD-1","FaultDomain":"FAULT-DOMAIN-2"},"controlPlane":true},"3":{"attributes":{"AvailabilityDomain":"zkJl:AP-HYDERABAD-1-AD-1","FaultDomain":"FAULT-DOMAIN-3"}}}}}'
120122
```
121123

@@ -127,7 +129,7 @@ curl -o -s -X PATCH -H "Accept: application/json, */*" \
127129
--cacert ca.crt \
128130
--cert client.crt \
129131
--key client.key \
130-
https://<management-plane-api-endpoint>/apis/infrastructure.cluster.x-k8s.io/v1beta1/namespaces/<cluster-namespace>/ociclusters/<cluster-name>/status \
132+
https://<management-plane-api-endpoint>/apis/infrastructure.cluster.x-k8s.io/v1beta2/namespaces/<cluster-namespace>/ociclusters/<cluster-name>/status \
131133
--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"}}}}}'
132134
```
133135

docs/src/gs/multi-tenancy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spec:
4444
namespace: default
4545
allowedNamespaces: {}
4646
---
47-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
47+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
4848
kind: OCICluster
4949
metadata:
5050
labels:
@@ -53,7 +53,7 @@ metadata:
5353
spec:
5454
compartmentId: "${OCI_COMPARTMENT_ID}"
5555
identityRef:
56-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
56+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
5757
kind: OCIClusterIdentity
5858
name: cluster-identity
5959
namespace: default

docs/src/managed/networking.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ spec:
1111
skipNetworkManagement: true
1212
vcn:
1313
id: "<vcn-id>"
14-
networkSecurityGroups:
15-
- id: "<control-plane-endpoint-nsg-id>"
16-
role: control-plane-endpoint
17-
name: control-plane-endpoint
18-
- id: "<worker-nsg-id>"
19-
role: worker
20-
name: worker
21-
- id: "<pod-nsg-id>"
22-
role: pod
23-
name: pod
14+
networkSecurityGroup:
15+
list:
16+
- id: "<control-plane-endpoint-nsg-id>"
17+
role: control-plane-endpoint
18+
name: control-plane-endpoint
19+
- id: "<worker-nsg-id>"
20+
role: worker
21+
name: worker
22+
- id: "<pod-nsg-id>"
23+
role: pod
24+
name: pod
2425
subnets:
2526
- id: "<control-plane-endpoint-subnet-id>"
2627
role: control-plane-endpoint

0 commit comments

Comments
 (0)