diff --git a/charts/templates/nodeconfig-controlplane-zone1.yaml b/charts/templates/nodeconfig-controlplane-zone1.yaml new file mode 100644 index 0000000..e124422 --- /dev/null +++ b/charts/templates/nodeconfig-controlplane-zone1.yaml @@ -0,0 +1,88 @@ +apiVersion: rke-machine-config.cattle.io/v1 +kind: VmwarevsphereConfig +metadata: + name: {{ .Values.cluster.name }}-{{ .Values.pool.controlplanedc1.name }} + namespace: fleet-default +boot2dockerUrl: "" +cfgparam: +- disk.enableUUID=TRUE +cloneFrom: /DCNAME/vm/ClusterNAME/Templates/ubuntu-jammy-cloudimg-templateNAME +cloudConfig: | + #cloud-config + write_files: + - path: /root/apply.sh + permissions: "0644" + owner: root + content: | + #!/bin/bash + vmtoolsd --cmd 'info-get guestinfo.ovfEnv' > /tmp/ovfenv + IFName=`ls -C /sys/class/net/ | awk '{print $1}'` + IPAddress=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.address" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMask=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.netmask" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMaskSN=$(sed -n 's/.*\[\([^]]*\).*/\1/p' /tmp/ovfenv) + Gateway=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.route.0.gateway" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + DNS=$(sed -n 's/.*Property oe:key="guestinfo.dns.servers" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + + cat > /etc/netplan/50-cloud-init.yaml << EOF + network: + ethernets: + $IFName: + dhcp4: no + addresses: [$IPAddress/$SubnetMaskSN] + gateway4: $Gateway + nameservers: + addresses: [$DNS] + search: [your.domainNAME,your.nextdomainNAME] + version: 2 + EOF + sudo netplan apply + runcmd: + - bash /root/apply.sh +cloudinit: "" +common: + labels: null + taints: [] +contentLibrary: "" +#cpuCount: {{ .Values.pool.controlplanedc1.vmcpu | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.controlplanedc1.vmbasket) "TINY" }} +cpuCount: {{ .Values.pool.controlplanedc1.vmtinycpu | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.controlplanedc1.vmbasket) "SMALL" }} +cpuCount: {{ .Values.pool.controlplanedc1.vmsmallcpu | quote }} +{{- else }} +cpuCount: {{ .Values.pool.controlplanedc1.vmstandardcpu | quote }} +{{- end }} +creationType: template +customAttribute: "" +datacenter: /DCNAME +datastore: "" +datastoreCluster: /DCNAME/datastore/datastorefolderNAME/{{ .Values.DC1DatastoreCluster }} +diskSize: {{ .Values.pool.controlplanedc1.vmdisk | quote }} +folder: /DCNAME/vm/ClusterNAME/VMFolderNAME +hostsystem: /DCNAME/host/ClusterNAME/{{ .Values.pool.controlplanedc1.host }} +#memorySize: {{ .Values.pool.controlplanedc1.vmram | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.controlplanedc1.vmbasket) "TINY" }} +memorySize: {{ .Values.pool.controlplanedc1.vmtinyram | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.controlplanedc1.vmbasket) "SMALL" }} +memorySize: {{ .Values.pool.controlplanedc1.vmsmallram | quote }} +{{- else }} +memorySize: {{ .Values.pool.controlplanedc1.vmstandardram | quote }} +{{- end }} +network: +## regex ^\S* +- /DCNAME/network/{{ regexFind "^\\S*" .Values.pool.controlplanedc1.vlan }} +os: linux +password: "" +pool: /DCNAME/host/ClusterNAME/Resources +tag: +- {{ .Values.tagregion }} +- {{ .Values.tagzone1 }} +vappIpallocationpolicy: fixedAllocated +vappIpprotocol: IPv4 +vappProperty: +- guestinfo.interface.0.ip.0.address=ip:{{ regexFind "^\\S*" .Values.pool.controlplanedc1.vlan }} +- guestinfo.interface.0.ip.0.netmask=${netmask:{{ regexFind "^\\S*" .Values.pool.controlplanedc1.vlan }}} +- guestinfo.interface.0.route.0.gateway=${gateway:{{ regexFind "^\\S*" .Values.pool.controlplanedc1.vlan }}} +- guestinfo.dns.servers=${dns:{{ regexFind "^\\S*" .Values.pool.controlplanedc1.vlan }}} +vappTransport: com.vmware.guestInfo +vcenter: "" +vcenterPort: "443" \ No newline at end of file diff --git a/charts/templates/nodeconfig-controlplane-zone2.yaml b/charts/templates/nodeconfig-controlplane-zone2.yaml new file mode 100644 index 0000000..16698f2 --- /dev/null +++ b/charts/templates/nodeconfig-controlplane-zone2.yaml @@ -0,0 +1,88 @@ +apiVersion: rke-machine-config.cattle.io/v1 +kind: VmwarevsphereConfig +metadata: + name: {{ .Values.cluster.name }}-{{ .Values.pool.controlplanedc2.name }} + namespace: fleet-default +boot2dockerUrl: "" +cfgparam: +- disk.enableUUID=TRUE +cloneFrom: /DCNAME/vm/ClusterNAME/Templates/ubuntu-jammy-cloudimg-templateNAME +cloudConfig: | + #cloud-config + write_files: + - path: /root/apply.sh + permissions: "0644" + owner: root + content: | + #!/bin/bash + vmtoolsd --cmd 'info-get guestinfo.ovfEnv' > /tmp/ovfenv + IFName=`ls -C /sys/class/net/ | awk '{print $1}'` + IPAddress=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.address" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMask=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.netmask" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMaskSN=$(sed -n 's/.*\[\([^]]*\).*/\1/p' /tmp/ovfenv) + Gateway=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.route.0.gateway" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + DNS=$(sed -n 's/.*Property oe:key="guestinfo.dns.servers" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + + cat > /etc/netplan/50-cloud-init.yaml << EOF + network: + ethernets: + $IFName: + dhcp4: no + addresses: [$IPAddress/$SubnetMaskSN] + gateway4: $Gateway + nameservers: + addresses: [$DNS] + search: [your.domainNAME,your.nextdomainNAME] + version: 2 + EOF + sudo netplan apply + runcmd: + - bash /root/apply.sh +cloudinit: "" +common: + labels: null + taints: [] +contentLibrary: "" +#cpuCount: {{ .Values.pool.controlplanedc2.vmcpu | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.controlplanedc2.vmbasket) "TINY" }} +cpuCount: {{ .Values.pool.controlplanedc2.vmtinycpu | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.controlplanedc2.vmbasket) "SMALL" }} +cpuCount: {{ .Values.pool.controlplanedc2.vmsmallcpu | quote }} +{{- else }} +cpuCount: {{ .Values.pool.controlplanedc2.vmstandardcpu | quote }} +{{- end }} +creationType: template +customAttribute: "" +datacenter: /DCNAME +datastore: "" +datastoreCluster: /DCNAME/datastore/datastorefolderNAME/{{ .Values.DC2DatastoreCluster }} +diskSize: {{ .Values.pool.controlplanedc2.vmdisk | quote }} +folder: /DCNAME/vm/ClusterNAME/VMFolderNAME +hostsystem: /DCNAME/host/ClusterNAME/{{ .Values.pool.controlplanedc2.host }} +#memorySize: {{ .Values.pool.controlplanedc2.vmram | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.controlplanedc2.vmbasket) "TINY" }} +memorySize: {{ .Values.pool.controlplanedc2.vmtinyram | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.controlplanedc2.vmbasket) "SMALL" }} +memorySize: {{ .Values.pool.controlplanedc2.vmsmallram | quote }} +{{- else }} +memorySize: {{ .Values.pool.controlplanedc2.vmstandardram | quote }} +{{- end }} +network: +## regex ^\S* +- /DCNAME/network/{{ regexFind "^\\S*" .Values.pool.controlplanedc2.vlan }} +os: linux +password: "" +pool: /DCNAME/host/ClusterNAME/Resources +tag: +- {{ .Values.tagregion }} +- {{ .Values.tagzone2 }} +vappIpallocationpolicy: fixedAllocated +vappIpprotocol: IPv4 +vappProperty: +- guestinfo.interface.0.ip.0.address=ip:{{ regexFind "^\\S*" .Values.pool.controlplanedc2.vlan }} +- guestinfo.interface.0.ip.0.netmask=${netmask:{{ regexFind "^\\S*" .Values.pool.controlplanedc2.vlan }}} +- guestinfo.interface.0.route.0.gateway=${gateway:{{ regexFind "^\\S*" .Values.pool.controlplanedc2.vlan }}} +- guestinfo.dns.servers=${dns:{{ regexFind "^\\S*" .Values.pool.controlplanedc2.vlan }}} +vappTransport: com.vmware.guestInfo +vcenter: "" +vcenterPort: "443" \ No newline at end of file diff --git a/charts/templates/nodeconfig-controlplane-zone3.yaml b/charts/templates/nodeconfig-controlplane-zone3.yaml new file mode 100644 index 0000000..27880b6 --- /dev/null +++ b/charts/templates/nodeconfig-controlplane-zone3.yaml @@ -0,0 +1,88 @@ +apiVersion: rke-machine-config.cattle.io/v1 +kind: VmwarevsphereConfig +metadata: + name: {{ .Values.cluster.name }}-{{ .Values.pool.controlplanedc3witness.name }} + namespace: fleet-default +boot2dockerUrl: "" +cfgparam: +- disk.enableUUID=TRUE +cloneFrom: /DCNAME2/vm/ClusterNAME/Templates/ubuntu-jammy-cloudimg-templateNAME +cloudConfig: | + #cloud-config + write_files: + - path: /root/apply.sh + permissions: "0644" + owner: root + content: | + #!/bin/bash + vmtoolsd --cmd 'info-get guestinfo.ovfEnv' > /tmp/ovfenv + IFName=`ls -C /sys/class/net/ | awk '{print $1}'` + IPAddress=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.address" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMask=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.netmask" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMaskSN=$(sed -n 's/.*\[\([^]]*\).*/\1/p' /tmp/ovfenv) + Gateway=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.route.0.gateway" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + DNS=$(sed -n 's/.*Property oe:key="guestinfo.dns.servers" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + + cat > /etc/netplan/50-cloud-init.yaml << EOF + network: + ethernets: + $IFName: + dhcp4: no + addresses: [$IPAddress/$SubnetMaskSN] + gateway4: $Gateway + nameservers: + addresses: [$DNS] + search: [your.domainNAME,your.nextdomainNAME] + version: 2 + EOF + sudo netplan apply + runcmd: + - bash /root/apply.sh +cloudinit: "" +common: + labels: null + taints: [] +contentLibrary: "" +#cpuCount: {{ .Values.pool.controlplanedc3witness.vmcpu | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.controlplanedc3witness.vmbasket) "TINY" }} +cpuCount: {{ .Values.pool.controlplanedc3witness.vmtinycpu | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.controlplanedc3witness.vmbasket) "SMALL" }} +cpuCount: {{ .Values.pool.controlplanedc3witness.vmsmallcpu | quote }} +{{- else }} +cpuCount: {{ .Values.pool.controlplanedc3witness.vmstandardcpu | quote }} +{{- end }} +creationType: template +customAttribute: "" +datacenter: /DCNAME2 +datastore: /DCNAME2/datastore/datastorefolderNAME/{{ .Values.pool.controlplanedc3witness.datastore }} +datastoreCluster: "" +diskSize: {{ .Values.pool.controlplanedc3witness.vmdisk | quote }} +folder: /DCNAME2/vm/ClusterNAME/VMFolderNAME +hostsystem: /DCNAME2/host/ClusterNAME/{{ .Values.pool.controlplanedc3witness.host }} +#memorySize: {{ .Values.pool.controlplanedc3witness.vmram | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.controlplanedc3witness.vmbasket) "TINY" }} +memorySize: {{ .Values.pool.controlplanedc3witness.vmtinyram | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.controlplanedc3witness.vmbasket) "SMALL" }} +memorySize: {{ .Values.pool.controlplanedc3witness.vmsmallram | quote }} +{{- else }} +memorySize: {{ .Values.pool.controlplanedc3witness.vmstandardram | quote }} +{{- end }} +network: +## regex ^\S* +- /DCNAME2/network/{{ regexFind "^\\S*" .Values.pool.controlplanedc3witness.vlan }} +os: linux +password: "" +pool: /DCNAME2/host/ClusterNAME/Resources +tag: +- {{ .Values.tagregion }} +- {{ .Values.tagzone3 }} +vappIpallocationpolicy: fixedAllocated +vappIpprotocol: IPv4 +vappProperty: +- guestinfo.interface.0.ip.0.address=ip:{{ regexFind "^\\S*" .Values.pool.controlplanedc3witness.vlan }} +- guestinfo.interface.0.ip.0.netmask=${netmask:{{ regexFind "^\\S*" .Values.pool.controlplanedc3witness.vlan }}} +- guestinfo.interface.0.route.0.gateway=${gateway:{{ regexFind "^\\S*" .Values.pool.controlplanedc3witness.vlan }}} +- guestinfo.dns.servers=${dns:{{ regexFind "^\\S*" .Values.pool.controlplanedc3witness.vlan }}} +vappTransport: com.vmware.guestInfo +vcenter: "" +vcenterPort: "443" \ No newline at end of file diff --git a/charts/templates/nodeconfig-storage-zone1.yaml b/charts/templates/nodeconfig-storage-zone1.yaml new file mode 100644 index 0000000..ea94adf --- /dev/null +++ b/charts/templates/nodeconfig-storage-zone1.yaml @@ -0,0 +1,88 @@ +apiVersion: rke-machine-config.cattle.io/v1 +kind: VmwarevsphereConfig +metadata: + name: {{ .Values.cluster.name }}-{{ .Values.pool.storagedc1.name }} + namespace: fleet-default +boot2dockerUrl: "" +cfgparam: +- disk.enableUUID=TRUE +cloneFrom: /DCNAME/vm/ClusterNAME/Templates/ubuntu-jammy-cloudimg-templateNAME +cloudConfig: | + #cloud-config + write_files: + - path: /root/apply.sh + permissions: "0644" + owner: root + content: | + #!/bin/bash + vmtoolsd --cmd 'info-get guestinfo.ovfEnv' > /tmp/ovfenv + IFName=`ls -C /sys/class/net/ | awk '{print $1}'` + IPAddress=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.address" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMask=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.netmask" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMaskSN=$(sed -n 's/.*\[\([^]]*\).*/\1/p' /tmp/ovfenv) + Gateway=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.route.0.gateway" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + DNS=$(sed -n 's/.*Property oe:key="guestinfo.dns.servers" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + + cat > /etc/netplan/50-cloud-init.yaml << EOF + network: + ethernets: + $IFName: + dhcp4: no + addresses: [$IPAddress/$SubnetMaskSN] + gateway4: $Gateway + nameservers: + addresses: [$DNS] + search: [your.domainNAME,your.nextdomainNAME] + version: 2 + EOF + sudo netplan apply + runcmd: + - bash /root/apply.sh +cloudinit: "" +common: + labels: null + taints: [] +contentLibrary: "" +#cpuCount: {{ .Values.pool.storagedc1.vmcpu | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.storagedc1.vmbasket) "TINY" }} +cpuCount: {{ .Values.pool.storagedc1.vmtinycpu | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.storagedc1.vmbasket) "SMALL" }} +cpuCount: {{ .Values.pool.storagedc1.vmsmallcpu | quote }} +{{- else }} +cpuCount: {{ .Values.pool.storagedc1.vmstandardcpu | quote }} +{{- end }} +creationType: template +customAttribute: "" +datacenter: /DCNAME +datastore: "" +datastoreCluster: /DCNAME/datastore/datastorefolderNAME/{{ .Values.DC1DatastoreCluster }} +diskSize: {{ .Values.pool.storagedc1.vmdisk | quote }} +folder: /DCNAME/vm/ClusterNAME/VMFolderNAME +hostsystem: /DCNAME/host/ClusterNAME/{{ .Values.pool.storagedc1.host }} +#memorySize: {{ .Values.pool.storagedc1.vmram | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.storagedc1.vmbasket) "TINY" }} +memorySize: {{ .Values.pool.storagedc1.vmtinyram | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.storagedc1.vmbasket) "SMALL" }} +memorySize: {{ .Values.pool.storagedc1.vmsmallram | quote }} +{{- else }} +memorySize: {{ .Values.pool.storagedc1.vmstandardram | quote }} +{{- end }} +network: +## regex ^\S* +- /DCNAME/network/{{ regexFind "^\\S*" .Values.pool.storagedc1.vlan }} +os: linux +password: "" +pool: /DCNAME/host/ClusterNAME/Resources +tag: +- {{ .Values.tagregion }} +- {{ .Values.tagzone1 }} +vappIpallocationpolicy: fixedAllocated +vappIpprotocol: IPv4 +vappProperty: +- guestinfo.interface.0.ip.0.address=ip:{{ regexFind "^\\S*" .Values.pool.storagedc1.vlan }} +- guestinfo.interface.0.ip.0.netmask=${netmask:{{ regexFind "^\\S*" .Values.pool.storagedc1.vlan }}} +- guestinfo.interface.0.route.0.gateway=${gateway:{{ regexFind "^\\S*" .Values.pool.storagedc1.vlan }}} +- guestinfo.dns.servers=${dns:{{ regexFind "^\\S*" .Values.pool.storagedc1.vlan }}} +vappTransport: com.vmware.guestInfo +vcenter: "" +vcenterPort: "443" \ No newline at end of file diff --git a/charts/templates/nodeconfig-storage-zone2.yaml b/charts/templates/nodeconfig-storage-zone2.yaml new file mode 100644 index 0000000..35d07bd --- /dev/null +++ b/charts/templates/nodeconfig-storage-zone2.yaml @@ -0,0 +1,88 @@ +apiVersion: rke-machine-config.cattle.io/v1 +kind: VmwarevsphereConfig +metadata: + name: {{ .Values.cluster.name }}-{{ .Values.pool.storagedc2.name }} + namespace: fleet-default +boot2dockerUrl: "" +cfgparam: +- disk.enableUUID=TRUE +cloneFrom: /DCNAME/vm/ClusterNAME/Templates/ubuntu-jammy-cloudimg-templateNAME +cloudConfig: | + #cloud-config + write_files: + - path: /root/apply.sh + permissions: "0644" + owner: root + content: | + #!/bin/bash + vmtoolsd --cmd 'info-get guestinfo.ovfEnv' > /tmp/ovfenv + IFName=`ls -C /sys/class/net/ | awk '{print $1}'` + IPAddress=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.address" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMask=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.netmask" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMaskSN=$(sed -n 's/.*\[\([^]]*\).*/\1/p' /tmp/ovfenv) + Gateway=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.route.0.gateway" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + DNS=$(sed -n 's/.*Property oe:key="guestinfo.dns.servers" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + + cat > /etc/netplan/50-cloud-init.yaml << EOF + network: + ethernets: + $IFName: + dhcp4: no + addresses: [$IPAddress/$SubnetMaskSN] + gateway4: $Gateway + nameservers: + addresses: [$DNS] + search: [your.domainNAME,your.nextdomainNAME] + version: 2 + EOF + sudo netplan apply + runcmd: + - bash /root/apply.sh +cloudinit: "" +common: + labels: null + taints: [] +contentLibrary: "" +#cpuCount: {{ .Values.pool.storagedc2.vmcpu | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.storagedc2.vmbasket) "TINY" }} +cpuCount: {{ .Values.pool.storagedc2.vmtinycpu | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.storagedc2.vmbasket) "SMALL" }} +cpuCount: {{ .Values.pool.storagedc2.vmsmallcpu | quote }} +{{- else }} +cpuCount: {{ .Values.pool.storagedc2.vmstandardcpu | quote }} +{{- end }} +creationType: template +customAttribute: "" +datacenter:/DCNAME +datastore: "" +datastoreCluster: /DCNAME/datastore/datastorefolderNAME/{{ .Values.DC2DatastoreCluster }} +diskSize: {{ .Values.pool.storagedc2.vmdisk | quote }} +folder: /DCNAME/vm/ClusterNAME/VMFolderNAME +hostsystem: /DCNAME/host/ClusterNAME/{{ .Values.pool.storagedc2.host }} +#memorySize: {{ .Values.pool.storagedc2.vmram | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.storagedc2.vmbasket) "TINY" }} +memorySize: {{ .Values.pool.storagedc2.vmtinyram | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.storagedc2.vmbasket) "SMALL" }} +memorySize: {{ .Values.pool.storagedc2.vmsmallram | quote }} +{{- else }} +memorySize: {{ .Values.pool.storagedc2.vmstandardram | quote }} +{{- end }} +network: +## regex ^\S* +- /DCNAME/network/{{ regexFind "^\\S*" .Values.pool.storagedc2.vlan }} +os: linux +password: "" +pool: /DCNAME/host/ClusterNAME/Resources +tag: +- {{ .Values.tagregion }} +- {{ .Values.tagzone2 }} +vappIpallocationpolicy: fixedAllocated +vappIpprotocol: IPv4 +vappProperty: +- guestinfo.interface.0.ip.0.address=ip:{{ regexFind "^\\S*" .Values.pool.storagedc2.vlan }} +- guestinfo.interface.0.ip.0.netmask=${netmask:{{ regexFind "^\\S*" .Values.pool.storagedc2.vlan }}} +- guestinfo.interface.0.route.0.gateway=${gateway:{{ regexFind "^\\S*" .Values.pool.storagedc2.vlan }}} +- guestinfo.dns.servers=${dns:{{ regexFind "^\\S*" .Values.pool.storagedc2.vlan }}} +vappTransport: com.vmware.guestInfo +vcenter: "" +vcenterPort: "443" \ No newline at end of file diff --git a/charts/templates/nodeconfig-worker-zone1.yaml b/charts/templates/nodeconfig-worker-zone1.yaml new file mode 100644 index 0000000..7bb5a90 --- /dev/null +++ b/charts/templates/nodeconfig-worker-zone1.yaml @@ -0,0 +1,88 @@ +apiVersion: rke-machine-config.cattle.io/v1 +kind: VmwarevsphereConfig +metadata: + name: {{ .Values.cluster.name }}-{{ .Values.pool.workerdc1.name }} + namespace: fleet-default +boot2dockerUrl: "" +cfgparam: +- disk.enableUUID=TRUE +cloneFrom: /DCNAME/vm/ClusterNAME/Templates/ubuntu-jammy-cloudimg-templateNAME +cloudConfig: | + #cloud-config + write_files: + - path: /root/apply.sh + permissions: "0644" + owner: root + content: | + #!/bin/bash + vmtoolsd --cmd 'info-get guestinfo.ovfEnv' > /tmp/ovfenv + IFName=`ls -C /sys/class/net/ | awk '{print $1}'` + IPAddress=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.address" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMask=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.netmask" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMaskSN=$(sed -n 's/.*\[\([^]]*\).*/\1/p' /tmp/ovfenv) + Gateway=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.route.0.gateway" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + DNS=$(sed -n 's/.*Property oe:key="guestinfo.dns.servers" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + + cat > /etc/netplan/50-cloud-init.yaml << EOF + network: + ethernets: + $IFName: + dhcp4: no + addresses: [$IPAddress/$SubnetMaskSN] + gateway4: $Gateway + nameservers: + addresses: [$DNS] + search: [your.domainNAME,your.nextdomainNAME] + version: 2 + EOF + sudo netplan apply + runcmd: + - bash /root/apply.sh +cloudinit: "" +common: + labels: null + taints: [] +contentLibrary: "" +#cpuCount: {{ .Values.pool.workerdc1.vmcpu | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.workerdc1.vmbasket) "TINY" }} +cpuCount: {{ .Values.pool.workerdc1.vmtinycpu | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.workerdc1.vmbasket) "SMALL" }} +cpuCount: {{ .Values.pool.workerdc1.vmsmallcpu | quote }} +{{- else }} +cpuCount: {{ .Values.pool.workerdc1.vmstandardcpu | quote }} +{{- end }} +creationType: template +customAttribute: "" +datacenter: /DCNAME +datastore: "" +datastoreCluster: /DCNAME/datastore/datastorefolderNAME/{{ .Values.DC1DatastoreCluster }} +diskSize: {{ .Values.pool.workerdc1.vmdisk | quote }} +folder: /DCNAME/vm/ClusterNAME/VMFolderNAME +hostsystem: /DCNAME/host/ClusterNAME/{{ .Values.pool.workerdc1.host }} +#memorySize: {{ .Values.pool.workerdc1.vmram | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.workerdc1.vmbasket) "TINY" }} +memorySize: {{ .Values.pool.workerdc1.vmtinyram | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.workerdc1.vmbasket) "SMALL" }} +memorySize: {{ .Values.pool.workerdc1.vmsmallram | quote }} +{{- else }} +memorySize: {{ .Values.pool.workerdc1.vmstandardram | quote }} +{{- end }} +network: +## regex ^\S* +- /DCNAME/network/{{ regexFind "^\\S*" .Values.pool.workerdc1.vlan }} +os: linux +password: "" +pool: /DCNAME/host/ClusterNAME/Resources +tag: +- {{ .Values.tagregion }} +- {{ .Values.tagzone1 }} +vappIpallocationpolicy: fixedAllocated +vappIpprotocol: IPv4 +vappProperty: +- guestinfo.interface.0.ip.0.address=ip:{{ regexFind "^\\S*" .Values.pool.workerdc1.vlan }} +- guestinfo.interface.0.ip.0.netmask=${netmask:{{ regexFind "^\\S*" .Values.pool.workerdc1.vlan }}} +- guestinfo.interface.0.route.0.gateway=${gateway:{{ regexFind "^\\S*" .Values.pool.workerdc1.vlan }}} +- guestinfo.dns.servers=${dns:{{ regexFind "^\\S*" .Values.pool.workerdc1.vlan }}} +vappTransport: com.vmware.guestInfo +vcenter: "" +vcenterPort: "443" \ No newline at end of file diff --git a/charts/templates/nodeconfig-worker-zone2.yaml b/charts/templates/nodeconfig-worker-zone2.yaml new file mode 100644 index 0000000..049f2e0 --- /dev/null +++ b/charts/templates/nodeconfig-worker-zone2.yaml @@ -0,0 +1,88 @@ +apiVersion: rke-machine-config.cattle.io/v1 +kind: VmwarevsphereConfig +metadata: + name: {{ .Values.cluster.name }}-{{ .Values.pool.workerdc2.name }} + namespace: fleet-default +boot2dockerUrl: "" +cfgparam: +- disk.enableUUID=TRUE +cloneFrom: /DCNAME/vm/ClusterNAME/Templates/ubuntu-jammy-cloudimg-templateNAME +cloudConfig: | + #cloud-config + write_files: + - path: /root/apply.sh + permissions: "0644" + owner: root + content: | + #!/bin/bash + vmtoolsd --cmd 'info-get guestinfo.ovfEnv' > /tmp/ovfenv + IFName=`ls -C /sys/class/net/ | awk '{print $1}'` + IPAddress=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.address" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMask=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.netmask" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMaskSN=$(sed -n 's/.*\[\([^]]*\).*/\1/p' /tmp/ovfenv) + Gateway=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.route.0.gateway" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + DNS=$(sed -n 's/.*Property oe:key="guestinfo.dns.servers" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + + cat > /etc/netplan/50-cloud-init.yaml << EOF + network: + ethernets: + $IFName: + dhcp4: no + addresses: [$IPAddress/$SubnetMaskSN] + gateway4: $Gateway + nameservers: + addresses: [$DNS] + search: [your.domainNAME,your.nextdomainNAME] + version: 2 + EOF + sudo netplan apply + runcmd: + - bash /root/apply.sh +cloudinit: "" +common: + labels: null + taints: [] +contentLibrary: "" +#cpuCount: {{ .Values.pool.workerdc2.vmcpu | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.workerdc2.vmbasket) "TINY" }} +cpuCount: {{ .Values.pool.workerdc2.vmtinycpu | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.workerdc2.vmbasket) "SMALL" }} +cpuCount: {{ .Values.pool.workerdc2.vmsmallcpu | quote }} +{{- else }} +cpuCount: {{ .Values.pool.workerdc2.vmstandardcpu | quote }} +{{- end }} +creationType: template +customAttribute: "" +datacenter: /DCNAME +datastore: "" +datastoreCluster: /DCNAME/datastore/datastorefolderNAME/{{ .Values.DC2DatastoreCluster }} +diskSize: {{ .Values.pool.workerdc2.vmdisk | quote }} +folder: /DCNAME/vm/ClusterNAME/VMFolderNAME +hostsystem: /DCNAME/host/ClusterNAME/{{ .Values.pool.workerdc2.host }} +#memorySize: {{ .Values.pool.workerdc2.vmram | quote }} +{{- if eq (regexFind "^\\S*" .Values.pool.workerdc2.vmbasket) "TINY" }} +memorySize: {{ .Values.pool.workerdc2.vmtinyram | quote }} +{{- else if eq (regexFind "^\\S*" .Values.pool.workerdc2.vmbasket) "SMALL" }} +memorySize: {{ .Values.pool.workerdc2.vmsmallram | quote }} +{{- else }} +memorySize: {{ .Values.pool.workerdc2.vmstandardram | quote }} +{{- end }} +network: +## regex ^\S* +- /DCNAME/network/{{ regexFind "^\\S*" .Values.pool.workerdc2.vlan }} +os: linux +password: "" +pool: /DCNAME/host/ClusterNAME/Resources +tag: +- {{ .Values.tagregion }} +- {{ .Values.tagzone2 }} +vappIpallocationpolicy: fixedAllocated +vappIpprotocol: IPv4 +vappProperty: +- guestinfo.interface.0.ip.0.address=ip:{{ regexFind "^\\S*" .Values.pool.workerdc2.vlan }} +- guestinfo.interface.0.ip.0.netmask=${netmask:{{ regexFind "^\\S*" .Values.pool.workerdc2.vlan }}} +- guestinfo.interface.0.route.0.gateway=${gateway:{{ regexFind "^\\S*" .Values.pool.workerdc2.vlan }}} +- guestinfo.dns.servers=${dns:{{ regexFind "^\\S*" .Values.pool.workerdc2.vlan }}} +vappTransport: com.vmware.guestInfo +vcenter: "" +vcenterPort: "443" \ No newline at end of file