doc-exports/docs/asm/umn/asm_faq_0049.html
Dong, Qiu Jian e743e7f7b8 ASM UMN update 20241012
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com>
Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
2024-10-18 07:32:37 +00:00

96 lines
10 KiB
HTML

<a name="asm_faq_0049"></a><a name="asm_faq_0049"></a>
<h1 class="topictitle1">How Do I Connect a Service Mesh to Jaeger or Zipkin for Viewing Traces?</h1>
<div id="body0000001953665368"><p id="asm_faq_0049__p1255084518506">ASM can export traces to Jaeger or Zipkin. You can view them on the Jaeger or Zipkin UI. The following uses Zipkin as an example.</p>
<div class="section" id="asm_faq_0049__section36511139314"><h4 class="sectiontitle">Prerequisites</h4><p id="asm_faq_0049__p4558172118611">The cluster and namespace where Zipkin is to be installed have been specified.</p>
</div>
<div class="section" id="asm_faq_0049__section5871427115120"><h4 class="sectiontitle">Procedure</h4><ol id="asm_faq_0049__ol19812285213"><li id="asm_faq_0049__li098232175213"><a name="asm_faq_0049__li098232175213"></a><a name="li098232175213"></a><span>Create a Deployment named <strong id="asm_faq_0049__b1720043173914">zipkin</strong>.</span><p><p id="asm_faq_0049__p24511053145119">Log in to the CCE console and click the cluster name to go to the cluster console. In the navigation pane, choose <strong id="asm_faq_0049__b299024534215">Workloads</strong>. On the <strong id="asm_faq_0049__b20551165010425">Deployments</strong> tab, click <strong id="asm_faq_0049__b84442405423">Create from YAML</strong>, and copy the following content to the YAML file:</p>
<pre class="screen" id="asm_faq_0049__screen876244915616">apiVersion: apps/v1
kind: Deployment
metadata:
name: zipkin
namespace: monitoring
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/instance: zipkin
app.kubernetes.io/name: zipkin
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/instance: zipkin
app.kubernetes.io/name: zipkin
spec:
automountServiceAccountToken: false
containers:
- env:
- name: STORAGE_TYPE
value: mem
image: openzipkin/zipkin-slim:latest # Community Zipkin image path. Ensure that you can access this path.
imagePullPolicy: IfNotPresent
name: zipkin
readinessProbe:
failureThreshold: 3
httpGet:
path: /health
port: 9411
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 500m
memory: 4Gi
requests:
cpu: 100m
memory: 128Mi
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
terminationGracePeriodSeconds: 30</pre>
<p id="asm_faq_0049__p64533535513">The Deployment named <strong id="asm_faq_0049__b1542917044816">zipkin</strong> is displayed on the <strong id="asm_faq_0049__b122941179482">Deployments</strong> tab. If the status of <strong id="asm_faq_0049__b1792103255418">zipkin</strong> changes to <strong id="asm_faq_0049__b2142194785419">Running</strong>, Zipkin has been installed in the <strong id="asm_faq_0049__b149877125519">monitoring</strong> namespace of the target cluster.</p>
<p id="asm_faq_0049__p12915155520167"></p>
<div class="note" id="asm_faq_0049__note1614844414238"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="asm_faq_0049__p91481244152319">You can also refer to <a href="https://zipkin.io/pages/quickstart.html" target="_blank" rel="noopener noreferrer">Zipkin official website documentation</a> to complete the installation.</p>
</div></div>
</p></li><li id="asm_faq_0049__li139077291524"><a name="asm_faq_0049__li139077291524"></a><a name="li139077291524"></a><span>Create a Service of the LoadBalancer type.</span><p><p id="asm_faq_0049__p82931961535">On the cluster console, choose <strong id="asm_faq_0049__b181255321717">Services &amp; Ingresses</strong> in the navigation pane. On the <strong id="asm_faq_0049__b165383711120">Services</strong> tab, click <strong id="asm_faq_0049__b2096712551818">Create Service</strong>. Then, configure the parameters as follows:</p>
<ul id="asm_faq_0049__ul457511661315"><li id="asm_faq_0049__li1957511651311"><strong id="asm_faq_0049__b183851619826">Service Name</strong>: Enter a name. <strong id="asm_faq_0049__b724132610215">zipkin</strong> is used as an example here.</li><li id="asm_faq_0049__li168222810133"><strong id="asm_faq_0049__b45682105314">Service Type</strong>: Select <strong id="asm_faq_0049__b8568151016317">LoadBalancer</strong>.</li><li id="asm_faq_0049__li2225151117137"><strong id="asm_faq_0049__b116548271312">Selector</strong>: Click <strong id="asm_faq_0049__b477114461447">Reference Workload Label</strong>. The label is automatically added.</li><li id="asm_faq_0049__li1249291391315"><strong id="asm_faq_0049__b1143412131882">Ports</strong>: Configure the container port and Service port. <strong id="asm_faq_0049__b1145913281881">9411</strong> is used as an example here.</li></ul>
<p id="asm_faq_0049__p1054024811212">Retain the default values for other parameters.</p>
<p id="asm_faq_0049__p1813462713182"></p>
<p id="asm_faq_0049__p1228116117231">The Service named <strong id="asm_faq_0049__b01191472313">zipkin</strong> is displayed on the <strong id="asm_faq_0049__b71191676312">Services</strong> tab.</p>
<p id="asm_faq_0049__p1829426115320"></p>
<div class="caution" id="asm_faq_0049__note531232182212"><span class="cautiontitle"><img src="public_sys-resources/caution_3.0-en-us.png"> </span><div class="cautionbody"><p id="asm_faq_0049__p13363282212">If you do not need to access the Zipkin UI, set <strong id="asm_faq_0049__b169334233214">Access Type</strong> to <strong id="asm_faq_0049__b4971887338">ClusterIP</strong>.</p>
</div></div>
</p></li><li id="asm_faq_0049__li13729338114412"><span>Buy a service mesh and interconnect it with Zipkin.</span><p><p id="asm_faq_0049__p178544214419">Log in to the ASM console and click . In <strong id="asm_faq_0049__b25262914373">Cluster Configuration</strong>, select the cluster in <a href="#asm_faq_0049__li098232175213">1</a>. In <strong id="asm_faq_0049__b119744819378">Observability Configuration</strong>, enable tracing. Then, select <strong id="asm_faq_0049__b3741155114113">Third-party Jaeger/Zipkin service</strong> for <strong id="asm_faq_0049__b129028384435">Version</strong>, set <strong id="asm_faq_0049__b6563615174517">Service Address</strong> and <strong id="asm_faq_0049__b15594118184511">Access Port</strong>, and configure other parameters as required.</p>
<p id="asm_faq_0049__p138755284596"></p>
<div class="caution" id="asm_faq_0049__note1954184272911"><span class="cautiontitle"><img src="public_sys-resources/caution_3.0-en-us.png"> </span><div class="cautionbody"><p id="asm_faq_0049__p5541194213296">The value of <strong id="asm_faq_0049__b328316538457">Service Address</strong> is <em id="asm_faq_0049__i145201645134915">{Service name}</em><strong id="asm_faq_0049__b14606164913498">.</strong><em id="asm_faq_0049__i18501105534915">{Namespace}</em><strong id="asm_faq_0049__b1735704504">.svc.cluster.local</strong>. Replace <em id="asm_faq_0049__i1140244855114">{Service name}</em> and <em id="asm_faq_0049__i566095955112">{Namespace}</em> with those specified in <a href="#asm_faq_0049__li139077291524">2</a>.</p>
<p id="asm_faq_0049__p9502451103216">The value of <strong id="asm_faq_0049__b866100145419">Access Port</strong> is that specified in <a href="#asm_faq_0049__li139077291524">2</a>.</p>
</div></div>
</p></li><li id="asm_faq_0049__li359554412532"><span>. After the deployment is complete, the services shown in the following figure are displayed on the <strong id="asm_faq_0049__b12741242574">Service Management</strong> page.</span><p><p id="asm_faq_0049__p1912126104113"></p>
</p></li><li id="asm_faq_0049__li11168185540"><span>Access the productpage details page to trigger tracing.</span><p><p id="asm_faq_0049__p994155384316">Go to the service mesh details page. In the navigation pane, choose <strong id="asm_faq_0049__b1794819291214">Service Management</strong>. On the displayed page, click the external address <strong id="asm_faq_0049__b8391193317134">http://</strong><em id="asm_faq_0049__i19361530171312">{IP address}</em><strong id="asm_faq_0049__b3838132317585">:</strong><em id="asm_faq_0049__i1939011246589">{Port number}</em><strong id="asm_faq_0049__b1083813236584">/productpage</strong> of the <strong id="asm_faq_0049__b7804940162011">productpage</strong> service.</p>
</p></li><li id="asm_faq_0049__li97966665113"><span>View the traces on the Zipkin UI at <strong id="asm_faq_0049__b1818212220317">http://</strong><em id="asm_faq_0049__i744022917316">{Public IP address of the load balancer configured for <strong id="asm_faq_0049__b5406145520">zipkin</strong>}</em><strong id="asm_faq_0049__b123921011345">:</strong><em id="asm_faq_0049__i36251828659">{Access port of <strong id="asm_faq_0049__b178134321512">zipkin</strong>}</em><strong id="asm_faq_0049__b156189392519">/zipkin/</strong>.</span><p><p id="asm_faq_0049__p17254111175110"></p>
<div class="note" id="asm_faq_0049__note18532611511"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="asm_faq_0049__p1637017116550">You can obtain the IP address and port for logging in to the Zipkin client as follows:</p>
<ul id="asm_faq_0049__ul186718332111"><li id="asm_faq_0049__li6671193318118">IP address: Go to the console of the cluster where Zipkin is installed. In the navigation pane, choose <strong id="asm_faq_0049__b57154251975">Services &amp; Ingresses</strong>. On the <strong id="asm_faq_0049__b37151251570">Services</strong> tab, view the public IP address of the load balancer configured for <strong id="asm_faq_0049__b1120711352073">zipkin</strong>.</li><li id="asm_faq_0049__li185710361012">Port: On the <strong id="asm_faq_0049__b1941114328325">Services</strong> tab, view the access port of <strong id="asm_faq_0049__b6548111412612">zipkin</strong>.</li></ul>
</div></div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="asm_faq_0014.html">Monitoring Traffic</a></div>
</div>
</div>