Skip to content

Commit 3cab342

Browse files
Self managed nodes move oke from exp (#298)
* OKE self managed nodes and move OKE out of experimental
1 parent 8cde3ee commit 3cab342

File tree

80 files changed

+4100
-3139
lines changed

Some content is hidden

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

80 files changed

+4100
-3139
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ COPY version/ version/
2222
# Build
2323
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -ldflags "${LDFLAGS} -extldflags '-static'" -o manager ${package}
2424

25-
FROM ghcr.io/oracle/oraclelinux:8-slim
25+
FROM ghcr.io/oracle/oraclelinux:9-slim
2626
WORKDIR /
2727
COPY --from=builder /workspace/manager .
2828
USER 65532:65532

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ generate-e2e-templates: $(KUSTOMIZE)
294294
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-cluster-identity --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-cluster-identity.yaml
295295
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-windows-calico --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-windows-calico.yaml
296296
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-managed-virtual --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-managed-virtual.yaml
297+
$(KUSTOMIZE) build $(OCI_TEMPLATES)/v1beta2/cluster-template-managed-self-managed-nodes --load-restrictor LoadRestrictionsNone > $(OCI_TEMPLATES)/v1beta2/cluster-template-managed-self-managed-nodes.yaml
297298

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

api/v1beta1/constants.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ const (
2828
ControlPlaneDefaultName = "control-plane"
2929
WorkerDefaultName = "worker"
3030
ServiceLBDefaultName = "service-lb"
31+
PodDefaultName = "pod"
32+
PodDefaultCIDR = "10.0.128.0/18"
3133
)

api/v1beta1/conversion.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,24 @@ func Convert_v1beta1_OCIMachineSpec_To_v1beta2_OCIMachineSpec(in *OCIMachineSpec
121121
}
122122

123123
// Convert_v1beta2_LoadBalancer_To_v1beta1_LoadBalancer converts v1beta2 LoadBalancer to v1beta1 LoadBalancer
124-
125124
func Convert_v1beta2_LoadBalancer_To_v1beta1_LoadBalancer(in *v1beta2.LoadBalancer, out *LoadBalancer, s conversion.Scope) error {
126125
return autoConvert_v1beta2_LoadBalancer_To_v1beta1_LoadBalancer(in, out, s)
127126
}
127+
128+
func Convert_v1beta2_OCIManagedControlPlaneStatus_To_v1beta1_OCIManagedControlPlaneStatus(in *v1beta2.OCIManagedControlPlaneStatus, out *OCIManagedControlPlaneStatus, s conversion.Scope) error {
129+
return autoConvert_v1beta2_OCIManagedControlPlaneStatus_To_v1beta1_OCIManagedControlPlaneStatus(in, out, s)
130+
}
131+
132+
func Convert_v1beta2_OCIManagedControlPlaneSpec_To_v1beta1_OCIManagedControlPlaneSpec(in *v1beta2.OCIManagedControlPlaneSpec, out *OCIManagedControlPlaneSpec, s conversion.Scope) error {
133+
return autoConvert_v1beta2_OCIManagedControlPlaneSpec_To_v1beta1_OCIManagedControlPlaneSpec(in, out, s)
134+
}
135+
136+
// Convert_v1beta1_OCIManagedClusterStatus_To_v1beta2_OCIManagedClusterStatus converts v1beta1 OCIManagedClusterStatus to v1beta2 OCIManagedClusterStatus
137+
func Convert_v1beta1_OCIManagedClusterStatus_To_v1beta2_OCIManagedClusterStatus(in *OCIManagedClusterStatus, out *v1beta2.OCIManagedClusterStatus, s conversion.Scope) error {
138+
return autoConvert_v1beta1_OCIManagedClusterStatus_To_v1beta2_OCIManagedClusterStatus(in, out, s)
139+
}
140+
141+
// Convert_v1beta2_OCIManagedClusterSpec_To_v1beta1_OCIManagedClusterSpec converts v1beta1 OCIManagedClusterSpec to v1beta2 OCIManagedClusterSpec
142+
func Convert_v1beta2_OCIManagedClusterSpec_To_v1beta1_OCIManagedClusterSpec(in *v1beta2.OCIManagedClusterSpec, out *OCIManagedClusterSpec, s conversion.Scope) error {
143+
return autoConvert_v1beta2_OCIManagedClusterSpec_To_v1beta1_OCIManagedClusterSpec(in, out, s)
144+
}

api/v1beta1/conversion_test.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} {
3434
OCIMachineTemplateFuzzer,
3535
OCIClusterFuzzer,
3636
OCIClusterTemplateFuzzer,
37+
OCIManagedClusterFuzzer,
3738
}
3839
}
3940

@@ -93,6 +94,28 @@ func OCIMachineTemplateFuzzer(obj *OCIMachineTemplate, c fuzz.Continue) {
9394
obj.Spec.Template.Spec.NSGName = ""
9495
}
9596

