|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * nodes/nodes/nodes-nodes-managing.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="nodes-nodes-parallel-container-pulls-configure_{context}"] |
| 7 | += Configuring parallel container image pulls |
| 8 | + |
| 9 | +You can control the number of images that can be pulled by your workload simultaneously by using a kubelet configuration. |
| 10 | + |
| 11 | +You can set a maximum number of images that can be pulled or force workloads to pull images one at a time. |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +* You have a running {product-title} cluster. |
| 16 | +
|
| 17 | +* You are logged in to the cluster as a user with administrative privileges. |
| 18 | +
|
| 19 | +.Procedure |
| 20 | + |
| 21 | +. Apply a custom label to the machine config pool where you want to configure parallel pulls by running a command similar to the following. |
| 22 | ++ |
| 23 | +[source,terminal] |
| 24 | +---- |
| 25 | +$ oc label machineconfigpool <mcp_name> parallel-pulls=set |
| 26 | +---- |
| 27 | + |
| 28 | +. Create a custom resource (CR) to configure parallel image pulling. |
| 29 | ++ |
| 30 | +[source,yaml] |
| 31 | +---- |
| 32 | +apiVersion: machineconfiguration.openshift.io/v1 |
| 33 | +kind: KubeletConfig |
| 34 | +metadata: |
| 35 | + name: parallel-image-pulls |
| 36 | +# ... |
| 37 | +spec: |
| 38 | + machineConfigPoolSelector: |
| 39 | + matchLabels: |
| 40 | + parallel-pulls: set |
| 41 | + kubeletConfig: |
| 42 | + serializeImagePulls: false <1> |
| 43 | + maxParallelImagePulls: 3 <2> |
| 44 | +# ... |
| 45 | +---- |
| 46 | +<1> Set to `false` to enable parallel image pulls. Set to `true` to force serial image pulling. The default is `false`. |
| 47 | +<2> Specify the maximum number of images that can be pulled in parallel. Enter a number or set to `nil` to specify no limit. This field cannot be set if `SerializeImagePulls` is `true`. The default is `nil`. |
| 48 | + |
| 49 | +. Create the new machine config by running a command similar to the following: |
| 50 | ++ |
| 51 | +[source,terminal] |
| 52 | +---- |
| 53 | +$ oc create -f <file_name>.yaml |
| 54 | +---- |
| 55 | + |
| 56 | +.Verification |
| 57 | + |
| 58 | +. Check the machine configs to see that a new one was added by running the following command: |
| 59 | ++ |
| 60 | +[source,terminal] |
| 61 | +---- |
| 62 | +$ oc get MachineConfig |
| 63 | +---- |
| 64 | ++ |
| 65 | +.Example output |
| 66 | ++ |
| 67 | +[source,terminal] |
| 68 | +---- |
| 69 | +NAME GENERATEDBYCONTROLLER IGNITIONVERSION AGE |
| 70 | +00-master 70025364a114fc3067b2e82ce47fdb0149630e4b 3.5.0 133m |
| 71 | +00-worker 70025364a114fc3067b2e82ce47fdb0149630e4b 3.5.0 133m |
| 72 | +# ... |
| 73 | +99-parallel-generated-kubelet 70025364a114fc3067b2e82ce47fdb0149630e4b 3.5.0 15s <1> |
| 74 | +# ... |
| 75 | +rendered-parallel-c634a80f644740974ceb40c054c79e50 70025364a114fc3067b2e82ce47fdb0149630e4b 3.5.0 10s <2> |
| 76 | +---- |
| 77 | +<1> The new machine config. In this example, the machine config is for the `parallel` custom machine config pool. |
| 78 | +<2> The new rendered machine config. In this example, the machine config is for the `parallel` custom machine config pool. |
| 79 | + |
| 80 | +. Check to see that the nodes in the `parallel` machine config pool are being updated by running the following command: |
| 81 | ++ |
| 82 | +[source,terminal] |
| 83 | +---- |
| 84 | +$ oc get machineconfigpool |
| 85 | +---- |
| 86 | ++ |
| 87 | +.Example output |
| 88 | ++ |
| 89 | +[source,terminal] |
| 90 | +---- |
| 91 | +NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE |
| 92 | +parallel rendered-parallel-3904f0e69130d125b3b5ef0e981b1ce1 False True False 1 0 0 0 65m |
| 93 | +master rendered-master-7536834c197384f3734c348c1d957c18 True False False 3 3 3 0 140m |
| 94 | +worker rendered-worker-c634a80f644740974ceb40c054c79e50 True False False 2 2 2 0 140m |
| 95 | +---- |
| 96 | + |
| 97 | +. When the nodes are updated, verify that the parallel pull maximum was configured: |
| 98 | + |
| 99 | +.. Open an `oc debug` session to a node by running a command similar to the following: |
| 100 | ++ |
| 101 | +[source,terminal] |
| 102 | +---- |
| 103 | +$ oc debug node/<node_name> |
| 104 | +---- |
| 105 | + |
| 106 | +.. Set `/host` as the root directory within the debug shell by running the following command: |
| 107 | ++ |
| 108 | +[source,terminal] |
| 109 | +---- |
| 110 | +sh-5.1# chroot /host |
| 111 | +---- |
| 112 | + |
| 113 | +.. Examine the `kubelet.conf` file by running the following command: |
| 114 | ++ |
| 115 | +[source,terminal] |
| 116 | +---- |
| 117 | +sh-5.1# cat /etc/kubernetes/kubelet.conf | grep -i maxParallelImagePulls |
| 118 | +---- |
| 119 | ++ |
| 120 | +.Example output |
| 121 | ++ |
| 122 | +[source,terminal] |
| 123 | +---- |
| 124 | +maxParallelImagePulls: 3 |
| 125 | +---- |
| 126 | + |
0 commit comments