|
| 1 | +--- |
| 2 | +ref: configure-kubectl-om |
| 3 | +stepnum: 1 |
| 4 | +inherit: |
| 5 | + file: steps-configure-kubectl-namespace.yaml |
| 6 | + ref: configure-kubectl-namespace |
| 7 | +--- |
| 8 | +stepnum: 2 |
| 9 | +level: 4 |
| 10 | +ref: create-pem-file |
| 11 | +title: "Create the PEM file for backups." |
| 12 | +content: | |
| 13 | + |
| 14 | + Create the :opsmgr:`queryable.pem |
| 15 | + </reference/configuration/#brs.queryable.pem>` |
| 16 | + file that you will use for accessing and querying backups based on |
| 17 | + your deployment's |tls| requirements. The PEM file contains a public |
| 18 | + key certificate and its associated private key that are needed to |
| 19 | + access and run queries on |onprem| backup snapshots. |
| 20 | +
|
| 21 | + To learn more about the PEM file's requirements, see |
| 22 | + :opsmgr:`Authorization and Authentication Requirements |
| 23 | + </tutorial/query-backup/#authentication-and-authorization>`. |
| 24 | +
|
| 25 | +--- |
| 26 | +stepnum: 3 |
| 27 | +level: 4 |
| 28 | +ref: create-queryable-pem-secret |
| 29 | +title: "Create a Secret containing the PEM file." |
| 30 | +content: | |
| 31 | + Run the following command to create a Secret with the |
| 32 | + :opsmgr:`queryable.pem </reference/configuration/#brs.queryable.pem>` |
| 33 | + file that you created in the previous step: |
| 34 | +
|
| 35 | + .. code-block:: sh |
| 36 | +
|
| 37 | + kubectl create secret generic queryable-pem --from-file=./queryable.pem |
| 38 | +
|
| 39 | +--- |
| 40 | +title: "Mount the Secret as a volume that |onprem| custom objects will use." |
| 41 | +stepnum: 4 |
| 42 | +level: 4 |
| 43 | +ref: mount-pem-secret |
| 44 | +content: | |
| 45 | +
|
| 46 | + The |k8s-op-short| must be able to access the :opsmgr:`queryable.pem |
| 47 | + </reference/configuration/#brs.queryable.pem>` file in the mount point |
| 48 | + for the persistent volume in the Pod's container for |onprem|. |
| 49 | +
|
| 50 | + To mount the Secret, use one of these methods: |
| 51 | +
|
| 52 | + - Configure volumes using ``volumeClaimTemplates`` and specify the |
| 53 | + location for the :opsmgr:`queryable.pem |
| 54 | + </reference/configuration/#brs.queryable.pem>` file: |
| 55 | +
|
| 56 | + .. code-block:: yaml |
| 57 | + :linenos: |
| 58 | + :emphasize-lines: 9-35 |
| 59 | +
|
| 60 | + apiVersion: mongodb.com/v1 |
| 61 | + kind: MongoDBOpsManager |
| 62 | + metadata: |
| 63 | + name: ops-manager |
| 64 | + spec: |
| 65 | + replicas: 1 |
| 66 | + version: 4.2.12 |
| 67 | + adminCredentials: ops-manager-admin-secret |
| 68 | + configuration: |
| 69 | + mms.fromEmailAddr: "[email protected]" |
| 70 | + brs.queryable.pem: "/certs/queryable.pem" |
| 71 | + |
| 72 | + statefulSet: |
| 73 | + spec: |
| 74 | + # the Persistent Volume Claim is created for each Ops Manager Pod |
| 75 | + volumeClaimTemplates: |
| 76 | + - metadata: |
| 77 | + name: queryable-volume |
| 78 | + spec: |
| 79 | + accessModes: [ "ReadWriteOnce" ] |
| 80 | + storageClassName: <your_storage_class_name> |
| 81 | + resources: |
| 82 | + requests: |
| 83 | + storage: 1G |
| 84 | + template: |
| 85 | + spec: |
| 86 | + containers: |
| 87 | + - name: mongodb-ops-manager |
| 88 | + volumeMounts: |
| 89 | + - name: queryable-volume |
| 90 | + - mountPath: /certs |
| 91 | + volumes: |
| 92 | + - name: queryable-pem |
| 93 | + secret: |
| 94 | + secretName: queryable-pem |
| 95 | +
|
| 96 | + applicationDatabase: |
| 97 | + members: 3 |
| 98 | + version: 4.2.6-ent |
| 99 | +
|
| 100 | + - Configure volumes without using ``volumeClaimTemplates`` and specify |
| 101 | + the location for the :opsmgr:`queryable.pem |
| 102 | + </reference/configuration/#brs.queryable.pem>` file: |
| 103 | +
|
| 104 | + .. code-block:: yaml |
| 105 | + :linenos: |
| 106 | + :emphasize-lines: 9-24 |
| 107 | +
|
| 108 | + apiVersion: mongodb.com/v1 |
| 109 | + kind: MongoDBOpsManager |
| 110 | + metadata: |
| 111 | + name: ops-manager |
| 112 | + spec: |
| 113 | + replicas: 1 |
| 114 | + version: 4.2.12 |
| 115 | + adminCredentials: ops-manager-admin-secret |
| 116 | + configuration: |
| 117 | + brs.queryable.pem: "/certs/queryable.pem" |
| 118 | + mms.fromEmailAddr: "[email protected]" |
| 119 | + statefulSet: |
| 120 | + template: |
| 121 | + spec: |
| 122 | + containers: |
| 123 | + - name: mongodb-ops-manager |
| 124 | + volumeMounts: |
| 125 | + - name: queryable-volume |
| 126 | + - mountPath: /certs/ |
| 127 | + |
| 128 | + volumes: |
| 129 | + - name: queryable-pem |
| 130 | + secret: |
| 131 | + secretName: queryable-pem |
| 132 | + |
| 133 | + applicationDatabase: |
| 134 | + members: 3 |
| 135 | + version: 4.2.6-ent |
| 136 | +
|
| 137 | +--- |
| 138 | +title: "Save your |onprem| config file." |
| 139 | +stepnum: 5 |
| 140 | +level: 4 |
| 141 | +ref: save-config-file |
| 142 | + |
| 143 | +--- |
| 144 | +title: "Apply changes to your |onprem| deployment." |
| 145 | +stepnum: 6 |
| 146 | +level: 4 |
| 147 | +ref: apply-queryable-backup-changes-om-k8s |
| 148 | +content: | |
| 149 | +
|
| 150 | + Invoke the following ``kubectl`` command on the filename of the |
| 151 | + |onprem| resource definition: |
| 152 | +
|
| 153 | + .. code-block:: sh |
| 154 | +
|
| 155 | + kubectl apply -f <opsmgr-resource>.yaml |
| 156 | +
|
| 157 | + When you apply the changes to your |onprem| resource |
| 158 | + definition, |k8s| updates the |onprem| StatefulSet, |
| 159 | + creates the volumes, and mounts the Secrets. |
| 160 | +
|
| 161 | +--- |
| 162 | +stepnum: 7 |
| 163 | +title: "Track the status of the mounted volumes and Secrets." |
| 164 | +level: 4 |
| 165 | +ref: track-k8s-deployment-om-queryable-backup-config |
| 166 | +content: | |
| 167 | +
|
| 168 | + a. Obtain the list of persistent volume claims: |
| 169 | +
|
| 170 | + .. code-block:: sh |
| 171 | +
|
| 172 | + kubectl get pvc |
| 173 | +
|
| 174 | + #. Obtain the Secrets: |
| 175 | + |
| 176 | + .. code-block:: sh |
| 177 | +
|
| 178 | + kubectl get secrets |
| 179 | +
|
| 180 | + #. Check the status of your |onprem| resources: |
| 181 | + |
| 182 | + .. code-block:: sh |
| 183 | + |
| 184 | + kubectl get om <resource-name> -o yaml -w |
| 185 | +
|
| 186 | + The ``-w`` flag means "watch". With the "watch" flag set, the |
| 187 | + output refreshes immediately when the configuration changes until |
| 188 | + the status phase achieves the ``Running`` state. |
| 189 | +
|
| 190 | + To learn more about the resource deployment statuses, see |
| 191 | + :doc:`/reference/troubleshooting`. |
0 commit comments