Skip to content

Commit

Permalink
Enable parallel image pulls (#21)
Browse files Browse the repository at this point in the history
As of 1.27, Kubernetes added support for parallelizing image pulls but
this is not enabled by default.  This is especially useful in situations
where multiple images need to be downloaded to a host, but one of them
is particularly large.
  • Loading branch information
yankcrime authored Nov 28, 2024
1 parent be3b1c1 commit 744666e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/cluster-api-cluster-openstack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: cluster-api-cluster-openstack
description: A Helm chart to deploy a Kubernetes Cluster
type: application
version: v0.5.6
version: v0.5.7
icon: https://raw.githubusercontent.com/unikorn-cloud/helm-cluster-api/main/icons/default.png
2 changes: 1 addition & 1 deletion charts/cluster-api-cluster-openstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
source:
repoURL: https://unikorn-cloud.github.io/helm-cluster-api
chart: cluster-api-cluster-openstack
targetRevision: v0.5.6
targetRevision: v0.5.7
helm:
releaseName: foo
# Remove the default work queue.
Expand Down
14 changes: 14 additions & 0 deletions charts/cluster-api-cluster-openstack/templates/control-plane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ spec:
skipPhases:
{{- toYaml $.Values.controlPlane.kubeadmSkipPhases | nindent 6 }}
{{- end }}
patches:
directory: /etc/kubernetes/patches
joinConfiguration:
nodeRegistration:
name: {{ "'{{ local_hostname }}'" }}
Expand All @@ -37,6 +39,8 @@ spec:
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 @@ -63,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
13 changes: 13 additions & 0 deletions charts/cluster-api-cluster-openstack/templates/workload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ spec:
path: {{ $file.path }}
permissions: "0600"
{{- end }}
{{- with $config := $pool.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 }}
joinConfiguration:
nodeRegistration:
name: {{ "'{{ local_hostname }}'" }}
Expand All @@ -115,4 +124,8 @@ spec:
node-labels: {{- include "openstack.nodelabels.workload" $context | nindent 14 }}
taints:
{{- include "openstack.taints.workload" $ | nindent 10 }}
{{- if $pool.kubelet }}
patches:
directory: /etc/kubernetes/patches
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions 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 @@ -138,6 +142,11 @@ controlPlane:
# - path: /etc/cat
# content: bWVvdw==
#
# # Additional configuration to be passed to the kubelet can be specifed here
# kubelet:
# # For example:
# serializeImagePulls: false
#
# # Enable or disable cluster autoscaling.
# # This object is considered immutable.
# autoscaling:
Expand Down

0 comments on commit 744666e

Please sign in to comment.