|
| 1 | +//// |
| 2 | +This module included in the following assemblies: |
| 3 | +service_mesh/v2x/ossm-reference-jaeger.adoc |
| 4 | +//// |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="distr-tracing-config-security-ossm-cli_{context}"] |
| 7 | += Configuring distributed tracing security for service mesh from the command line |
| 8 | + |
| 9 | +You can modify the Jaeger resource to configure {JaegerShortName} security for use with {SMproductShortName} from the command line using the `oc` utility. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +* You have access to the cluster as a user with the `cluster-admin` role. If you use {product-dedicated}, you must have an account with the `dedicated-admin` role. |
| 14 | +* The {SMProductName} Operator must be installed. |
| 15 | +* The `ServiceMeshControlPlane` deployed to the cluster. |
| 16 | +* You have access to the OpenShift CLI (oc) that matches your OpenShift Container Platform version. |
| 17 | +
|
| 18 | +.Procedure |
| 19 | + |
| 20 | +. Log in to the {product-title} CLI as a user with the `cluster-admin` role. If you use {product-dedicated}, you must have an account with the `dedicated-admin` role. |
| 21 | ++ |
| 22 | +[source,terminal] |
| 23 | +---- |
| 24 | +$ oc login https://<HOSTNAME>:6443 |
| 25 | +---- |
| 26 | ++ |
| 27 | +. Change to the project where you installed the control plane, for example `istio-system`, by entering the following command: |
| 28 | ++ |
| 29 | +[source,terminal] |
| 30 | +---- |
| 31 | +$ oc project istio-system |
| 32 | +---- |
| 33 | ++ |
| 34 | +. Run the following command to edit the Jaeger custom resource file, where `jaeger.yaml` is the name of your Jaeger custom resource. |
| 35 | ++ |
| 36 | +[source,terminal] |
| 37 | +---- |
| 38 | +$ oc edit -n tracing-system -f jaeger.yaml |
| 39 | +---- |
| 40 | ++ |
| 41 | +. Edit the `Jaeger` custom resource file to add the `htpasswd` configuration as shown in the following example. |
| 42 | + |
| 43 | +* `spec.ingress.openshift.htpasswdFile` |
| 44 | +* `spec.volumes` |
| 45 | +* `spec.volumeMounts` |
| 46 | ++ |
| 47 | +.Example Jaeger resource showing `htpasswd` configuration |
| 48 | +[source,yaml] |
| 49 | +---- |
| 50 | +apiVersion: jaegertracing.io/v1 |
| 51 | +kind: Jaeger |
| 52 | +spec: |
| 53 | + ingress: |
| 54 | + enabled: true |
| 55 | + openshift: |
| 56 | + htpasswdFile: /etc/proxy/htpasswd/auth |
| 57 | + sar: '{"namespace": "istio-system", "resource": "pods", "verb": "get"}' |
| 58 | + options: {} |
| 59 | + resources: {} |
| 60 | + security: oauth-proxy |
| 61 | + volumes: |
| 62 | + - name: secret-htpasswd |
| 63 | + secret: |
| 64 | + secretName: htpasswd |
| 65 | + - configMap: |
| 66 | + defaultMode: 420 |
| 67 | + items: |
| 68 | + - key: ca-bundle.crt |
| 69 | + path: tls-ca-bundle.pem |
| 70 | + name: trusted-ca-bundle |
| 71 | + optional: true |
| 72 | + name: trusted-ca-bundle |
| 73 | + volumeMounts: |
| 74 | + - mountPath: /etc/proxy/htpasswd |
| 75 | + name: secret-htpasswd |
| 76 | + - mountPath: /etc/pki/ca-trust/extracted/pem/ |
| 77 | + name: trusted-ca-bundle |
| 78 | + readOnly: true |
| 79 | +---- |
| 80 | ++ |
| 81 | +. Run the following command to apply your changes, where <jaeger.yaml> is the name of your Jaeger custom resource. |
| 82 | ++ |
| 83 | +[source,terminal] |
| 84 | +---- |
| 85 | +$ oc apply -n tracing-system -f <jaeger.yaml> |
| 86 | +---- |
| 87 | ++ |
| 88 | +. Run the following command to watch the progress of the pod deployment: |
| 89 | ++ |
| 90 | +[source,terminal] |
| 91 | +---- |
| 92 | +$ oc get pods -n tracing-system -w |
| 93 | +---- |
0 commit comments