|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// *scalability_and_performance/cnf-numa-aware-scheduling.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="cnf-creating-nrop-cr-hosted-control-plane_{context}"] |
| 7 | += Creating the NUMAResourcesOperator custom resource for {hcp} |
| 8 | + |
| 9 | +After you install the NUMA Resources Operator, create the `NUMAResourcesOperator` custom resource (CR). The CR instructs the NUMA Resources Operator to install all the cluster infrastructure that is needed to support the NUMA-aware scheduler on {hcp}, including daemon sets and APIs. |
| 10 | + |
| 11 | +-- |
| 12 | +:FeatureName: Creating the NUMAResourcesOperator custom resource for {hcp} |
| 13 | +include::snippets/technology-preview.adoc[] |
| 14 | +-- |
| 15 | + |
| 16 | +.Prerequisites |
| 17 | + |
| 18 | +* Install the OpenShift CLI (`oc`). |
| 19 | +* Log in as a user with `cluster-admin` privileges. |
| 20 | +* Install the NUMA Resources Operator. |
| 21 | +
|
| 22 | +.Procedure |
| 23 | + |
| 24 | +. Export the management cluster kubeconfig file by running the following command: |
| 25 | ++ |
| 26 | +[source,terminal] |
| 27 | +---- |
| 28 | +$ export KUBECONFIG=<path-to-management-cluster-kubeconfig> |
| 29 | +---- |
| 30 | + |
| 31 | +. Find the `node-pool-name` for your cluster by running the following command: |
| 32 | ++ |
| 33 | +[source,terminal] |
| 34 | +---- |
| 35 | +$ oc --kubeconfig="$MGMT_KUBECONFIG" get np -A |
| 36 | +---- |
| 37 | ++ |
| 38 | +.Example output |
| 39 | +[source,terminal] |
| 40 | +---- |
| 41 | +NAMESPACE NAME CLUSTER DESIRED NODES CURRENT NODES AUTOSCALING AUTOREPAIR VERSION UPDATINGVERSION UPDATINGCONFIG MESSAGE |
| 42 | +clusters democluster-us-east-1a democluster 1 1 False False 4.19.0 False False |
| 43 | +---- |
| 44 | ++ |
| 45 | +The `node-pool-name` is the `NAME` field in the output. In this example, the `node-pool-name` is `democluster-us-east-1a`. |
| 46 | + |
| 47 | +. Create a YAML file named `nrop-hcp.yaml` with at least the following content: |
| 48 | ++ |
| 49 | +[source,yaml] |
| 50 | +---- |
| 51 | +apiVersion: nodetopology.openshift.io/v1 |
| 52 | +kind: NUMAResourcesOperator |
| 53 | +metadata: |
| 54 | + name: numaresourcesoperator |
| 55 | +spec: |
| 56 | + nodeGroups: |
| 57 | + - poolName: democluster-us-east-1a <1> |
| 58 | +---- |
| 59 | ++ |
| 60 | +<1> The `poolName` is the `node-pool-name` retrieved in step 2. |
| 61 | + |
| 62 | +. On the management cluster, run the following command to list the available secrets: |
| 63 | ++ |
| 64 | +[source,terminal] |
| 65 | +---- |
| 66 | +$ oc get secrets -n clusters |
| 67 | +---- |
| 68 | ++ |
| 69 | +.Example output |
| 70 | +[source,terminal] |
| 71 | +---- |
| 72 | +NAME TYPE DATA AGE |
| 73 | +builder-dockercfg-25qpp kubernetes.io/dockercfg 1 128m |
| 74 | +default-dockercfg-mkvlz kubernetes.io/dockercfg 1 128m |
| 75 | +democluster-admin-kubeconfig Opaque 1 127m |
| 76 | +democluster-etcd-encryption-key Opaque 1 128m |
| 77 | +democluster-kubeadmin-password Opaque 1 126m |
| 78 | +democluster-pull-secret Opaque 1 128m |
| 79 | +deployer-dockercfg-8lfpd kubernetes.io/dockercfg 1 128m |
| 80 | +---- |
| 81 | + |
| 82 | +. Extract the `kubeconfig` file for the hosted cluster by running the following command: |
| 83 | ++ |
| 84 | +[source,terminal] |
| 85 | +---- |
| 86 | +$ oc get secret <SECRET_NAME> -n clusters -o jsonpath='{.data.kubeconfig}' | base64 -d > hosted-cluster-kubeconfig |
| 87 | +---- |
| 88 | ++ |
| 89 | +.Example |
| 90 | +[source,terminal] |
| 91 | +---- |
| 92 | +$ oc get secret democluster-admin-kubeconfig -n clusters -o jsonpath='{.data.kubeconfig}' | base64 -d > hosted-cluster-kubeconfig |
| 93 | +---- |
| 94 | + |
| 95 | +. Export the hosted cluster `kubeconfig` file by running the following command: |
| 96 | ++ |
| 97 | +[source,terminal] |
| 98 | +---- |
| 99 | +$ export HC_KUBECONFIG=<path_to_hosted-cluster-kubeconfig> |
| 100 | +---- |
| 101 | + |
| 102 | +. Create the `NUMAResourcesOperator` CR by running the following command on the hosted cluster: |
| 103 | ++ |
| 104 | +[source,terminal] |
| 105 | +---- |
| 106 | +$ oc create -f nrop-hcp.yaml |
| 107 | +---- |
| 108 | + |
| 109 | +.Verification |
| 110 | + |
| 111 | +. Verify that the NUMA Resources Operator deployed successfully by running the following command: |
| 112 | ++ |
| 113 | +[source,terminal] |
| 114 | +---- |
| 115 | +$ oc get numaresourcesoperators.nodetopology.openshift.io |
| 116 | +---- |
| 117 | ++ |
| 118 | +.Example output |
| 119 | +[source,terminal] |
| 120 | +---- |
| 121 | +NAME AGE |
| 122 | +numaresourcesoperator 27s |
| 123 | +---- |
| 124 | + |
| 125 | +. After a few minutes, run the following command to verify that the required resources deployed successfully: |
| 126 | ++ |
| 127 | +[source,terminal] |
| 128 | +---- |
| 129 | +$ oc get all -n openshift-numaresources |
| 130 | +---- |
| 131 | ++ |
| 132 | +.Example output |
| 133 | +[source,terminal] |
| 134 | +---- |
| 135 | +NAME READY STATUS RESTARTS AGE |
| 136 | +pod/numaresources-controller-manager-7d9d84c58d-qk2mr 1/1 Running 0 12m |
| 137 | +pod/numaresourcesoperator-democluster-7d96r 2/2 Running 0 97s |
| 138 | +pod/numaresourcesoperator-democluster-crsht 2/2 Running 0 97s |
| 139 | +pod/numaresourcesoperator-democluster-jp9mw 2/2 Running 0 97s |
| 140 | +---- |
0 commit comments