mirror of
https://github.com/outbackdingo/proxmox-cloud-controller-manager.git
synced 2026-01-27 02:20:02 +00:00
feat: kubelet dualstack support
Enable cloud Dual-Stack with --node-ip support since Kubernetes 1.29 release. Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
This commit is contained in:
@@ -138,7 +138,12 @@ func (i *instances) InstanceMetadata(_ context.Context, node *v1.Node) (*cloudpr
|
||||
}
|
||||
}
|
||||
|
||||
addresses := []v1.NodeAddress{{Type: v1.NodeInternalIP, Address: providedIP}}
|
||||
addresses := []v1.NodeAddress{}
|
||||
|
||||
for _, ip := range strings.Split(providedIP, ",") {
|
||||
addresses = append(addresses, v1.NodeAddress{Type: v1.NodeInternalIP, Address: ip})
|
||||
}
|
||||
|
||||
addresses = append(addresses, v1.NodeAddress{Type: v1.NodeHostName, Address: node.Name})
|
||||
|
||||
instanceType, err := i.getInstanceType(vmRef, region)
|
||||
|
||||
@@ -416,6 +416,37 @@ func (ts *ccmTestSuite) TestInstanceMetadata() {
|
||||
Zone: "pve-1",
|
||||
},
|
||||
},
|
||||
{
|
||||
msg: "NodeExistsDualstack",
|
||||
node: &v1.Node{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "cluster-1-node-1",
|
||||
Annotations: map[string]string{
|
||||
cloudproviderapi.AnnotationAlphaProvidedIPAddr: "1.2.3.4,2001::1",
|
||||
},
|
||||
},
|
||||
},
|
||||
expected: &cloudprovider.InstanceMetadata{
|
||||
ProviderID: "proxmox://cluster-1/100",
|
||||
NodeAddresses: []v1.NodeAddress{
|
||||
{
|
||||
Type: v1.NodeInternalIP,
|
||||
Address: "1.2.3.4",
|
||||
},
|
||||
{
|
||||
Type: v1.NodeInternalIP,
|
||||
Address: "2001::1",
|
||||
},
|
||||
{
|
||||
Type: v1.NodeHostName,
|
||||
Address: "cluster-1-node-1",
|
||||
},
|
||||
},
|
||||
InstanceType: "4VCPU-10GB",
|
||||
Region: "cluster-1",
|
||||
Zone: "pve-1",
|
||||
},
|
||||
},
|
||||
{
|
||||
msg: "NodeExistsCluster2",
|
||||
node: &v1.Node{
|
||||
|
||||
Reference in New Issue
Block a user