Skip to content

Commit

Permalink
Add multi shoot
Browse files Browse the repository at this point in the history
  • Loading branch information
damyan committed Feb 12, 2025
1 parent 873b58f commit 6eb8386
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions pkg/controller/infrastructure/actuator_reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,43 @@ func (a *actuator) applyPrefixes(ctx context.Context, ironcoreClient client.Clie
var servicePrefix *ipamv1alpha1.Prefix
if slices.Contains(cluster.Shoot.Spec.Networking.IPFamilies, v1beta1.IPFamilyIPv6) {
// TODO: Get overlay IPv6 Block from Malte
nodesIPV6Prefix, err := netip.ParsePrefix("2a10:afc0:e010:cafe::/64")
rootPrefix, err := netip.ParsePrefix("2a10:afc0:e010:cafe::/64")
if err != nil {
return nil, nil, fmt.Errorf("failed to parse IPv6 prefix: %w", err)
}
prefixIPV6 := &ipamv1alpha1.Prefix{
rootPrefixIPv6 := &ipamv1alpha1.Prefix{
TypeMeta: metav1.TypeMeta{
Kind: "Prefix",
APIVersion: "ipam.ironcore.dev/v1alpha1",
},
ObjectMeta: metav1.ObjectMeta{
Namespace: namespace,
Name: generateResourceNameFromCluster(cluster) + "-v6",
Name: "root-prefix-v6-all-shoots",
},
Spec: ipamv1alpha1.PrefixSpec{
IPFamily: corev1.IPv6Protocol,
Prefix: &commonv1alpha1.IPPrefix{
Prefix: nodesIPV6Prefix,
Prefix: rootPrefix,
},
},
}
if _, err := controllerutil.CreateOrPatch(ctx, ironcoreClient, rootPrefixIPv6, nil); err != nil {
return nil, nil, fmt.Errorf("failed to apply root prefix %s: %w", client.ObjectKeyFromObject(rootPrefixIPv6), err)
}
prefixIPV6 := &ipamv1alpha1.Prefix{
TypeMeta: metav1.TypeMeta{
Kind: "Prefix",
APIVersion: "ipam.ironcore.dev/v1alpha1",
},
ObjectMeta: metav1.ObjectMeta{
Namespace: namespace,
Name: generateResourceNameFromCluster(cluster) + "-v6",
},
Spec: ipamv1alpha1.PrefixSpec{
IPFamily: corev1.IPv6Protocol,
PrefixLength: 96,
ParentRef: &corev1.LocalObjectReference{
Name: rootPrefixIPv6.Name,
},
},
}
Expand Down

0 comments on commit 6eb8386

Please sign in to comment.