Skip to content

Commit 4c66c95

Browse files
committed
Renamed the already context aware ipv6CidrBlock and pool to cidrBlock and added unmanaged calico guide with ClusterResourceSet
1 parent 2f60128 commit 4c66c95

19 files changed

+114
-78
lines changed

api/v1alpha3/awscluster_conversion.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package v1alpha3
1818

1919
import (
2020
"fmt"
21+
2122
apiconversion "k8s.io/apimachinery/pkg/conversion"
2223
clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3"
2324
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -60,8 +61,8 @@ func (r *AWSCluster) ConvertTo(dstRaw conversion.Hub) error {
6061
dst.Spec.NetworkSpec.VPC.IPv6 = &infrav1.IPv6{}
6162
}
6263
dst.Spec.NetworkSpec.VPC.IPv6.EgressOnlyInternetGatewayID = restored.Spec.NetworkSpec.VPC.IPv6.EgressOnlyInternetGatewayID
63-
dst.Spec.NetworkSpec.VPC.IPv6.IPv6CidrBlock = restored.Spec.NetworkSpec.VPC.IPv6.IPv6CidrBlock
64-
dst.Spec.NetworkSpec.VPC.IPv6.IPv6Pool = restored.Spec.NetworkSpec.VPC.IPv6.IPv6Pool
64+
dst.Spec.NetworkSpec.VPC.IPv6.CidrBlock = restored.Spec.NetworkSpec.VPC.IPv6.CidrBlock
65+
dst.Spec.NetworkSpec.VPC.IPv6.PoolID = restored.Spec.NetworkSpec.VPC.IPv6.PoolID
6566
}
6667

6768
for i := range dst.Spec.NetworkSpec.Subnets {

api/v1alpha4/awscluster_conversion.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ func (src *AWSCluster) ConvertTo(dstRaw conversion.Hub) error {
5454
dst.Spec.NetworkSpec.VPC.IPv6 = &infrav1.IPv6{}
5555
}
5656
dst.Spec.NetworkSpec.VPC.IPv6.EgressOnlyInternetGatewayID = restored.Spec.NetworkSpec.VPC.IPv6.EgressOnlyInternetGatewayID
57-
dst.Spec.NetworkSpec.VPC.IPv6.IPv6CidrBlock = restored.Spec.NetworkSpec.VPC.IPv6.IPv6CidrBlock
58-
dst.Spec.NetworkSpec.VPC.IPv6.IPv6Pool = restored.Spec.NetworkSpec.VPC.IPv6.IPv6Pool
57+
dst.Spec.NetworkSpec.VPC.IPv6.CidrBlock = restored.Spec.NetworkSpec.VPC.IPv6.CidrBlock
58+
dst.Spec.NetworkSpec.VPC.IPv6.PoolID = restored.Spec.NetworkSpec.VPC.IPv6.PoolID
5959
}
6060

