diff --git a/templates/cluster-template-clusterclass.yaml b/templates/cluster-template-clusterclass.yaml index 3e8e52676c..bd8932f7b5 100644 --- a/templates/cluster-template-clusterclass.yaml +++ b/templates/cluster-template-clusterclass.yaml @@ -366,13 +366,34 @@ spec: valueFrom: template: | host: '{{ .controlPlaneEndpoint.IP }}' - port: {{ .controlPlaneEndpoint.Port }} + port: {{ .controlPlaneEndpoint.port }} selector: apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: NutanixClusterTemplate matchResources: infrastructureCluster: true name: add-control-plane-endpoint + - definitions: + - jsonPatches: + - op: add + path: /spec/template/spec/prismCentral + valueFrom: + template: | + address: '{{ .prismCentralEndpoint.address }}' + port: {{ .prismCentralEndpoint.port }} + insecure: {{ .prismCentralEndpoint.insecure }} + credentialRef: + name: "${CLUSTER_NAME}" + kind: Secret + additionalTrustBundle: + name: ${CLUSTER_NAME}-pc-trusted-ca-bundle + kind: ConfigMap + selector: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: NutanixClusterTemplate + matchResources: + infrastructureCluster: true + name: add-pc-endpoint-and-creds variables: - name: sshKey required: true @@ -387,7 +408,19 @@ spec: properties: IP: type: string - Port: + port: + type: integer + type: object + - name: prismCentralEndpoint + required: true + schema: + openAPIV3Schema: + properties: + address: + type: string + insecure: + type: boolean + port: type: integer type: object workers: diff --git a/templates/cluster-template-topology.yaml b/templates/cluster-template-topology.yaml index d3177de849..26a8b7387c 100644 --- a/templates/cluster-template-topology.yaml +++ b/templates/cluster-template-topology.yaml @@ -26,7 +26,12 @@ spec: - name: controlPlaneEndpoint value: IP: ${CONTROL_PLANE_ENDPOINT_IP} - Port: ${CONTROL_PLANE_ENDPOINT_PORT=6443} + port: ${CONTROL_PLANE_ENDPOINT_PORT=6443} + - name: prismCentralEndpoint + value: + address: ${NUTANIX_ENDPOINT} + insecure: ${NUTANIX_INSECURE=false} + port: ${NUTANIX_PORT=9440} version: ${KUBERNETES_VERSION} workers: machineDeployments: diff --git a/templates/clusterclass/clusterclass.yaml b/templates/clusterclass/clusterclass.yaml index a488ff352c..c0fdfdfb27 100644 --- a/templates/clusterclass/clusterclass.yaml +++ b/templates/clusterclass/clusterclass.yaml @@ -123,13 +123,34 @@ spec: valueFrom: template: | host: '{{ .controlPlaneEndpoint.IP }}' - port: {{ .controlPlaneEndpoint.Port }} + port: {{ .controlPlaneEndpoint.port }} selector: apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: NutanixClusterTemplate matchResources: infrastructureCluster: true name: add-control-plane-endpoint + - definitions: + - jsonPatches: + - op: add + path: /spec/template/spec/prismCentral + valueFrom: + template: | + address: '{{ .prismCentralEndpoint.address }}' + port: {{ .prismCentralEndpoint.port }} + insecure: {{ .prismCentralEndpoint.insecure }} + credentialRef: + name: "${CLUSTER_NAME}" + kind: Secret + additionalTrustBundle: + name: ${CLUSTER_NAME}-pc-trusted-ca-bundle + kind: ConfigMap + selector: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: NutanixClusterTemplate + matchResources: + infrastructureCluster: true + name: add-pc-endpoint-and-creds variables: - name: sshKey required: true @@ -144,6 +165,18 @@ spec: properties: IP: type: string - Port: + port: + type: integer + type: object + - name: prismCentralEndpoint + required: true + schema: + openAPIV3Schema: + properties: + address: + type: string + port: type: integer + insecure: + type: boolean type: object \ No newline at end of file diff --git a/templates/topology/cluster-with-topology.yaml b/templates/topology/cluster-with-topology.yaml index cfe2d83d6f..ee5669e150 100644 --- a/templates/topology/cluster-with-topology.yaml +++ b/templates/topology/cluster-with-topology.yaml @@ -29,4 +29,9 @@ spec: - name: controlPlaneEndpoint value: IP: "${CONTROL_PLANE_ENDPOINT_IP}" - Port: ${CONTROL_PLANE_ENDPOINT_PORT=6443} \ No newline at end of file + port: ${CONTROL_PLANE_ENDPOINT_PORT=6443} + - name: prismCentralEndpoint + value: + address: "${NUTANIX_ENDPOINT}" + port: ${NUTANIX_PORT=9440} + insecure: ${NUTANIX_INSECURE=false} \ No newline at end of file