|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * hardware_enablement/kmm-kernel-module-management.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="kmm-install-older-version_{context}"] |
| 7 | += Installing the Kernel Module Management Operator on earlier versions of {product-title} |
| 8 | + |
| 9 | +The KMM Operator is supported on {product-title} 4.12 and later. |
| 10 | +For version 4.10 and earlier, you must create a new `SecurityContextConstraint` object and bind it to the Operator's `ServiceAccount`. |
| 11 | +As a cluster administrator, you can install the Kernel Module Management (KMM) Operator by using the OpenShift CLI. |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +* You have a running {product-title} cluster. |
| 16 | +* You installed the OpenShift CLI (`oc`). |
| 17 | +* You are logged into the OpenShift CLI as a user with `cluster-admin` privileges. |
| 18 | +
|
| 19 | +.Procedure |
| 20 | + |
| 21 | +. Install KMM in the `openshift-kmm` namespace: |
| 22 | + |
| 23 | +.. Create the following `Namespace` CR and save the YAML file, for example, `kmm-namespace.yaml` file: |
| 24 | ++ |
| 25 | +[source,yaml] |
| 26 | +---- |
| 27 | +apiVersion: v1 |
| 28 | +kind: Namespace |
| 29 | +metadata: |
| 30 | + name: openshift-kmm |
| 31 | +---- |
| 32 | + |
| 33 | +.. Create the following `SecurityContextConstraint` object and save the YAML file, for example, `kmm-security-constraint.yaml`: |
| 34 | ++ |
| 35 | +[source,yaml] |
| 36 | +---- |
| 37 | +allowHostDirVolumePlugin: false |
| 38 | +allowHostIPC: false |
| 39 | +allowHostNetwork: false |
| 40 | +allowHostPID: false |
| 41 | +allowHostPorts: false |
| 42 | +allowPrivilegeEscalation: false |
| 43 | +allowPrivilegedContainer: false |
| 44 | +allowedCapabilities: |
| 45 | + - NET_BIND_SERVICE |
| 46 | +apiVersion: security.openshift.io/v1 |
| 47 | +defaultAddCapabilities: null |
| 48 | +fsGroup: |
| 49 | + type: MustRunAs |
| 50 | +groups: [] |
| 51 | +kind: SecurityContextConstraints |
| 52 | +metadata: |
| 53 | + name: restricted-v2 |
| 54 | +priority: null |
| 55 | +readOnlyRootFilesystem: false |
| 56 | +requiredDropCapabilities: |
| 57 | + - ALL |
| 58 | +runAsUser: |
| 59 | + type: MustRunAsRange |
| 60 | +seLinuxContext: |
| 61 | + type: MustRunAs |
| 62 | +seccompProfiles: |
| 63 | + - runtime/default |
| 64 | +supplementalGroups: |
| 65 | + type: RunAsAny |
| 66 | +users: [] |
| 67 | +volumes: |
| 68 | + - configMap |
| 69 | + - downwardAPI |
| 70 | + - emptyDir |
| 71 | + - persistentVolumeClaim |
| 72 | + - projected |
| 73 | + - secret |
| 74 | +---- |
| 75 | + |
| 76 | +.. Bind the `SecurityContextConstraint` object to the Operator's `ServiceAccount` by running the following commands: |
| 77 | ++ |
| 78 | +[source,terminal] |
| 79 | +---- |
| 80 | +$ oc apply -f kmm-security-constraint.yaml |
| 81 | +---- |
| 82 | ++ |
| 83 | +[source,terminal] |
| 84 | +---- |
| 85 | +$ oc adm policy add-scc-to-user kmm-security-constraint -z kmm-operator-controller-manager -n openshift-kmm |
| 86 | +---- |
| 87 | + |
| 88 | +.. Create the following `OperatorGroup` CR and save the YAML file, for example, `kmm-op-group.yaml`: |
| 89 | ++ |
| 90 | +[source,yaml] |
| 91 | +---- |
| 92 | +apiVersion: operators.coreos.com/v1 |
| 93 | +kind: OperatorGroup |
| 94 | +metadata: |
| 95 | + name: kernel-module-management |
| 96 | + namespace: openshift-kmm |
| 97 | +---- |
| 98 | + |
| 99 | +.. Create the following `Subscription` CR and save the YAML file, for example, `kmm-sub.yaml`: |
| 100 | ++ |
| 101 | +[source,yaml] |
| 102 | +---- |
| 103 | +apiVersion: operators.coreos.com/v1alpha1 |
| 104 | +kind: Subscription |
| 105 | +metadata: |
| 106 | + name: kernel-module-management |
| 107 | + namespace: openshift-kmm |
| 108 | +spec: |
| 109 | + channel: release-1.0 |
| 110 | + installPlanApproval: Automatic |
| 111 | + name: kernel-module-management |
| 112 | + source: redhat-operators |
| 113 | + sourceNamespace: openshift-marketplace |
| 114 | + startingCSV: kernel-module-management.v1.0.0 |
| 115 | +---- |
| 116 | + |
| 117 | +.. Create the subscription object by running the following command: |
| 118 | ++ |
| 119 | +[source,terminal] |
| 120 | +---- |
| 121 | +$ oc create -f kmm-sub.yaml |
| 122 | +---- |
| 123 | + |
| 124 | +.Verification |
| 125 | + |
| 126 | +* To verify that the Operator deployment is successful, run the following command: |
| 127 | ++ |
| 128 | +[source,terminal] |
| 129 | +---- |
| 130 | +$ oc get -n openshift-kmm deployments.apps kmm-operator-controller-manager |
| 131 | +---- |
| 132 | ++ |
| 133 | +.Example output |
| 134 | +[source,terminal] |
| 135 | +---- |
| 136 | +NAME READY UP-TO-DATE AVAILABLE AGE |
| 137 | +kmm-operator-controller-manager 1/1 1 1 97s |
| 138 | +---- |
| 139 | ++ |
| 140 | +The Operator is available. |
0 commit comments