From a48495f225c684fd276bb15f9ab252e6468f0e18 Mon Sep 17 00:00:00 2001 From: Nick Jones Date: Wed, 27 Nov 2024 21:18:01 +0000 Subject: [PATCH] Configure file for CP kubelet options Passing options such as the one for serializing image pulls has been deprecated (see warning `Flag --serialize-image-pulls has been deprecated`), so do as the warning suggests and pass these in to a file. --- .../templates/control-plane.yaml | 16 ++++++++++++++-- charts/cluster-api-cluster-openstack/values.yaml | 6 +++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/charts/cluster-api-cluster-openstack/templates/control-plane.yaml b/charts/cluster-api-cluster-openstack/templates/control-plane.yaml index 2c4f685..0886b5d 100644 --- a/charts/cluster-api-cluster-openstack/templates/control-plane.yaml +++ b/charts/cluster-api-cluster-openstack/templates/control-plane.yaml @@ -22,7 +22,6 @@ spec: name: {{ "'{{ local_hostname }}'" }} kubeletExtraArgs: cloud-provider: external - serialize-image-pulls: "true" node-labels: {{- include "openstack.nodelabels.control-plane" . | nindent 12 }} taints: {{- include "openstack.taints.control-plane" . | nindent 8 }} @@ -30,15 +29,18 @@ spec: skipPhases: {{- toYaml $.Values.controlPlane.kubeadmSkipPhases | nindent 6 }} {{- end }} + patches: + directory: /etc/kubernetes/patches joinConfiguration: nodeRegistration: name: {{ "'{{ local_hostname }}'" }} kubeletExtraArgs: cloud-provider: external - serialize-image-pulls: "true" node-labels: {{- include "openstack.nodelabels.control-plane" . | nindent 12 }} taints: {{- include "openstack.taints.control-plane" . | nindent 8 }} + patches: + directory: /etc/kubernetes/patches clusterConfiguration: apiServer: extraArgs: @@ -65,6 +67,16 @@ spec: extraArgs: authorization-always-allow-paths: "/healthz,/readyz,/livez,/metrics" bind-address: "0.0.0.0" + files: + {{- with $config := .Values.controlPlane.kubelet -}} + {{ $_ := set $config "apiVersion" "kubelet.config.k8s.io/v1beta1" -}} + {{ $_ := set $config "kind" "KubeletConfiguration" }} + - path: /etc/kubernetes/patches/kubeletconfiguration0+strategic.json + owner: "root:root" + permissions: "0644" + content: | + {{ $config | toJson }} + {{- end }} --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate diff --git a/charts/cluster-api-cluster-openstack/values.yaml b/charts/cluster-api-cluster-openstack/values.yaml index 1960aaa..58d65c2 100644 --- a/charts/cluster-api-cluster-openstack/values.yaml +++ b/charts/cluster-api-cluster-openstack/values.yaml @@ -98,6 +98,10 @@ controlPlane: # Set the server group of the control plane (e.g. anti-affinity rules). # serverGroupID: foo + # Any additional configuration to be passed to the kubelet can be specifed here + kubelet: + serializeImagePulls: false + # Workload pools topology. # workloadPools: # # Pool name @@ -141,7 +145,7 @@ controlPlane: # # Additional configuration to be passed to the kubelet can be specifed here # kubelet: # # For example: -# serializeImagePulls: "false" +# serializeImagePulls: false # # # Enable or disable cluster autoscaling. # # This object is considered immutable.