Skip to content

Commit 8c21afd

Browse files
committed
changes according to suggestions
1 parent bafeda0 commit 8c21afd

File tree

8 files changed

+21
-23
lines changed

8 files changed

+21
-23
lines changed

api/v1beta1/ociclustertemplate_conversion.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ func (src *OCIClusterTemplate) ConvertTo(dstRaw conversion.Hub) error {
4343
dst.Spec.Template.Spec.AvailabilityDomains = restored.Spec.Template.Spec.AvailabilityDomains
4444
dst.Spec.Template.Spec.NetworkSpec.APIServerLB.LoadBalancerType = restored.Spec.Template.Spec.NetworkSpec.APIServerLB.LoadBalancerType
4545
dst.Spec.Template.Spec.ClientOverrides = restored.Spec.Template.Spec.ClientOverrides
46-
4746
return nil
4847
}
4948

api/v1beta1/ocimanagedcluster_conversion.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ func (src *OCIManagedCluster) ConvertTo(dstRaw conversion.Hub) error {
4949
dst.Spec.NetworkSpec.Vcn.RouteTable.Skip = restored.Spec.NetworkSpec.Vcn.RouteTable.Skip
5050
dst.Spec.NetworkSpec.APIServerLB.LoadBalancerType = restored.Spec.NetworkSpec.APIServerLB.LoadBalancerType
5151
dst.Spec.ClientOverrides = restored.Spec.ClientOverrides
52-
5352
return nil
5453
}
5554