6161
for i := range dst.Spec.NetworkSpec.Subnets {

api/v1beta1/network_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@ type NetworkSpec struct {
167167

168168
// IPv6 contains ipv6 specific settings for the network.
169169
type IPv6 struct {
170-
// IPv6CidrBlock is the CIDR block provided by Amazon when VPC has enabled IPv6.
170+
// CidrBlock is the CIDR block provided by Amazon when VPC has enabled IPv6.
171171
// +optional
172-
IPv6CidrBlock string `json:"ipv6CidrBlock,omitempty"`
172+
CidrBlock string `json:"cidrBlock,omitempty"`
173173

174-
// IPv6Pool is the IP pool which must be defined in case of BYO IP is defined.
174+
// PoolID is the IP pool which must be defined in case of BYO IP is defined.
175175
// +optional
176-
IPv6Pool string `json:"ipv6Pool,omitempty"`
176+
PoolID string `json:"poolId,omitempty"`
177177

178178
// EgressOnlyInternetGatewayID is the id of the egress only internet gateway associated with an IPv6 enabled VPC.
179179
// +optional

bootstrap/eks/controllers/eksconfig_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func (r *EKSConfigReconciler) joinWorker(ctx context.Context, cluster *clusterv1
211211
// we don't want to override any manually set configuration options.
212212
if config.Spec.ServiceIPV6Cidr == nil && controlPlane.Spec.NetworkSpec.VPC.IsIPv6Enabled() {
213213
log.Info("Adding ipv6 data to userdata....")
214-
nodeInput.ServiceIPV6Cidr = pointer.String(controlPlane.Spec.NetworkSpec.VPC.IPv6.IPv6CidrBlock)
214+
nodeInput.ServiceIPV6Cidr = pointer.String(controlPlane.Spec.NetworkSpec.VPC.IPv6.CidrBlock)
215215
nodeInput.IPFamily = pointer.String("ipv6")
216216
}
217217

config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2601,17 +2601,17 @@ spec:
26012601
description: IPv6 contains ipv6 specific settings for the
26022602
network.
26032603
properties:
2604+
cidrBlock:
2605+
description: CidrBlock is the CIDR block provided by Amazon
2606+
when VPC has enabled IPv6.
2607+
type: string
26042608
egressOnlyInternetGatewayId:
26052609
description: EgressOnlyInternetGatewayID is the id of
26062610
the egress only internet gateway associated with an
26072611
IPv6 enabled VPC.
26082612
type: string
2609-
ipv6CidrBlock:
2610-
description: IPv6CidrBlock is the CIDR block provided
2611-
by Amazon when VPC has enabled IPv6.
2612-
type: string
2613-
ipv6Pool:
2614-
description: IPv6Pool is the IP pool which must be defined
2613+
poolId:
2614+
description: PoolID is the IP pool which must be defined
26152615
in case of BYO IP is defined.
26162616
type: string
26172617
type: object

config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusters.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,17 +1859,17 @@ spec:
18591859
description: IPv6 contains ipv6 specific settings for the
18601860
network.
18611861
properties:
1862+
cidrBlock:
1863+
description: CidrBlock is the CIDR block provided by Amazon
1864+
when VPC has enabled IPv6.
1865+
type: string
18621866
egressOnlyInternetGatewayId:
18631867
description: EgressOnlyInternetGatewayID is the id of
18641868
the egress only internet gateway associated with an
18651869
IPv6 enabled VPC.
18661870
type: string
1867-
ipv6CidrBlock:
1868-
description: IPv6CidrBlock is the CIDR block provided
1869-
by Amazon when VPC has enabled IPv6.
1870-
type: string
1871-
ipv6Pool:
1872-
description: IPv6Pool is the IP pool which must be defined
1871+
poolId:
1872+
description: PoolID is the IP pool which must be defined
18731873
in case of BYO IP is defined.
18741874
type: string
18751875
type: object

config/crd/bases/infrastructure.cluster.x-k8s.io_awsclustertemplates.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -693,17 +693,17 @@ spec:
693693
description: IPv6 contains ipv6 specific settings
694694
for the network.
695695
properties:
696+
cidrBlock:
697+
description: CidrBlock is the CIDR block provided
698+
by Amazon when VPC has enabled IPv6.
699+
type: string
696700
egressOnlyInternetGatewayId:
697701
description: EgressOnlyInternetGatewayID is the
698702
id of the egress only internet gateway associated
699703
with an IPv6 enabled VPC.
700704
type: string
701-
ipv6CidrBlock:
702-
description: IPv6CidrBlock is the CIDR block provided
703-
by Amazon when VPC has enabled IPv6.
704-
type: string
705-
ipv6Pool:
706-
description: IPv6Pool is the IP pool which must
705+
poolId:
706+
description: PoolID is the IP pool which must
707707
be defined in case of BYO IP is defined.
708708
type: string
709709
type: object

controlplane/eks/api/v1alpha3/conversion.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ func (r *AWSManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error {
5353
dst.Spec.NetworkSpec.VPC.IPv6 = &infrav1beta1.IPv6{}
5454
}
5555
dst.Spec.NetworkSpec.VPC.IPv6.EgressOnlyInternetGatewayID = restored.Spec.NetworkSpec.VPC.IPv6.EgressOnlyInternetGatewayID
56-
dst.Spec.NetworkSpec.VPC.IPv6.IPv6CidrBlock = restored.Spec.NetworkSpec.VPC.IPv6.IPv6CidrBlock
57-
dst.Spec.NetworkSpec.VPC.IPv6.IPv6Pool = restored.Spec.NetworkSpec.VPC.IPv6.IPv6Pool
56+
dst.Spec.NetworkSpec.VPC.IPv6.CidrBlock = restored.Spec.NetworkSpec.VPC.IPv6.CidrBlock
57+
dst.Spec.NetworkSpec.VPC.IPv6.PoolID = restored.Spec.NetworkSpec.VPC.IPv6.PoolID
5858
}
5959

6060
for i := range dst.Spec.NetworkSpec.Subnets {

controlplane/eks/api/v1alpha4/conversion.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ func (r *AWSManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error {
4949
dst.Spec.NetworkSpec.VPC.IPv6 = &infrav1beta1.IPv6{}
5050
}
5151
dst.Spec.NetworkSpec.VPC.IPv6.EgressOnlyInternetGatewayID = restored.Spec.NetworkSpec.VPC.IPv6.EgressOnlyInternetGatewayID
52-
dst.Spec.NetworkSpec.VPC.IPv6.IPv6CidrBlock = restored.Spec.NetworkSpec.VPC.IPv6.IPv6CidrBlock
53-
dst.Spec.NetworkSpec.VPC.IPv6.IPv6Pool = restored.Spec.NetworkSpec.VPC.IPv6.IPv6Pool
52+
dst.Spec.NetworkSpec.VPC.IPv6.CidrBlock = restored.Spec.NetworkSpec.VPC.IPv6.CidrBlock
53+
dst.Spec.NetworkSpec.VPC.IPv6.PoolID = restored.Spec.NetworkSpec.VPC.IPv6.PoolID
5454
}
5555

5656
for i := range dst.Spec.NetworkSpec.Subnets {

controlplane/eks/api/v1beta1/awsmanagedcontrolplane_webhook.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ func (r *AWSManagedControlPlane) validateDisableVPCCNI() field.ErrorList {
387387
func (r *AWSManagedControlPlane) validateNetwork() field.ErrorList {
388388
var allErrs field.ErrorList
389389

390-
if r.Spec.NetworkSpec.VPC.IsIPv6Enabled() && r.Spec.NetworkSpec.VPC.IPv6.IPv6CidrBlock != "" && r.Spec.NetworkSpec.VPC.IPv6.IPv6Pool == "" {
391-
poolField := field.NewPath("spec", "networkSpec", "vpc", "ipv6Pool")
392-
allErrs = append(allErrs, field.Invalid(poolField, r.Spec.NetworkSpec.VPC.IPv6.IPv6Pool, "ipv6Pool cannot be empty if ipv6CidrBlock is set for BYOIP"))
390+
if r.Spec.NetworkSpec.VPC.IsIPv6Enabled() && r.Spec.NetworkSpec.VPC.IPv6.CidrBlock != "" && r.Spec.NetworkSpec.VPC.IPv6.PoolID == "" {
391+
poolField := field.NewPath("spec", "networkSpec", "vpc", "poolId")
392+
allErrs = append(allErrs, field.Invalid(poolField, r.Spec.NetworkSpec.VPC.IPv6.PoolID, "poolId cannot be empty if cidrBlock is set"))
393393
}
394394

395395
return allErrs

0 commit comments

Comments
 (0)