Skip to content

Commit

Permalink
merge pull request #34 from andrew-morris-rgs/main
Browse files Browse the repository at this point in the history
feat: conforms machine refs to match the $clustername-$nodepool scheme
  • Loading branch information
zackbradys authored Dec 5, 2024
2 parents ffd94c6 + 4c2708c commit 87009fb
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
3 changes: 2 additions & 1 deletion charts/cluster-templates/templates/cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $clustername := .Values.cluster.name -}}
apiVersion: provisioning.cattle.io/v1
kind: Cluster
metadata:
Expand Down Expand Up @@ -154,7 +155,7 @@ spec:
apiVersion: elemental.cattle.io/v1beta1
kind: MachineInventorySelectorTemplate
{{- end}}
name: {{ $nodepool.name }}
name: {{ $clustername }}-{{ $nodepool.name }}
displayName: {{ $nodepool.displayName | default $nodepool.name }}
{{- if $nodepool.drainBeforeDelete }}
drainBeforeDelete: {{ $nodepool.drainBeforeDelete }}
Expand Down
5 changes: 3 additions & 2 deletions charts/cluster-templates/templates/nodeconfig-aws.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{{- $clustername := .Values.cluster.name -}}
{{- if eq .Values.cloudprovider "amazonec2" }}
{{- range $index, $nodepool := .Values.nodepools }}
apiVersion: rke-machine-config.cattle.io/v1
kind: Amazonec2Config
metadata:
name: {{ $nodepool.name }}
name: {{ $clustername }}-{{ $nodepool.name }}
namespace: fleet-default
{{- if $nodepool.accessKey }}
accessKey: {{ $nodepool.accessKey }}
Expand Down Expand Up @@ -123,7 +124,7 @@ zone: {{ $nodepool.zone }}
apiVersion: rke-machine-config.cattle.io/v1
kind: Amazonec2Config
metadata:
name: {{ $nodepool.name }}
name: {{ $clustername }}-{{ $nodepool.name }}
namespace: fleet-default
common:
{{- if $nodepool.labels }}
Expand Down
5 changes: 3 additions & 2 deletions charts/cluster-templates/templates/nodeconfig-azure.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{{- $clustername := .Values.cluster.name -}}
{{- if eq .Values.cloudprovider "azure" }}
{{- range $index, $nodepool := .Values.nodepools }}
apiVersion: rke-machine-config.cattle.io/v1
kind: AzureConfig
metadata:
name: {{ $nodepool.name }}
name: {{ $clustername }}-{{ $nodepool.name }}
namespace: fleet-default
common:
{{- if $nodepool.labels }}
Expand Down Expand Up @@ -50,7 +51,7 @@ vnet: {{ $nodepool.vnet }}
apiVersion: rke-machine-config.cattle.io/v1
kind: AzureConfig
metadata:
name: {{ $nodepool.name }}
name: {{ $clustername }}-{{ $nodepool.name }}
namespace: fleet-default
common:
{{- if $nodepool.labels }}
Expand Down
5 changes: 3 additions & 2 deletions charts/cluster-templates/templates/nodeconfig-do.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{{- $clustername := .Values.cluster.name -}}
{{- if eq .Values.cloudprovider "digitalocean" }}
{{- range $index, $nodepool := .Values.nodepools }}
apiVersion: rke-machine-config.cattle.io/v1
kind: DigitaloceanConfig
metadata:
name: {{ $nodepool.name }}
name: {{ $clustername }}-{{ $nodepool.name }}
namespace: fleet-default
{{- if $nodepool.accessToken }}
accessToken: {{ $nodepool.accessToken }}
Expand Down Expand Up @@ -54,7 +55,7 @@ userdata: {{- $nodepool.userData | toYaml | indent 1 }}
apiVersion: rke-machine-config.cattle.io/v1
kind: DigitaloceanConfig
metadata:
name: {{ $nodepool.name }}
name: {{ $clustername }}-{{ $nodepool.name }}
namespace: fleet-default
{{- if $nodepool.accessToken }}
accessToken: {{ $nodepool.accessToken }}
Expand Down
3 changes: 2 additions & 1 deletion charts/cluster-templates/templates/nodeconfig-elemental.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{{- $clustername := .Values.cluster.name -}}
{{- if eq .Values.cloudprovider "elemental" }}
{{- range $index, $nodepool := .Values.nodepools }}
apiVersion: elemental.cattle.io/v1beta1
kind: MachineInventorySelectorTemplate
metadata:
name: {{ $nodepool.name }}
name: {{ $clustername }}-{{ $nodepool.name }}
namespace: fleet-default
spec:
template:
Expand Down
5 changes: 3 additions & 2 deletions charts/cluster-templates/templates/nodeconfig-harvester.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{{- $clustername := .Values.cluster.name -}}
{{- if eq .Values.cloudprovider "harvester" }}
{{- range $index, $nodepool := .Values.nodepools }}
apiVersion: rke-machine-config.cattle.io/v1
kind: HarvesterConfig
metadata:
name: {{ $nodepool.name }}
name: {{ $clustername }}-{{ $nodepool.name }}
namespace: fleet-default
{{- if $nodepool.cloudConfig }}
cloudConfig: {{$nodepool.cloudconfig }}
Expand Down Expand Up @@ -81,7 +82,7 @@ vmNamespace: {{ $nodepool.vmNamespace }}
apiVersion: rke-machine-config.cattle.io/v1
kind: HarvesterConfig
metadata:
name: {{ $nodepool.name }}
name: {{ $clustername }}-{{ $nodepool.name }}
namespace: fleet-default
common:
{{- if $nodepool.labels }}
Expand Down
5 changes: 3 additions & 2 deletions charts/cluster-templates/templates/nodeconfig-vsphere.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{{- $clustername := .Values.cluster.name -}}
{{- if eq .Values.cloudprovider "vsphere" }}
{{- range $index, $nodepool := .Values.nodepools }}
apiVersion: rke-machine-config.cattle.io/v1
kind: VmwarevsphereConfig
metadata:
name: {{ $nodepool.name }}
name: {{ $clustername }}-{{ $nodepool.name }}
namespace: fleet-default
common:
{{- if $nodepool.labels }}
Expand Down Expand Up @@ -51,7 +52,7 @@ vcenterPort: {{ $nodepool.vcenterPort | squote }}
apiVersion: rke-machine-config.cattle.io/v1
kind: VmwarevsphereConfig
metadata:
name: {{ $nodepool.name }}
name: {{ $clustername }}-{{ $nodepool.name }}
namespace: fleet-default
common:
{{- if $nodepool.labels }}
Expand Down

0 comments on commit 87009fb

Please sign in to comment.