Skip to content

Commit 2b9dead

Browse files
sindhusri16joekrPeizhao Li
authored
Feat: VCN Native CNI Changes (#407)
* bug: Update the CRDs for the workrequest feature (#387) This was left out of the previous feature add. * changes to uptake go-v1.22.9 * manifests generated with new controller gen * Feat: API Spec & CRD & Conversion for VCN Native Params * Feat: NPN CR Reconciliation in OCIMachine_controller * Fix: Add common label for compatibility & remove non-related crd changes from open source * Revert "Fix: Add common label for compatibility & remove non-related crd changes from open source" This reverts commit f816852. * Fix: Improve NPN CR Reconcile * Fix: Kube Client Creation * Fix: Update CNI Type String * Fix: Return nil upon retry * Fix: unused var * Fix: improve logging and error display * Fix: Use different CR for get and create * Feat: include the NPN Reconcile into client scope package * Style: Remove Redudant Const * Feat: Move CniType to OCICluster * Image build * Image build * Image build * Logging update --------- Co-authored-by: Joe Kratzat <joekr@users.noreply.github.com> Co-authored-by: Peizhao Li <peizhao.li@oracle.com>
1 parent a0ced3d commit 2b9dead

28 files changed

+5421
-6218
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.21.8 as builder
2+
FROM golang:1.22.9 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ envsubst: $(ENVSUBST) ## Build a local copy of envsubst.
369369
kubectl: $(KUBECTL) ## Build a local copy of kubectl.
370370

371371
$(CONTROLLER_GEN): ## Download controller-gen locally if necessary.
372-
GOBIN=$(BIN_DIR)/ $(GO_INSTALL) sigs.k8s.io/controller-tools/cmd/controller-gen $(CONTROLLER_GEN_BIN) v0.13.0
372+
GOBIN=$(BIN_DIR)/ $(GO_INSTALL) sigs.k8s.io/controller-tools/cmd/controller-gen $(CONTROLLER_GEN_BIN) v0.14.0
373373

374374
$(CONVERSION_GEN): ## Download controller-gen locally if necessary.
375375
GOBIN=$(BIN_DIR)/ $(GO_INSTALL) k8s.io/code-generator/cmd/conversion-gen $(CONVERSION_GEN_BIN) v0.23.1

api/v1beta1/ocicluster_conversion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func (src *OCICluster) ConvertTo(dstRaw conversion.Hub) error {
4848
dst.Spec.NetworkSpec.Vcn.InternetGateway.Skip = restored.Spec.NetworkSpec.Vcn.InternetGateway.Skip
4949
dst.Spec.NetworkSpec.Vcn.RouteTable.Skip = restored.Spec.NetworkSpec.Vcn.RouteTable.Skip
5050
dst.Spec.NetworkSpec.APIServerLB.LoadBalancerType = restored.Spec.NetworkSpec.APIServerLB.LoadBalancerType
51+
dst.Spec.NetworkSpec.CniType = restored.Spec.NetworkSpec.CniType
5152
dst.Spec.ClientOverrides = restored.Spec.ClientOverrides
5253

5354
return nil

api/v1beta1/ocimachine_types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,17 @@ type OCIMachineSpec struct {
145145
// Specifies whether to delete or preserve the data volumes created during launch when
146146
//terminating an instance. When set to true, the data volumes are preserved. The default value is true.
147147
PreserveDataVolumesCreatedAtLaunch bool `json:"preserveDataVolumesCreatedAtLaunch,omitempty"`
148+
149+
// Specifies the list of pod subnets being used for the VCN IP NATIVE CNI type for pod networking.
150+
// Set on each NPN CR associated with the OCI Machine.
151+
PodSubnetIds []string `json:"podSubnetIds,omitempty"`
152+
153+
// Specifies the maximum number of pods allowed for each node, decided by the shape
154+
MaxPodPerNode int `json:"maxPodCount,omitempty"`
155+
156+
// Specifies the list of Network Security Groups used for the VCN IP NATIVE CNI type for pod networking.
157+
// Set on each NPN CR associated with the OCI Machine.
158+
PodNSGIds []string `json:"podNsgIds,omitempty"`
148159
}
149160

150161
// OCIMachineStatus defines the observed state of OCIMachine.

api/v1beta1/types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,9 @@ type NetworkSpec struct {
10091009
// VCNPeering configuration.
10101010
// +optional
10111011
VCNPeering *VCNPeering `json:"vcnPeering,omitempty"`
1012+
1013+
// The CNI to be used are OCI_VCN_IP_NATIVE and FLANNEL_OVERLAY
1014+
CniType CNIOptionEnum `json:"cniType,omitempty"`
10121015
}
10131016

10141017
// VCNPeering defines the VCN peering details of the workload cluster VCN.

api/v1beta1/zz_generated.conversion.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta2/ocimachine_types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ type OCIMachineSpec struct {
139139
// Specifies whether to delete or preserve the data volumes created during launch when
140140
//terminating an instance. When set to true, the data volumes are preserved. The default value is true.
141141
PreserveDataVolumesCreatedAtLaunch bool `json:"preserveDataVolumesCreatedAtLaunch,omitempty"`
142+
143+
// Specifies the list of pod subnets being used for the VCN IP NATIVE CNI type for pod networking.
144+
// Set on each NPN CR associated with the OCI Machine.
145+
PodSubnetIds []string `json:"podSubnetIds,omitempty"`
146+
147+
// Specifies the maximum number of pods allowed for each node, decided by the shape
148+
MaxPodPerNode int `json:"maxPodCount,omitempty"`
149+
150+
// Specifies the list of Network Security Groups used for the VCN IP NATIVE CNI type for pod networking.
151+
// Set on each NPN CR associated with the OCI Machine.
152+
PodNSGIds []string `json:"podNsgIds,omitempty"`
142153
}
143154

144155
// OCIMachineStatus defines the observed state of OCIMachine.

api/v1beta2/types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,9 @@ type NetworkSpec struct {
10181018
// VCNPeering configuration.
10191019
// +optional
10201020
VCNPeering *VCNPeering `json:"vcnPeering,omitempty"`
1021+
1022+
// The CNI to be used are OCI_VCN_IP_NATIVE and FLANNEL_OVERLAY
1023+
CniType CNIOptionEnum `json:"cniType,omitempty"`
10211024
}
10221025

10231026
// VCNPeering defines the VCN peering details of the workload cluster VCN.

api/v1beta2/zz_generated.deepcopy.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)