diff --git a/Makefile b/Makefile index 33d639e..1f6488b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Update this for every tagged release. -CHART_VERSION = v0.2.0 +CHART_VERSION = v0.2.1 # Defines the versions to use for cluster API components. CAPI_VERSION = v1.7.4 @@ -24,7 +24,7 @@ all: cluster-api .PHONY: cluster-api cluster-api: $(CHARTS) - ./generate-capi.py $(CHARTS) + ./generate-capi.py -v $(CHART_VERSION) -c $(CAPI_VERSION) $(CHARTS) .PHONY: cluster-api-core cluster-api-core: diff --git a/README.md b/README.md index 4d66b97..37b51c6 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ There is a top level chart-of-charts that will just install everything as a big ```shell helm repo add unikorn-cloud-capi https://unikorn-cloud.github.io/helm-cluster-api helm repo update -helm upgrade --install cluster-api unikorn-cloud-capi/cluster-api -n cluster-api --create-namespace --version v0.2.0 +helm upgrade --install cluster-api unikorn-cloud-capi/cluster-api -n cluster-api --create-namespace --version v0.2.1 ``` @@ -47,7 +47,7 @@ spec: source: repoURL: https://unikorn-cloud.github.io/helm-cluster-api chart: cluster-api - targetRevision: v0.2.0 + targetRevision: v0.2.1 destination: server: https://kubernetes.default.svc namespace: cluster-api @@ -89,7 +89,7 @@ You may want to be a little less gung-ho and deploy the pieces as separate appli ```shell helm repo add unikorn-cloud-capi https://unikorn-cloud.github.io/helm-cluster-api helm repo update -helm upgrade --install cluster-api-core unikorn-cloud-capi/cluster-api-core -n cluster-api --create-namespace --version v0.2.0 +helm upgrade --install cluster-api-core unikorn-cloud-capi/cluster-api-core -n cluster-api --create-namespace --version v0.2.1 ``` @@ -108,7 +108,7 @@ spec: source: repoURL: https://unikorn-cloud.github.io/helm-cluster-api chart: cluster-api-core - targetRevision: v0.2.0 + targetRevision: v0.2.1 destination: server: https://kubernetes.default.svc namespace: cluster-api @@ -141,7 +141,7 @@ spec: ```shell helm repo add unikorn-cloud-capi https://unikorn-cloud.github.io/helm-cluster-api helm repo update -helm upgrade --install cluster-api-bootstrap-kubeadm unikorn-cloud-capi/cluster-api-bootstrap-kubeadm -n cluster-api --create-namespace --version v0.2.0 +helm upgrade --install cluster-api-bootstrap-kubeadm unikorn-cloud-capi/cluster-api-bootstrap-kubeadm -n cluster-api --create-namespace --version v0.2.1 ``` @@ -160,7 +160,7 @@ spec: source: repoURL: https://unikorn-cloud.github.io/helm-cluster-api chart: cluster-api-bootstrap-kubeadm - targetRevision: v0.2.0 + targetRevision: v0.2.1 destination: server: https://kubernetes.default.svc namespace: cluster-api @@ -186,7 +186,7 @@ spec: ```shell helm repo add unikorn-cloud-capi https://unikorn-cloud.github.io/helm-cluster-api helm repo update -helm upgrade --install cluster-api-control-plane-kubeadm unikorn-cloud-capi/cluster-api-control-plane-kubeadm -n cluster-api --create-namespace --version v0.2.0 +helm upgrade --install cluster-api-control-plane-kubeadm unikorn-cloud-capi/cluster-api-control-plane-kubeadm -n cluster-api --create-namespace --version v0.2.1 ``` @@ -205,7 +205,7 @@ spec: source: repoURL: https://unikorn-cloud.github.io/helm-cluster-api chart: cluster-api-control-plane-kubeadm - targetRevision: v0.2.0 + targetRevision: v0.2.1 destination: server: https://kubernetes.default.svc namespace: cluster-api diff --git a/README.provider-openstack.md b/README.provider-openstack.md index 84bbae1..177a303 100644 --- a/README.provider-openstack.md +++ b/README.provider-openstack.md @@ -8,7 +8,7 @@ ```shell helm repo add unikorn-cloud-capi https://unikorn-cloud.github.io/helm-cluster-api helm repo update -helm upgrade --install cluster-api-provider-openstack unikorn-cloud-capi/cluster-api-provider-openstack -n cluster-api --create-namespace --version v0.2.0 +helm upgrade --install cluster-api-provider-openstack unikorn-cloud-capi/cluster-api-provider-openstack -n cluster-api --create-namespace --version v0.2.1 ``` @@ -28,7 +28,7 @@ spec: source: repoURL: https://unikorn-cloud.github.io/helm-cluster-api chart: cluster-api-provider-openstack - targetRevision: v0.2.0 + targetRevision: v0.2.1 destination: server: https://kubernetes.default.svc namespace: cluster-api diff --git a/charts/cluster-api-bootstrap-kubeadm/Chart.yaml b/charts/cluster-api-bootstrap-kubeadm/Chart.yaml index a179b1e..664c3ba 100644 --- a/charts/cluster-api-bootstrap-kubeadm/Chart.yaml +++ b/charts/cluster-api-bootstrap-kubeadm/Chart.yaml @@ -4,4 +4,4 @@ description: A Helm chart for deploying cluster API. icon: https://assets.unikorn-cloud.org/assets/images/logos/dark-on-light/icon.png name: cluster-api-bootstrap-kubeadm type: application -version: v0.2.0 +version: v0.2.1 diff --git a/charts/cluster-api-cluster-openstack/Chart.yaml b/charts/cluster-api-cluster-openstack/Chart.yaml index b0ef277..8fe85a3 100644 --- a/charts/cluster-api-cluster-openstack/Chart.yaml +++ b/charts/cluster-api-cluster-openstack/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: cluster-api-cluster-openstack description: A Helm chart to deploy a Kubernetes Cluster type: application -version: v0.4.3 +version: v0.4.4 icon: https://raw.githubusercontent.com/unikorn-cloud/helm-cluster-api/main/icons/default.png diff --git a/charts/cluster-api-cluster-openstack/README.md b/charts/cluster-api-cluster-openstack/README.md index 1e90acf..1ed1c4f 100644 --- a/charts/cluster-api-cluster-openstack/README.md +++ b/charts/cluster-api-cluster-openstack/README.md @@ -36,7 +36,7 @@ spec: source: repoURL: https://unikorn-cloud.github.io/helm-cluster-api chart: cluster-api-cluster-openstack - targetRevision: v0.4.3 + targetRevision: v0.4.4 helm: releaseName: foo # Remove the default work queue. diff --git a/charts/cluster-api-cluster-openstack/templates/control-plane.yaml b/charts/cluster-api-cluster-openstack/templates/control-plane.yaml index 4229ae4..42ef4c1 100644 --- a/charts/cluster-api-cluster-openstack/templates/control-plane.yaml +++ b/charts/cluster-api-cluster-openstack/templates/control-plane.yaml @@ -25,6 +25,10 @@ spec: node-labels: {{- include "openstack.nodelabels.control-plane" . | nindent 12 }} taints: {{- include "openstack.taints.control-plane" . | nindent 8 }} + {{- if .Values.controlPlane.kubeadmSkipPhases }} + skipPhases: + {{- toYaml $.Values.controlPlane.kubeadmSkipPhases | nindent 6 }} + {{- end }} joinConfiguration: nodeRegistration: name: {{ "'{{ local_hostname }}'" }} diff --git a/charts/cluster-api-cluster-openstack/values.schema.json b/charts/cluster-api-cluster-openstack/values.schema.json index e682849..672c3f1 100644 --- a/charts/cluster-api-cluster-openstack/values.schema.json +++ b/charts/cluster-api-cluster-openstack/values.schema.json @@ -312,6 +312,12 @@ }, "machine": { "$ref": "#/$defs/machine" + }, + "kubeadmSkipPhases": { + "type": "array", + "items": { + "type": "string" + } } } }, diff --git a/charts/cluster-api-cluster-openstack/values.yaml b/charts/cluster-api-cluster-openstack/values.yaml index a385b56..bda114d 100644 --- a/charts/cluster-api-cluster-openstack/values.yaml +++ b/charts/cluster-api-cluster-openstack/values.yaml @@ -73,19 +73,29 @@ openstack: # Modifications to this object will trigger a control plane upgrade. controlPlane: # Version of Kubernetes, should match that installed on the base images. - version: v1.25.2 + version: v1.30.2 # Number of control plane machines. replicas: 3 + # kubeadm uses phases to init a node. + # https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init-phase + # Any phase can be skipped by adding --skip-phase NAME to the kubeadm init command. + # To skip kubeadm phases in Unikorn, you can supply a list below + # WARNING: Skipping phases may cause cluster instability so make sure you know what you're skipping before enabling this! + # List of Phases: https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/ + kubeadmSkipPhases: [] + # - addon/kube-proxy + # - addon/coredns + # Defines the physical properties of a machine. # Modifications to this object will trigger a control plane upgrade. machine: # Openstack image name. imageID: f810a963-437d-4a24-a972-a0bff942542b - # Control plane machine type. - flavorID: 6ac45c49-3e3b-4cdf-acbc-d98a321a92c0 + # Control plane machine type (This is the name of the flavor rather than the actual ID). + flavorID: some-flavor-name # Ephemeral disk size in GiB. If specified this overrides the default # size for the flavor. @@ -100,7 +110,7 @@ controlPlane: # default: # # Version of Kubernetes, should match that installed on the base images # # in order to improve provisioning and scaling time. -# version: v1.25.2 +# version: v1.30.2 # # # Number of workload machines. # replicas: 3 @@ -111,8 +121,8 @@ controlPlane: # # Openstack image name. # imageID: f810a963-437d-4a24-a972-a0bff942542b # -# # Workload machine type. -# flavorID: 6ac45c49-3e3b-4cdf-acbc-d98a321a92c0 +# # Workload machine type (This is the name of the flavor rather than the actual ID). +# flavorID: some-flavor-name # # # Ephemeral disk size in GiB. If specified this overrides the default # # size for the flavor. diff --git a/charts/cluster-api-control-plane-kubeadm/Chart.yaml b/charts/cluster-api-control-plane-kubeadm/Chart.yaml index 3bba173..8f959cd 100644 --- a/charts/cluster-api-control-plane-kubeadm/Chart.yaml +++ b/charts/cluster-api-control-plane-kubeadm/Chart.yaml @@ -4,4 +4,4 @@ description: A Helm chart for deploying cluster API. icon: https://assets.unikorn-cloud.org/assets/images/logos/dark-on-light/icon.png name: cluster-api-control-plane-kubeadm type: application -version: v0.2.0 +version: v0.2.1 diff --git a/charts/cluster-api-core/Chart.yaml b/charts/cluster-api-core/Chart.yaml index 729efb5..41e0167 100644 --- a/charts/cluster-api-core/Chart.yaml +++ b/charts/cluster-api-core/Chart.yaml @@ -4,4 +4,4 @@ description: A Helm chart for deploying cluster API. icon: https://assets.unikorn-cloud.org/assets/images/logos/dark-on-light/icon.png name: cluster-api-core type: application -version: v0.2.0 +version: v0.2.1 diff --git a/charts/cluster-api-provider-openstack/Chart.yaml b/charts/cluster-api-provider-openstack/Chart.yaml index 2e8edd8..4ad8fc0 100644 --- a/charts/cluster-api-provider-openstack/Chart.yaml +++ b/charts/cluster-api-provider-openstack/Chart.yaml @@ -4,4 +4,4 @@ description: A Helm chart for deploying cluster API. icon: https://assets.unikorn-cloud.org/assets/images/logos/dark-on-light/icon.png name: cluster-api-provider-openstack type: application -version: v0.2.0 +version: v0.2.1 diff --git a/charts/cluster-api/Chart.yaml b/charts/cluster-api/Chart.yaml index 3ad2065..aa3261a 100644 --- a/charts/cluster-api/Chart.yaml +++ b/charts/cluster-api/Chart.yaml @@ -1,24 +1,24 @@ apiVersion: v2 -appVersion: v1.6.2 +appVersion: v1.7.4 name: cluster-api description: A Helm chart to deploy Cluster API type: application -version: v0.2.0 +version: v0.2.1 icon: https://assets.unikorn-cloud.org/assets/images/logos/dark-on-light/icon.png dependencies: - name: cluster-api-core - version: v0.2.0 + version: v0.2.1 repository: file://../cluster-api-core - name: cluster-api-bootstrap-kubeadm - version: v0.2.0 + version: v0.2.1 repository: file://../cluster-api-bootstrap-kubeadm condition: kubeadm.enabled - name: cluster-api-control-plane-kubeadm - version: v0.2.0 + version: v0.2.1 repository: file://../cluster-api-control-plane-kubeadm condition: kubeadm.enabled - name: cluster-api-provider-openstack - version: v0.2.0 + version: v0.2.1 repository: file://../cluster-api-provider-openstack condition: openstack.enabled diff --git a/generate-capi.py b/generate-capi.py index eba18e6..c1273a8 100755 --- a/generate-capi.py +++ b/generate-capi.py @@ -1,14 +1,23 @@ #!/usr/bin/env python3 +import argparse +import re import sys def main(): + parser = argparse.ArgumentParser() + parser.add_argument('-v', '--version', help="Chart version") + parser.add_argument('-c', '--capi-version', help='Cluster API version') + parser.add_argument('subcharts', nargs='+', help="Subcharts to include") + + args = parser.parse_args() + chunks = [] with open('charts/cluster-api/values.yaml.tmpl') as file: chunks.append(file.read()) - for chart in sys.argv[1:]: + for chart in args.subcharts: chunk = [f"{chart}:\n"] with open(f'charts/{chart}/values.yaml') as file: @@ -19,5 +28,25 @@ def main(): with open('charts/cluster-api/values.yaml', 'w') as file: file.write('\n'.join(chunks)) + with open(f'charts/cluster-api/Chart.yaml', 'w') as file: + file.write("apiVersion: v2\n") + file.write(f"appVersion: {args.capi_version}\n") + file.write("name: cluster-api\n") + file.write("description: A Helm chart to deploy Cluster API\n") + file.write("type: application\n") + file.write(f"version: {args.version}\n") + file.write("icon: https://assets.unikorn-cloud.org/assets/images/logos/dark-on-light/icon.png\n") + file.write("\n") + file.write("dependencies:\n") + + for chart in args.subcharts: + file.write(f"- name: {chart}\n") + file.write(f" version: {args.version}\n") + file.write(f" repository: file://../{chart}\n") + # Oh for want of a better way of doing this... + matches = re.match(r'^cluster-api-(?:bootstrap|control-plane|provider)-(.*)', chart) + if matches: + file.write(f" condition: {matches[1]}.enabled\n") + if __name__ == '__main__': main()