Skip to content

Commit

Permalink
Configure file for CP kubelet options
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yankcrime committed Nov 28, 2024
1 parent e0717eb commit a48495f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
16 changes: 14 additions & 2 deletions charts/cluster-api-cluster-openstack/templates/control-plane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,25 @@ 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 }}
{{- if .Values.controlPlane.kubeadmSkipPhases }}
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:
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion charts/cluster-api-cluster-openstack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a48495f

Please sign in to comment.