Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ runs:
echo "cluster-api-provider-openstack=$(jq -r '.["cluster-api-provider-openstack"]' "$DEPENDENCIES_PATH")" >> $GITHUB_OUTPUT
echo "cert-manager=$(jq -r '.["cert-manager"]' "$DEPENDENCIES_PATH")" >> $GITHUB_OUTPUT
echo "helm=$(jq -r '.["helm"]' "$DEPENDENCIES_PATH")" >> $GITHUB_OUTPUT
echo "openstack-resource-controller=$(jq -r '.["openstack-resource-controller"]' "$DEPENDENCIES_PATH")" >> $GITHUB_OUTPUT
echo "sonobuoy=$(jq -r '.["sonobuoy"]' "$DEPENDENCIES_PATH")" >> $GITHUB_OUTPUT
env:
DEPENDENCIES_PATH: ${{ inputs.dependencies-path }}
Expand Down Expand Up @@ -90,6 +91,16 @@ runs:
CAPI_VERSION: ${{ steps.deps.outputs.cluster-api }}
CAPO_VERSION: ${{ steps.deps.outputs.cluster-api-provider-openstack }}

- name: Install openstack-resource-controller
shell: bash
run: |
ORC_URL=https://github.com/k-orc/openstack-resource-controller/releases/download/${ORC_VERSION}/install.yaml
if ! kubectl apply --server-side -f ${ORC_URL}; then
kubectl apply --server-side --force-conflicts -f ${ORC_URL}
fi
env:
ORC_VERSION: ${{ steps.deps.outputs.openstack-resource-controller }}

- name: Install Cluster API add-on provider
shell: bash
run: |-
Expand Down
20 changes: 18 additions & 2 deletions .github/actions/upgrade-and-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@ runs:
--set kubernetesVersion=${{ inputs.kubernetes-version }} \
--set machineImageId=${{ inputs.image-id }}

- name: Check for cluster deployment ready condition name
id: check-ready-condition
shell: bash
run: |-
cluster_api_version=$(kubectl api-resources \
--api-group=cluster.x-k8s.io \
--no-headers=true |\
grep ^clusters |\
awk '{print $3}')

if [[ "$cluster_api_version" =~ v1beta1$ ]]; then
echo "ready-condition-name=ready" >> $GITHUB_OUTPUT
else
echo "ready-condition-name=available" >> $GITHUB_OUTPUT
fi

# Wait for any upgrade to start before checking if it is complete
# This is to make sure the controller has actioned the update before
# progressing to wait for ready
Expand All @@ -82,15 +98,15 @@ runs:
shell: bash
run: |-
kubectl wait clusters/${{ inputs.name }} \
--for=condition=ready=false \
--for=condition=${{ steps.check-ready-condition.outputs.ready-condition-name }}=false \
--timeout 2m
continue-on-error: true

- name: Wait for cluster ready
shell: bash
run: |-
kubectl wait clusters/${{ inputs.name }} \
--for=condition=ready \
--for=condition=${{ steps.check-ready-condition.outputs.ready-condition-name }} \
--timeout 30m

- name: Wait for machine deployments to be running
Expand Down
1 change: 1 addition & 0 deletions .github/values/leafcloud/latest-full.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
clusterNetworking:
internalNetwork:
networkMTU: 1450
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its scary that we need this now? Does it not just get the default MTU correctly?

# Reset the network filter so a network is provisioned
networkFilter: ~
4 changes: 4 additions & 0 deletions .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ jobs:
- key: helm
type: github
repo: helm/helm

- key: openstack-resource-controller
type: github
repo: k-orc/openstack-resource-controller

- key: sonobuoy
type: github
Expand Down
4 changes: 2 additions & 2 deletions charts/openstack-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ templates for more details.