api/v1beta1/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,7 @@ type Subnet struct {
856856
Name string `json:"name"`
857857
// Skip specifies whether to skip creating subnets.
858858
// +optional
859+
859860
Skip bool `json:"skip,omitempty"`
860861
// Subnet CIDR.
861862
// +optional

cloud/scope/nsg_reconciler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131

3232
func (s *ClusterScope) ReconcileNSG(ctx context.Context) error {
3333
if s.OCIClusterAccessor.GetNetworkSpec().Vcn.NetworkSecurityGroup.Skip {
34-
s.Logger.Info("Skipping Network Secuirty Group reconciliation as per spec")
34+
s.Logger.Info("Skipping Network Security Group reconciliation as per spec")
3535
return nil
3636
}
3737
desiredNSGs := s.OCIClusterAccessor.GetNetworkSpec().Vcn.NetworkSecurityGroup
@@ -129,7 +129,7 @@ func (s *ClusterScope) GetNSG(ctx context.Context, spec infrastructurev1beta2.NS
129129

130130
func (s *ClusterScope) DeleteNSGs(ctx context.Context) error {
131131
if s.OCIClusterAccessor.GetNetworkSpec().Vcn.NetworkSecurityGroup.Skip {
132-
s.Logger.Info("Skipping Network Secuirty Group reconciliation as per spec")
132+
s.Logger.Info("Skipping Network Security Group reconciliation as per spec")
133133
return nil
134134
}
135135
desiredNSGs := s.OCIClusterAccessor.GetNetworkSpec().Vcn.NetworkSecurityGroup

cloud/scope/subnet_reconciler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ func (s *ClusterScope) ReconcileSubnet(ctx context.Context) error {
3333
desiredSubnets := s.OCIClusterAccessor.GetNetworkSpec().Vcn.Subnets
3434
for _, desiredSubnet := range desiredSubnets {
3535
if desiredSubnet.Skip {
36+
s.Logger.Info("Skipping Subnet reconciliation as per spec")
3637
continue
3738
}
3839
subnet, err := s.GetSubnet(ctx, *desiredSubnet)
@@ -192,6 +193,7 @@ func (s *ClusterScope) DeleteSubnets(ctx context.Context) error {
192193
desiredSubnets := s.GetSubnetsSpec()
193194
for _, desiredSubnet := range desiredSubnets {
194195
if desiredSubnet.Skip {
196+
s.Logger.Info("Skipping Subnet reconciliation as per spec")
195197
continue
196198
}
197199
subnet, err := s.GetSubnet(ctx, *desiredSubnet)

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ spec:
4949
In the above spec, note that name has to be mentioned for Subnet/NSG. This is so that Kubernetes
5050
can merge the list properly when there is an update.
5151
52-
## Example spec for externally managed VCN, Subnet and Gateways, but the other networking components self managed
52+
## Example spec for externally managed VCN, Subnet, Internet Gateway, Nat Gateway, Service Gateway and routing table, but the other networking components are still managed by CAPOCI (e.g. Network Security Groups)
5353
5454
Example spec is given below
5555
@@ -63,7 +63,7 @@ spec:
6363
networkSpec:
6464
vcn:
6565
skip: true
66-
id: <Insert VCN OCID Here>
66+
id: <Insert VCN OCID Here> // REQUIRED
6767
networkSecurityGroup:
6868
skip: false
6969
internetGateway:
@@ -75,22 +75,22 @@ spec:
7575
routeTable:
7676
skip: true
7777
subnets:
78-
- id: <Insert control Plane Subnet OCID Here>
78+
- id: <Insert control Plane Subnet OCID Here> // REQUIRED
7979
role: control-plane-endpoint
8080
name: control-plane-endpoint
8181
type: public
8282
skip: true
83-
- id: <Insert control Plane Subnet OCID Here>
83+
- id: <Insert control Plane Subnet OCID Here> // REQUIRED
8484
role: worker
8585
name: worker
8686
type: private
8787
skip: true
88-
- id: <Insert control Plane Subnet OCID Here>
88+
- id: <Insert control Plane Subnet OCID Here> // REQUIRED
8989
role: control-plane
9090
name: control-plane
9191
type: private
9292
skip: true
93-
- id: <Insert control Plane Subnet OCID Here>
93+
- id: <Insert control Plane Subnet OCID Here> // REQUIRED
9494
role: service-lb
9595
name: service-lb
9696
type: public
@@ -141,8 +141,6 @@ spec:
141141
role: worker
142142
```
143143

144-
145-
146144
## Status
147145

148146
As per the Cluster API Provider specification, the `OCICluster Status` Object has to be updated with `ready` status

docs/src/managed/networking.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ kind: OCIManagedCluster
4848
spec:
4949
compartmentId: "${OCI_COMPARTMENT_ID}"
5050
networkSpec:
51-
skipNetworkManagement: true
5251
vcn:
5352
skip: true
54-
id: <Insert VCN OCID Here>
53+
id: <Insert VCN OCID Here> // REQUIRED
5554
networkSecurityGroup:
5655
skip: false
5756
internetGateway:
@@ -63,22 +62,22 @@ spec:
6362
routeTable:
6463
skip: true
6564
subnets:
66-
- id: <Insert control Plane Subnet OCID Here>
65+
- id: <Insert control Plane Subnet OCID Here> // REQUIRED
6766
role: control-plane-endpoint
6867
name: control-plane-endpoint
6968
type: public
7069
skip: true
71-
- id: <Insert control Plane Subnet OCID Here>
70+
- id: <Insert control Plane Subnet OCID Here> // REQUIRED
7271
role: worker
7372
name: worker
7473
type: private
7574
skip: true
76-
- id: <Insert control Plane Subnet OCID Here>
75+
- id: <Insert control Plane Subnet OCID Here> // REQUIRED
7776
role: control-plane
7877
name: control-plane
7978
type: private
8079
skip: true
81-
- id: <Insert control Plane Subnet OCID Here>
80+
- id: <Insert control Plane Subnet OCID Here> // REQUIRED
8281
role: service-lb
8382
name: service-lb
8483
type: public

templates/cluster-template-with-nsg.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spec:
3636
compartmentId: "${OCI_COMPARTMENT_ID}"
3737
networkSpec:
3838
vcn:
39-
id:
39+
id: "${VCN_ID}"
4040
skip: true
4141
networkSecurityGroup:
4242
skip: false
@@ -49,22 +49,22 @@ spec:
4949
routeTable:
5050
skip: true
5151
subnets:
52-
- id:
52+
- id: "${SUBNET_ID_CPE}"
5353
role: control-plane-endpoint
5454
name: control-plane-endpoint
5555
type: public
5656
skip: true
57-
- id:
57+
- id: "${SUBNET_ID_W}"
5858
role: worker
5959
name: worker
6060
type: private
6161
skip: true
62-
- id:
62+
- id: "${SUBNET_ID_CP}"
6363
role: control-plane
6464
name: control-plane
6565
type: private
6666
skip: true
67-
- id:
67+
- id: "${SUBNET_ID_LB}"
6868
role: service-lb
6969
name: service-lb
7070
type: public

0 commit comments

Comments
 (0)