Skip to content

Commit

Permalink
Add support for release CRs (#391)
Browse files Browse the repository at this point in the history
* add support for release CRs

* add support for release CRs

* add support for release CRs

* add support for release CRs

* add support for release CRs

* add support for release CRs

* add support for release CRs

* add support for release CRs

* testing
  • Loading branch information
njuettner authored Nov 7, 2024
1 parent 3d06e3f commit 9a94d43
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 22 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### :warning: **Breaking change** :warning:

- Support for Release CR's.

<details>
<summary>Migration steps</summary>

* In ConfigMap `<cluster name>-userconfig` set `.Values.global.release` to the release version, e.g. `27.0.0`.
* In App `<cluster name>` set the `version` to an empty string.
</details>

## [0.62.0] - 2024-10-21

> [!WARNING]
Expand Down
5 changes: 3 additions & 2 deletions examples/cluster-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ data:
ntp:
- 10.10.10.123
global:
release: "27.0.0"
release:
version: 27.0.0
connectivity:
network:
loadBalancers:
Expand Down Expand Up @@ -88,4 +89,4 @@ spec:
userConfig:
configMap:
name: testing-cluster-user-values
namespace: org-multi-project
namespace: org-multi-project
16 changes: 12 additions & 4 deletions helm/cluster-cloud-director/README.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions helm/cluster-cloud-director/ci/ci-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ global:
userContext:
secretRef:
secretName: vcd-credentials
release:
version: 27.0.0
cluster:
internal:
ephemeralConfiguration:
offlineTesting:
renderWithoutReleaseResource: true
providerIntegration:
components:
systemd:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ global:
userContext:
secretRef:
secretName: vcd-credentials
release:
version: 27.0.0
cluster:
internal:
ephemeralConfiguration:
offlineTesting:
renderWithoutReleaseResource: true
7 changes: 7 additions & 0 deletions helm/cluster-cloud-director/ci/test-wc-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ global:
userContext:
secretRef:
secretName: vcd-credentials
release:
version: 27.0.0
cluster:
internal:
ephemeralConfiguration:
offlineTesting:
renderWithoutReleaseResource: true
12 changes: 10 additions & 2 deletions helm/cluster-cloud-director/templates/helpers/_controlplane.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ Generates template spec for controlplane machines.
{{- $pool = set $pool "diskSize" ( include "calculateDiskBytes" $pool.diskSizeGB ) -}}
{{- $pool = unset $pool "diskSizeGB" -}}

{{- if $pool }}
{{- $osName := include "cluster.os.name" $ }}
{{- $osReleaseChannel := include "cluster.os.releaseChannel" $ }}
{{- $osVersion := include "cluster.os.version" $ }}
{{- $kubernetesVersion := include "cluster.component.kubernetes.version" $ }}
{{- $osToolingVersion := include "cluster.os.tooling.version" $ }}

{{- /* Modify $pool.template here */ -}}
{{- $templateValue := printf "%s-%s-%s-kube-%s-tooling-%s-gs" $osName $osReleaseChannel $osVersion $kubernetesVersion $osToolingVersion -}}
{{- $_ := set $pool "template" $templateValue -}}

{{- $pool | toYaml }}
{{- end }}
vmNamingTemplate: {{ $.Values.global.providerSpecific.vmNamingTemplate }}
{{- if $.Values.global.connectivity.network.extraOvdcNetworks }}
extraOvdcNetworks:
Expand Down
14 changes: 11 additions & 3 deletions helm/cluster-cloud-director/templates/helpers/_workers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@ Generates template spec for worker machines.
{{- $pool = unset $pool "customNodeLabels" -}}
{{- $pool = unset $pool "customNodeTaints" -}}

{{- if $pool }}
{{- $osName := include "cluster.os.name" $ }}
{{- $osReleaseChannel := include "cluster.os.releaseChannel" $ }}
{{- $osVersion := include "cluster.os.version" $ }}
{{- $kubernetesVersion := include "cluster.component.kubernetes.version" $ }}
{{- $osToolingVersion := include "cluster.os.tooling.version" $ }}

{{- /* Modify $pool.template here */ -}}
{{- $templateValue := printf "%s-%s-%s-kube-%s-tooling-%s-gs" $osName $osReleaseChannel $osVersion $kubernetesVersion $osToolingVersion -}}
{{- $_ := set $pool "template" $templateValue -}}

{{- $pool | toYaml }}
{{- end }}
vmNamingTemplate: {{ $.Values.global.providerSpecific.vmNamingTemplate }}
{{- if $.Values.global.connectivity.network.extraOvdcNetworks }}
extraOvdcNetworks:
Expand All @@ -33,4 +41,4 @@ MachineDeployments. Used when templating VCDMachineTemplates.
{{- $_ := set $nodeMap $index $pool -}}
{{- end -}}
{{ toYaml $nodeMap }}
{{- end }}
{{- end }}
27 changes: 20 additions & 7 deletions helm/cluster-cloud-director/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@
"template": {
"type": "string",
"title": "Template",
"description": "Name of the template used to create the node VMs.",
"default": "flatcar-stable-3815.2.2-kube-v1.27.14-gs"
"description": "Name of the template used to create the node VMs."
}
},
"type": "object",
Expand Down Expand Up @@ -423,7 +422,6 @@
"usermod -aG root nobody"
]
},
"kubernetesVersion": "1.27.14",
"provider": "cloud-director",
"resourcesApi": {
"bastionResourceEnabled": false,
Expand All @@ -442,14 +440,14 @@
"machineHealthCheckResourceEnabled": false,
"nodePoolKind": "MachineDeployment"
},
"useReleases": true,
"workers": {
"defaultNodePools": {
"def00": {
"catalog": "giantswarm",
"diskSize": "30",
"replicas": 2,
"sizingPolicy": "m1.large",
"template": "flatcar-stable-3815.2.2-kube-v1.27.14-gs"
"sizingPolicy": "m1.large"
}
},
"resources": {
Expand Down Expand Up @@ -526,6 +524,8 @@
"type": "object",
"title": "Global parameters",
"required": [
"metadata",
"release",
"connectivity",
"controlPlane",
"nodePools"
Expand Down Expand Up @@ -811,8 +811,7 @@
"type": "object",
"title": "Template to define control plane nodes",
"required": [
"catalog",
"template"
"catalog"
],
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -1201,6 +1200,20 @@
]
}
}
},
"release": {
"type": "object",
"title": "Release",
"description": "Information about the workload cluster release.",
"required": [
"version"
],
"properties": {
"version": {
"type": "string",
"title": "Version"
}
}
}
}
},
Expand Down
6 changes: 2 additions & 4 deletions helm/cluster-cloud-director/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ cluster:
name: etc-hosts-entries.service
postKubeadmCommands:
- usermod -aG root nobody
kubernetesVersion: 1.27.14
provider: cloud-director
resourcesApi:
bastionResourceEnabled: false
Expand All @@ -220,14 +219,14 @@ cluster:
version: v1beta2
machineHealthCheckResourceEnabled: false
nodePoolKind: MachineDeployment
useReleases: true
workers:
defaultNodePools:
def00:
catalog: giantswarm
diskSize: "30"
replicas: 2
sizingPolicy: m1.large
template: flatcar-stable-3815.2.2-kube-v1.27.14-gs
resources:
infrastructureMachineTemplateSpecTemplateName: worker-vcdmachinetemplate-spec
connectivity:
Expand All @@ -253,7 +252,6 @@ global:
controlPlane:
machineTemplate:
catalog: giantswarm
template: flatcar-stable-3815.2.2-kube-v1.27.14-gs
oidc: {}
replicas: 1
metadata:
Expand All @@ -263,7 +261,6 @@ global:
worker:
catalog: giantswarm
replicas: 2
template: flatcar-stable-3815.2.2-kube-v1.27.14-gs
podSecurityStandards:
enforced: true
providerSpecific:
Expand All @@ -283,6 +280,7 @@ global:
userContext:
secretRef: {}
vmBootstrapFormat: ignition
release: {}
internal:
kubectlImage:
name: giantswarm/kubectl
Expand Down

0 comments on commit 9a94d43

Please sign in to comment.