Skip to content

Commit

Permalink
added nmt patches for cp and md
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakm-ntnx committed Dec 21, 2023
1 parent 04498ca commit 0e93090
Show file tree
Hide file tree
Showing 7 changed files with 396 additions and 53 deletions.
124 changes: 123 additions & 1 deletion templates/cluster-template-clusterclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ spec:
kind: NutanixClusterTemplate
matchResources:
infrastructureCluster: true
name: add-control-plane-endpoint
name: update-control-plane-endpoint
- definitions:
- jsonPatches:
- op: add
Expand All @@ -394,6 +394,84 @@ spec:
matchResources:
infrastructureCluster: true
name: add-pc-endpoint-and-creds
- definitions:
- jsonPatches:
- op: replace
path: /spec/template/spec/bootType
valueFrom:
variable: controlPlaneMachineDetails.bootType
- op: replace
path: /spec/template/spec/vcpusPerSocket
valueFrom:
variable: controlPlaneMachineDetails.vcpusPerSocket
- op: replace
path: /spec/template/spec/memorySize
valueFrom:
variable: controlPlaneMachineDetails.memorySize
- op: replace
path: /spec/template/spec/systemDiskSize
valueFrom:
variable: controlPlaneMachineDetails.systemDiskSize
- op: replace
path: /spec/template/spec/image/name
valueFrom:
variable: controlPlaneMachineDetails.imageName
- op: replace
path: /spec/template/spec/cluster/name
valueFrom:
variable: controlPlaneMachineDetails.clusterName
- op: replace
path: /spec/template/spec/subnet
valueFrom:
template: |
- type: name
name: {{ .controlPlaneMachineDetails.subnetName }}
selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixMachineTemplate
matchResources:
controlPlane: true
name: update-control-plane-machine-template
- definitions:
- jsonPatches:
- op: replace
path: /spec/template/spec/bootType
valueFrom:
variable: workerMachineDetails.bootType
- op: replace
path: /spec/template/spec/vcpusPerSocket
valueFrom:
variable: workerMachineDetails.vcpusPerSocket
- op: replace
path: /spec/template/spec/memorySize
valueFrom:
variable: workerMachineDetails.memorySize
- op: replace
path: /spec/template/spec/systemDiskSize
valueFrom:
variable: workerMachineDetails.systemDiskSize
- op: replace
path: /spec/template/spec/image/name
valueFrom:
variable: workerMachineDetails.imageName
- op: replace
path: /spec/template/spec/cluster/name
valueFrom:
variable: workerMachineDetails.clusterName
- op: replace
path: /spec/template/spec/subnet
valueFrom:
template: |
- type: name
name: {{ .controlPlaneMachineDetails.subnetName }}
selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: NutanixMachineTemplate
matchResources:
machineDeploymentClass:
names:
- ${CLUSTER_CLASS_NAME}-worker
name: update-worker-machine-template
variables:
- name: sshKey
required: true
Expand Down Expand Up @@ -423,6 +501,50 @@ spec:
port:
type: integer
type: object
- name: controlPlaneMachineDetails
required: true
schema:
openAPIV3Schema:
properties:
bootType:
type: string
clusterName:
type: string
imageName:
type: string
memorySize:
type: string
subnetName:
type: string
systemDiskSize:
type: string
vcpuSockets:
type: integer
vcpusPerSocket:
type: integer
type: object
- name: workerMachineDetails
required: true
schema:
openAPIV3Schema:
properties:
bootType:
type: string
clusterName:
type: string
imageName:
type: string
memorySize:
type: string
subnetName:
type: string
systemDiskSize:
type: string
vcpuSockets:
type: integer
vcpusPerSocket:
type: integer
type: object
workers:
machineDeployments:
- class: ${CLUSTER_CLASS_NAME}-worker
Expand Down
20 changes: 20 additions & 0 deletions templates/cluster-template-topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ spec:
address: ${NUTANIX_ENDPOINT}
insecure: ${NUTANIX_INSECURE=false}
port: ${NUTANIX_PORT=9440}
- name: controlPlaneMachineDetails
value:
bootType: ${NUTANIX_MACHINE_BOOT_TYPE=legacy}
clusterName: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
imageName: ${NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME}
memorySize: ${NUTANIX_MACHINE_MEMORY_SIZE=4Gi}
subnetName: ${NUTANIX_SUBNET_NAME}
systemDiskSize: ${NUTANIX_SYSTEMDISK_SIZE=40Gi}
vcpuSockets: ${NUTANIX_MACHINE_VCPU_SOCKET=2}
vcpusPerSocket: ${NUTANIX_MACHINE_VCPU_PER_SOCKET=1}
- name: workerMachineDetails
value:
bootType: ${NUTANIX_MACHINE_BOOT_TYPE=legacy}
clusterName: ${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}
imageName: ${NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME}
memorySize: ${NUTANIX_MACHINE_MEMORY_SIZE=4Gi}
subnetName: ${NUTANIX_SUBNET_NAME}
systemDiskSize: ${NUTANIX_SYSTEMDISK_SIZE=40Gi}
vcpuSockets: ${NUTANIX_MACHINE_VCPU_SOCKET=2}
vcpusPerSocket: ${NUTANIX_MACHINE_VCPU_PER_SOCKET=1}
version: ${KUBERNETES_VERSION}
workers:
machineDeployments:
Expand Down
Loading

0 comments on commit 0e93090

Please sign in to comment.