|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * scalability_and_performance/cnf-tuning-low-latency-hosted-cp-nodes-with-perf-profile.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="apply-performance-profile-hosted-cluster_{context}"] |
| 7 | += Configuring low-latency tuning in a hosted cluster |
| 8 | + |
| 9 | +To set low latency with the performance profile on the nodes in your hosted cluster, you can use the Node Tuning Operator. In {hcp}, you can configure low-latency tuning by creating config maps that contain `Tuned` objects and referencing those config maps in your node pools. The tuned object in this case is a `PerformanceProfile` object that defines the performance profile you want to apply to the nodes in a node pool. |
| 10 | + |
| 11 | +.Procedure |
| 12 | + |
| 13 | +. Export the management cluster `kubeconfig` file by running the following command: |
| 14 | ++ |
| 15 | +[source,terminal] |
| 16 | +---- |
| 17 | +$ export MGMT_KUBECONFIG=<path_to_mgmt_kubeconfig> |
| 18 | +---- |
| 19 | + |
| 20 | +. Create the `ConfigMap` object in the management cluster by running the following command: |
| 21 | ++ |
| 22 | +[source,terminal] |
| 23 | +---- |
| 24 | +$ oc --kubeconfig="$MGMT_KUBECONFIG" apply -f my-hosted-cp-performance-profile.yaml |
| 25 | +---- |
| 26 | + |
| 27 | +. Edit the `NodePool` object in the `clusters` namespace adding the `spec.tuningConfig` field and the name of the created performance profile in that field by running the following command: |
| 28 | ++ |
| 29 | +[source,terminal] |
| 30 | +---- |
| 31 | +$ oc edit np -n clusters |
| 32 | +---- |
| 33 | ++ |
| 34 | +[source,yaml] |
| 35 | +---- |
| 36 | +apiVersion: hypershift.openshift.io/v1beta1 |
| 37 | +kind: NodePool |
| 38 | +metadata: |
| 39 | + annotations: |
| 40 | + hypershift.openshift.io/nodePoolCurrentConfig: 2f752a2c |
| 41 | + hypershift.openshift.io/nodePoolCurrentConfigVersion: 998aa3ce |
| 42 | + hypershift.openshift.io/nodePoolPlatformMachineTemplate: democluster-us-east-1a-3dff55ec |
| 43 | + creationTimestamp: "2025-04-09T09:41:55Z" |
| 44 | + finalizers: |
| 45 | + - hypershift.openshift.io/finalizer |
| 46 | + generation: 1 |
| 47 | + labels: |
| 48 | + hypershift.openshift.io/auto-created-for-infra: democluster |
| 49 | + name: democluster-us-east-1a |
| 50 | + namespace: clusters |
| 51 | + ownerReferences: |
| 52 | + - apiVersion: hypershift.openshift.io/v1beta1 |
| 53 | + kind: HostedCluster |
| 54 | + name: democluster |
| 55 | + uid: af77e390-c289-433c-9d29-3aee8e5dc76f |
| 56 | + resourceVersion: "53056" |
| 57 | + uid: 11efa47c-5a7b-476c-85cf-a274f748a868 |
| 58 | +spec: |
| 59 | + tuningConfig: |
| 60 | + - name: performance |
| 61 | + arch: amd64 |
| 62 | + clusterName: democluster |
| 63 | + management: |
| 64 | +---- |
| 65 | ++ |
| 66 | +[NOTE] |
| 67 | +==== |
| 68 | +You can reference the same profile in multiple node pools. In {hcp}, the Node Tuning Operator appends a hash of the node pool name and namespace to the name of the `Tuned` custom resources to distinguish them. After you make the changes, the system detects that a configuration change is required and starts a rolling update of the nodes in that pool to apply the new configuration. |
| 69 | +==== |
| 70 | + |
| 71 | +.Verification |
| 72 | + |
| 73 | +. List all node pools across all namespaces by running the following command: |
| 74 | ++ |
| 75 | +[source,terminal] |
| 76 | +---- |
| 77 | +$ oc --kubeconfig="$MGMT_KUBECONFIG" get np -A |
| 78 | +---- |
| 79 | ++ |
| 80 | +.Example output |
| 81 | +[source,terminal] |
| 82 | +---- |
| 83 | +NAMESPACE NAME CLUSTER DESIRED NODES CURRENT NODES AUTOSCALING AUTOREPAIR VERSION UPDATINGVERSION UPDATINGCONFIG MESSAGE |
| 84 | +clusters democluster-us-east-1a democluster 1 1 False False 4.17.0 False True |
| 85 | +---- |
| 86 | ++ |
| 87 | +[NOTE] |
| 88 | +==== |
| 89 | +The `UPDATINGCONFIG` field indicates whether the node pool is in the process of updating its configuration. During this update, the `UPDATINGCONFIG` field in the node pool's status becomes `True`. The new configuration is considered fully applied only when the `UPDATINGCONFIG` field returns to `False`. |
| 90 | +==== |
| 91 | + |
| 92 | +. List all config maps in the `clusters-democluster` namespace by running the following command: |
| 93 | ++ |
| 94 | +[source,terminal] |
| 95 | +---- |
| 96 | +$ oc --kubeconfig="$MGMT_KUBECONFIG" get cm -n clusters-democluster |
| 97 | +---- |
| 98 | ++ |
| 99 | +.Example output |
| 100 | +[source,terminal] |
| 101 | +---- |
| 102 | +NAME DATA AGE |
| 103 | +aggregator-client-ca 1 69m |
| 104 | +auth-config 1 68m |
| 105 | +aws-cloud-config 1 68m |
| 106 | +aws-ebs-csi-driver-trusted-ca-bundle 1 66m |
| 107 | +... 1 67m |
| 108 | +kubelet-client-ca 1 69m |
| 109 | +kubeletconfig-performance-democluster-us-east-1a 1 22m |
| 110 | +... |
| 111 | +ovnkube-identity-cm 2 66m |
| 112 | +performance-democluster-us-east-1a 1 22m |
| 113 | +... |
| 114 | +tuned-performance-democluster-us-east-1a 1 22m |
| 115 | +---- |
| 116 | ++ |
| 117 | +The output shows a kubeletconfig `kubeletconfig-performance-democluster-us-east-1a` and a performance profile `performance-democluster-us-east-1a` has been created. The Node Tuning Operator syncs the `Tuned` objects into the hosted cluster. You can verify which `Tuned` objects are defined and which profiles are applied to each node. |
| 118 | + |
| 119 | +. List available secrets on the management cluster by running the following command: |
| 120 | ++ |
| 121 | +[source,terminal] |
| 122 | +---- |
| 123 | +$ oc get secrets -n clusters |
| 124 | +---- |
| 125 | ++ |
| 126 | +.Example output |
| 127 | +[source,terminal] |
| 128 | +---- |
| 129 | +NAME TYPE DATA AGE |
| 130 | +builder-dockercfg-25qpp kubernetes.io/dockercfg 1 128m |
| 131 | +default-dockercfg-mkvlz kubernetes.io/dockercfg 1 128m |
| 132 | +democluster-admin-kubeconfig Opaque 1 127m |
| 133 | +democluster-etcd-encryption-key Opaque 1 128m |
| 134 | +democluster-kubeadmin-password Opaque 1 126m |
| 135 | +democluster-pull-secret Opaque 1 128m |
| 136 | +deployer-dockercfg-8lfpd kubernetes.io/dockercfg 1 128m |
| 137 | +---- |
| 138 | + |
| 139 | +. Extract the `kubeconfig` file for the hosted cluster by running the following command: |
| 140 | ++ |
| 141 | +[source,terminal] |
| 142 | +---- |
| 143 | +$ oc get secret <secret_name> -n clusters -o jsonpath='{.data.kubeconfig}' | base64 -d > hosted-cluster-kubeconfig |
| 144 | +---- |
| 145 | ++ |
| 146 | +.Example |
| 147 | +[source,terminal] |
| 148 | +---- |
| 149 | +$ oc get secret democluster-admin-kubeconfig -n clusters -o jsonpath='{.data.kubeconfig}' | base64 -d > hosted-cluster-kubeconfig |
| 150 | +---- |
| 151 | + |
| 152 | +. Export the hosted cluster kubeconfig by running the following command: |
| 153 | ++ |
| 154 | +[source,terminal] |
| 155 | +---- |
| 156 | +$ export HC_KUBECONFIG=<path_to_hosted-cluster-kubeconfig> |
| 157 | +---- |
| 158 | + |
| 159 | +. Verify that the kubeletconfig is mirrored in the hosted cluster by running the following command: |
| 160 | ++ |
| 161 | +[source,terminal] |
| 162 | +---- |
| 163 | +$ oc --kubeconfig="$HC_KUBECONFIG" get cm -n openshift-config-managed | grep kubelet |
| 164 | +---- |
| 165 | ++ |
| 166 | +.Example output |
| 167 | +[source,terminal] |
| 168 | +---- |
| 169 | +kubelet-serving-ca 1 79m |
| 170 | +kubeletconfig-performance-democluster-us-east-1a 1 15m |
| 171 | +---- |
| 172 | + |
| 173 | +. Verify that the `single-numa-node` policy is set on the hosted cluster by running the following command: |
| 174 | ++ |
| 175 | +[source,terminal] |
| 176 | +---- |
| 177 | +$ oc --kubeconfig="$HC_KUBECONFIG" get cm kubeletconfig-performance-democluster-us-east-1a -o yaml -n openshift-config-managed | grep single |
| 178 | +---- |
| 179 | ++ |
| 180 | +.Example output |
| 181 | +[source,terminal] |
| 182 | +---- |
| 183 | + topologyManagerPolicy: single-numa-node |
| 184 | +---- |
0 commit comments