First, you must set up a
[Cluster API management cluster](https://cluster-api.sigs.k8s.io/user/concepts.html#management-cluster)
with the [OpenStack Infrastructure Provider](https://github.com/kubernetes-sigs/cluster-api-provider-openstack)
installed.
with both the [OpenStack Infrastructure Provider](https://github.com/kubernetes-sigs/cluster-api-provider-openstack)
and [OpenStack Resource Controller](https://github.com/k-orc/openstack-resource-controller) installed.

Addons are managed by the
[Cluster API Addon Provider](https://github.com/azimuth-cloud/cluster-api-addon-provider),
Expand Down
8 changes: 5 additions & 3 deletions charts/openstack-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ Outputs the node registration object for setting node labels.
{{- define "openstack-cluster.nodeRegistration.nodeLabels" -}}
nodeRegistration:
kubeletExtraArgs:
node-labels: "{{ range $i, $k := (keys . | sortAlpha) }}{{ if ne $i 0 }},{{ end }}{{ $k }}={{ index $ $k }}{{ end }}"
- name: "node-labels"
value: "{{ range $i, $k := (keys . | sortAlpha) }}{{ if ne $i 0 }},{{ end }}{{ $k }}={{ index $ $k }}{{ end }}"
{{- end }}

{{/*
Expand Down Expand Up @@ -272,7 +273,7 @@ files:
{{- range $registry, $registrySpec := . }}
- path: /etc/containerd/certs.d/{{ $registry }}/hosts.toml
content: |
{{- include "openstack-cluster.registryFile" (list $registry $registrySpec) | nindent 6 }}
{{- include "openstack-cluster.registryFile" (list $registry $registrySpec) | indent 6 }}
owner: root:root
permissions: "0644"
{{- end }}
Expand Down Expand Up @@ -414,7 +415,8 @@ webhooks and policies for audit logging can be added here.
clusterConfiguration:
apiServer:
extraArgs:
v: {{ $ctx.Values.apiServer.logLevel | quote }}
- name: "v"
value: {{ $ctx.Values.apiServer.logLevel | quote }}
{{- if ne $authWebhook "none" }}
{{- if eq $authWebhook "azimuth-authorization-webhook" }}
authorization-config: /etc/kubernetes/webhooks/authorization_config.yaml
Expand Down
3 changes: 3 additions & 0 deletions charts/openstack-cluster/templates/cluster-openstack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ spec:
- {{ include "openstack-cluster.convert.neutronFilter" . | nindent 6 }}
{{- end }}
{{- else }}
{{- with .networkMTU }}
networkMTU: {{ . }}
{{- end }}
managedSubnets:
- cidr: {{ .nodeCidr }}
{{- with (default $.Values.clusterNetworking.dnsNameservers .dnsNameservers) }}
Expand Down
8 changes: 3 additions & 5 deletions charts/openstack-cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: {{ include "openstack-cluster.clusterName" . }}
Expand All @@ -8,12 +8,10 @@ metadata:
spec:
clusterNetwork: {{ .Values.kubeNetwork | toYaml | nindent 4 }}
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
apiGroup: controlplane.cluster.x-k8s.io
kind: KubeadmControlPlane
name: {{ include "openstack-cluster.componentName" (list . "control-plane") }}
namespace: {{ .Release.Namespace }}
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiGroup: infrastructure.cluster.x-k8s.io
kind: OpenStackCluster
name: {{ include "openstack-cluster.clusterName" . }}
namespace: {{ .Release.Namespace }}
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@ preKubeadmCommands:
clusterConfiguration:
apiServer:
extraArgs:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh my... we override this at quite a few places in the templates :/

oidc-issuer-url: {{ quote .issuerUrl }}
oidc-client-id: {{ required "clientId is required for OIDC" .clientId | quote }}
oidc-username-claim: {{ quote .usernameClaim }}
oidc-username-prefix: {{ quote .usernamePrefix }}
oidc-groups-claim: {{ quote .groupsClaim }}
oidc-groups-prefix: {{ quote .groupsPrefix }}
oidc-signing-algs: {{ quote .signingAlgs }}
- name: "oidc-issuer-url"
value: "{{ quote .issuerUrl }}"
- name: "oidc-client-id"
value: "{{ required "clientId is required for OIDC" .clientId | quote }}"
- name: "oidc-username-claim"
value: "{{ quote .usernameClaim }}"
- name: "oidc-username-prefix"
value: "{{ quote .usernamePrefix }}"
- name: "oidc-groups-claim"
value: "{{ quote .groupsClaim }}"
- name: "oidc-groups-prefix"
value: "{{ quote .groupsPrefix }}"
- name: "oidc-signing-algs"
value: "{{ quote .signingAlgs }}"
{{- end }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -150,7 +157,8 @@ files:
clusterConfiguration:
apiServer:
extraArgs:
admission-control-config-file: /etc/kubernetes/admission/configuration.yaml
- name: "admission-control-config-file"
value: "/etc/kubernetes/admission/configuration.yaml"
extraVolumes:
- name: admission-configuration
hostPath: /etc/kubernetes/admission
Expand All @@ -160,7 +168,7 @@ clusterConfiguration:
{{- end }}

---
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
kind: KubeadmControlPlane
metadata:
name: {{ include "openstack-cluster.componentName" (list . "control-plane") }}
Expand All @@ -177,19 +185,20 @@ spec:
trimPrefix "v"
}}
replicas: {{ .Values.controlPlane.machineCount }}
remediationStrategy: {{ toYaml .Values.controlPlane.remediationStrategy | nindent 4 }}
rolloutStrategy: {{ toYaml .Values.controlPlane.rolloutStrategy | nindent 4 }}
remediation: {{ toYaml .Values.controlPlane.remediation | nindent 4 }}
rollout: {{ toYaml .Values.controlPlane.rollout | nindent 6 }}
machineTemplate:
metadata:
labels: {{ include "openstack-cluster.componentSelectorLabels" (list . "control-plane") | nindent 8 }}
infrastructureRef:
kind: OpenStackMachineTemplate
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
name: {{ include "openstack-cluster.controlplane.mt.name" . }}
namespace: {{ .Release.Namespace }}
nodeDrainTimeout: {{ .Values.controlPlane.nodeDrainTimeout }}
nodeVolumeDetachTimeout: {{ .Values.controlPlane.nodeVolumeDetachTimeout }}
nodeDeletionTimeout: {{ .Values.controlPlane.nodeDeletionTimeout }}
spec:
infrastructureRef:
kind: OpenStackMachineTemplate
apiGroup: infrastructure.cluster.x-k8s.io
name: {{ include "openstack-cluster.controlplane.mt.name" . }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we have to drop namespace here? Do we need namespace in the outer KubeadmControlPlane CRD?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have to drop namespace yes - I'll go check on whether it can live on the outer KubeadmControlPlane CRD.

deletion:
nodeDrainTimeoutSeconds: {{ .Values.controlPlane.nodeDrainTimeoutSeconds }}
nodeVolumeDetachTimeoutSeconds: {{ .Values.controlPlane.nodeVolumeDetachTimeoutSeconds }}
nodeDeletionTimeoutSeconds: {{ .Values.controlPlane.nodeDeletionTimeoutSeconds }}
kubeadmConfigSpec: {{
omit
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.controlPlane.healthCheck.enabled }}
---
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: MachineHealthCheck
metadata:
name: {{ include "openstack-cluster.componentName" (list . "control-plane") }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ joinConfiguration: {{ include "openstack-cluster.nodeRegistration.nodeLabels" $n
{{- range $nodeGroupOverrides := .Values.nodeGroups }}
{{- $nodeGroup := deepCopy $.Values.nodeGroupDefaults | mustMerge $nodeGroupOverrides }}
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was v1beta1 removed? I think we probabably need some bit notes in the release notes about what capi-helm-chart versions depend on, like what is the minimum version, so that the upgrades are smooth. I am hoping we can bump all the capi capo operators, nothing breaks using the older version of the helm chart, then we move to this version of the helm chart, and we are good, but I am assuming we were too late for that? (Sorry being slow getting my head around the upgrade path here).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v1beta1 wasn't/isn't removed in this version, so clusters defined with that version can still be worked on by the updated CAPI - we test this by deploying a cluster at the latest tag in this repo, then upgrading to the tip of the feature branch (here: https://github.com/azimuth-cloud/capi-helm-charts/actions/runs/18321667523/job/52195259366?pr=616).

kind: KubeadmConfigTemplate
metadata:
name: {{ include "openstack-cluster.nodegroup.kct.name" (list $ $nodeGroup) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{- fail (printf "Node group name must be at least three characters long and must contain only lower-case alphanumeric characters and dashes (found name: %s)" $nodeGroup.name) }}
{{- end }}
---
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: MachineDeployment
metadata:
name: {{ include "openstack-cluster.componentName" (list $ $nodeGroup.name) }}
Expand Down Expand Up @@ -35,7 +35,10 @@ spec:
{{- if not $nodeGroup.autoscale }}
replicas: {{ $nodeGroup.machineCount | required (printf "no machine count specified for node group '%s'" $nodeGroup.name) }}
{{- end }}
strategy: {{ toYaml $nodeGroup.rolloutStrategy | nindent 4 }}
rollout:
strategy: {{ toYaml $nodeGroup.rollout.strategy | nindent 6 }}
deletion:
order: {{ $nodeGroup.deletion.order }}
selector:
matchLabels:
{{- include "openstack-cluster.componentSelectorLabels" (list $ "worker") | nindent 6 }}
Expand All @@ -59,14 +62,15 @@ spec:
{{- end }}
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
apiGroup: bootstrap.cluster.x-k8s.io
kind: KubeadmConfigTemplate
name: {{ include "openstack-cluster.nodegroup.kct.name" (list $ $nodeGroup) }}
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiGroup: infrastructure.cluster.x-k8s.io
kind: OpenStackMachineTemplate
name: {{ include "openstack-cluster.nodegroup.mt.name" (list $ $nodeGroup) }}
nodeDrainTimeout: {{ $nodeGroup.nodeDrainTimeout }}
nodeVolumeDetachTimeout: {{ $nodeGroup.nodeVolumeDetachTimeout }}
nodeDeletionTimeout: {{ $nodeGroup.nodeDeletionTimeout }}
deletion:
nodeDrainTimeoutSeconds: {{ $nodeGroup.nodeDrainTimeoutSeconds }}
nodeVolumeDetachTimeoutSeconds: {{ $nodeGroup.nodeVolumeDetachTimeoutSeconds }}
nodeDeletionTimeoutSeconds: {{ $nodeGroup.nodeDeletionTimeoutSeconds }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $nodeGroup := deepCopy $.Values.nodeGroupDefaults | mustMerge $nodeGroupOverrides }}
{{- if $nodeGroup.healthCheck.enabled }}
---
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: MachineHealthCheck
metadata:
name: {{ include "openstack-cluster.componentName" (list $ $nodeGroup.name) }}
Expand Down
Loading
Loading