97+
func OCIManagedClusterFuzzer(obj *OCIManagedCluster, c fuzz.Continue) {
98+
c.FuzzNoCustom(obj)
99+
// nil fields which have been removed so that tests dont fail
100+
for _, nsg := range obj.Spec.NetworkSpec.Vcn.NetworkSecurityGroups {
101+
if nsg != nil {
102+
ingressRules := make([]IngressSecurityRuleForNSG, len(nsg.IngressRules))
103+
for _, rule := range nsg.IngressRules {
104+
rule.ID = nil
105+
ingressRules = append(ingressRules, rule)
106+
}
107+
nsg.IngressRules = ingressRules
108+
109+
egressRules := make([]EgressSecurityRuleForNSG, len(nsg.EgressRules))
110+
for _, rule := range nsg.EgressRules {
111+
(&rule).ID = nil
112+
egressRules = append(egressRules, rule)
113+
}
114+
nsg.EgressRules = egressRules
115+
}
116+
}
117+
}
118+
96119
func TestFuzzyConversion(t *testing.T) {
97120
g := NewWithT(t)
98121
scheme := runtime.NewScheme()
@@ -134,4 +157,18 @@ func TestFuzzyConversion(t *testing.T) {
134157
FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs},
135158
}))
136159

160+
t.Run("for OCIManagedControlPlane", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
161+
Scheme: scheme,
162+
Hub: &v1beta2.OCIManagedControlPlane{},
163+
Spoke: &OCIManagedControlPlane{},
164+
FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs},
165+
}))
166+
167+
t.Run("for OCIManagedCluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
168+
Scheme: scheme,
169+
Hub: &v1beta2.OCIManagedCluster{},
170+
Spoke: &OCIManagedCluster{},
171+
FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs},
172+
}))
173+
137174
}

exp/api/v1beta1/ocimanagedcluster_conversion.go renamed to api/v1beta1/ocimanagedcluster_conversion.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20-
infrastructurev1beta1 "github.com/oracle/cluster-api-provider-oci/api/v1beta1"
21-
"github.com/oracle/cluster-api-provider-oci/exp/api/v1beta2"
20+
"github.com/oracle/cluster-api-provider-oci/api/v1beta2"
2221
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
2322
"sigs.k8s.io/controller-runtime/pkg/conversion"
2423
)
@@ -31,7 +30,7 @@ func (src *OCIManagedCluster) ConvertTo(dstRaw conversion.Hub) error {
3130
return err
3231
}
3332

34-
ad, err := infrastructurev1beta1.Convertv1beta1AdMapTov1beta2AdMap(src.Status.AvailabilityDomains)
33+
ad, err := Convertv1beta1AdMapTov1beta2AdMap(src.Status.AvailabilityDomains)
3534
if err != nil {
3635
return err
3736
}
@@ -61,7 +60,7 @@ func (r *OCIManagedCluster) ConvertFrom(srcRaw conversion.Hub) error {
6160
return err
6261
}
6362

64-
ad, err := infrastructurev1beta1.Convertv1beta2AdMapTov1beta1AdMap(src.Spec.AvailabilityDomains)
63+
ad, err := Convertv1beta2AdMapTov1beta1AdMap(src.Spec.AvailabilityDomains)
6564
if err != nil {
6665
return err
6766
}

exp/api/v1beta1/ocimanagedcluster_types.go renamed to api/v1beta1/ocimanagedcluster_types.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20-
infrastructurev1beta1 "github.com/oracle/cluster-api-provider-oci/api/v1beta1"
2120
corev1 "k8s.io/api/core/v1"
2221
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2322
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -43,7 +42,7 @@ type OCIManagedClusterSpec struct {
4342

4443
// NetworkSpec encapsulates all things related to OCI network.
4544
// +optional
46-
NetworkSpec infrastructurev1beta1.NetworkSpec `json:"networkSpec,omitempty"`
45+
NetworkSpec NetworkSpec `json:"networkSpec,omitempty"`
4746

4847
// Free-form tags for this resource.
4948
// +optional
@@ -76,7 +75,7 @@ type OCIManagedClusterStatus struct {
7675
// AvailabilityDomains encapsulates the clusters Availability Domain (AD) information in a map
7776
// where the map key is the AD name and the struct is details about the AD.
7877
// +optional
79-
AvailabilityDomains map[string]infrastructurev1beta1.OCIAvailabilityDomain `json:"availabilityDomains,omitempty"`
78+
AvailabilityDomains map[string]OCIAvailabilityDomain `json:"availabilityDomains,omitempty"`
8079

8180
// +optional
8281
Ready bool `json:"ready"`

exp/api/v1beta1/ocimanagedcontrolplane_conversion.go renamed to api/v1beta1/ocimanagedcontrolplane_conversion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20-
"github.com/oracle/cluster-api-provider-oci/exp/api/v1beta2"
20+
"github.com/oracle/cluster-api-provider-oci/api/v1beta2"
2121
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
2222
"sigs.k8s.io/controller-runtime/pkg/conversion"
2323
)

0 commit comments

Comments
 (0)