cluster-api-provider-cloud-director icon indicating copy to clipboard operation
cluster-api-provider-cloud-director copied to clipboard

controlPlaneEndpoint port overload virtual service not working

Open Maellooou opened this issue 1 year ago • 0 comments

Describe the bug

When you want to overload the controlPlaneEndpoint port, the default value 6443 is set back with the reconcile loop on VCDcluster object.

Reproduction steps

  1. Define the variable controlPlaneEndpoint.port: 443 on VCDCluster and bindPort: 443 on KubeadmControlPlane
  2. Create the objects
  3. Despite the log, the virtual service is created with 6443 port
kubectl logs capvcd-controller-manager-6b57968f77-bkq5k  -n capvcd-system | grep 443
2024-01-18T13:14:45.584Z	INFO	controller-runtime.webhook	Serving webhook server	{"host": "", "port": 9443}
2024-01-18T13:18:33.370Z	INFO	Creating load balancer for the cluster at user-specified endpoint	{"controller": "vcdcluster", "controllerGroup": "infrastructure.cluster.x-k8s.io", "controllerKind": "VCDCluster", "VCDCluster": {"name":"caasavenue-np","namespace":"caasavenue-np"}, "namespace": "caasavenue-np", "name": "caasavenue-np", "reconcileID": "05c4fc00-9fbb-4de4-9808-7eb9f5aeb9be", "host": "10.238.80.201", "port": 443}
I0118 13:19:19.744322       1 auth.go:76] Running module as sysadmin [false]
      controlPlaneEndpoint: 10.238.80.201:443
        bindPort: 443
sudo cat << EOF > /etc/kubernetes/vcloud-ccm-configmap.yaml\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: vcloud-ccm-configmap\n  namespace: kube-system\ndata:\n  vcloud-ccm-config.yaml: |+\n    vcd:\n      host: https://console2.cloudavenue.orange-business.com\n      org: cav01iv02ocb0006358\n      vdc: obsitcaascnpca\n    loadbalancer:\n      ports:\n        http: 80\n        https: 443\n      network: obsitcaascnpca\n      vipSubnet: \"\"\n      certAlias: \"\"\n      enableVirtualServiceSharedIP: true # supported for VCD >= 10.4\n    clusterid: ${CLUSTER_ID} #value get from /etc/vcloud/metering added by cloud-init added by controller.\n    vAppName: caasavenue-np\nEOF\n"
    controlPlaneEndpoint: 10.238.80.201:443
      bindPort: 443
          https: 443

Capture d’écran 2024-01-18 à 14 20 03

  1. The VCDCluster object has been updated with the wrong port
kubectl get vcdcluster caasavenue-np -o yaml            
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: VCDCluster
metadata:
  labels:
    cluster.x-k8s.io/cluster-name: caasavenue-np
  name: caasavenue-np
  namespace: caasavenue-np
spec:
  controlPlaneEndpoint:
    host: 10.238.80.201
    port: 6443
  loadBalancerConfigSpec: {}
  org: cav01iv02ocb0006358
  ovdc: obsitcaascnpca
  ovdcNetwork: obsitcaascnpca
  proxyConfigSpec: {}
  rdeId: urn:vcloud:entity:vmware:capvcdCluster:18c32194-ddb4-4583-a89b-1d7c76794519
  site: https://console2.cloudavenue.orange-business.com
  useAsManagementCluster: false
  userContext:
    secretRef:
      name: capi-user-credentials
      namespace: caasavenue-np

Expected behavior

The virtual services and pools should be created with 443 port

Additional context

No response

Maellooou avatar Jan 18 '24 13:01 Maellooou