forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: qiujiandong1 <qiujiandong1@huawei.com> Co-committed-by: qiujiandong1 <qiujiandong1@huawei.com>
40 lines
7.5 KiB
HTML
40 lines
7.5 KiB
HTML
<a name="asm_01_0063"></a><a name="asm_01_0063"></a>
|
|
|
|
<h1 class="topictitle1">All Pods Have Sidecars Injected</h1>
|
|
<div id="body0000001175772865"><div class="section" id="asm_01_0063__section146041745338"><h4 class="sectiontitle">Description</h4><p id="asm_01_0063__p1487717583317">An <strong id="asm_01_0063__b8850152035217">istio-proxy</strong> container must exist in all pods of a Service. Otherwise, this item is abnormal.</p>
|
|
</div>
|
|
<div class="section" id="asm_01_0063__section1457519694110"><h4 class="sectiontitle">Rectification Guide</h4><ol id="asm_01_0063__ol11865432551"><li id="asm_01_0063__li12186243175513"><span>Log in to the ASM console and click the name of the service mesh that the Service is added to. Choose <strong id="asm_01_0063__b761794971520">Mesh Configuration</strong> in the navigation pane, click the <strong id="asm_01_0063__b861824921513">Sidecar Management</strong> tab, and check whether a sidecar is injected into the namespace that the Service belongs to.</span><p><ul id="asm_01_0063__ul1680513160015"><li id="asm_01_0063__li1680515161008">If the sidecar is not injected into the namespace, go to <a href="#asm_01_0063__li1665121115612">2</a>.</li><li id="asm_01_0063__li198192408015">If the sidecar has been injected into the namespace, go to <a href="#asm_01_0063__li127525055610">3</a>.<p id="asm_01_0063__p1515351917258">Check method:</p>
|
|
<p id="asm_01_0063__p42381524122517">On the CCE console, click the cluster name to access the cluster console. In the navigation pane, choose <strong id="asm_01_0063__b11801397414">Namespaces</strong>. On the displayed page, locate your namespace and click <strong id="asm_01_0063__b9613112883416">Edit YAML</strong> in the <strong id="asm_01_0063__b15711152403411">Operation</strong> column. If there is the <strong id="asm_01_0063__b175091651103918">istio.io/rev=<revision></strong> or <strong id="asm_01_0063__b20795258123916">istio-injection=enabled</strong> label, the sidecar has been injected.</p>
|
|
<div class="note" id="asm_01_0063__note87391512153111"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="asm_01_0063__ul12328442183114"><li id="asm_01_0063__li832864243112">There must the <strong id="asm_01_0063__b128477083514">istio-injection=enabled</strong> label for Istio 1.13.9-r3 and earlier versions, as well as Istio 1.15.5-r2 and earlier versions. Note that the version numbers are combined by hyphens (-).</li><li id="asm_01_0063__li89671844113111">There must be the <strong id="asm_01_0063__b198671148379">istio.io/rev=<revision></strong> label for Istio later than 1.13.9-r3, Istio later than 1.15.5-r2, and all Istio 1.18 versions. Note that the version numbers are combined by hyphens (-).<p id="asm_01_0063__p1336942717254"><span><img id="asm_01_0063__image4821824135818" src="en-us_image_0000002086005592.png"></span></p>
|
|
</li></ul>
|
|
</div></div>
|
|
</li></ul>
|
|
</p></li><li id="asm_01_0063__li1665121115612"><a name="asm_01_0063__li1665121115612"></a><a name="li1665121115612"></a><span>Inject a sidecar into a workload or inject sidecars into the pods of all workloads in the namespace. For details, see <a href="asm_01_0041.html#asm_01_0041__section65931513505">Injecting a Sidecar</a>.</span><p><p id="asm_01_0063__p126911222119">Injection methods:</p>
|
|
<ul id="asm_01_0063__ul142566176620"><li id="asm_01_0063__li1717131013105">To inject sidecars into the pods of all workloads in the namespace, run the following command to add a label to the namespace (the label varies depending on the Istio version):<pre class="screen" id="asm_01_0063__screen1281611095517"><strong id="asm_01_0063__b1181951015558">kubectl label ns</strong> <namespace> istio-injection=enabled</pre>
|
|
<p id="asm_01_0063__p19362226185219">Or</p>
|
|
<pre class="screen" id="asm_01_0063__screen1788741815554"><strong id="asm_01_0063__b128882181554">kubectl label ns</strong> <namespace> istio.io/rev=<revision></pre>
|
|
<div class="note" id="asm_01_0063__note12977171985010"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><div class="p" id="asm_01_0063__p16180546195012">The system adds labels for namespaces based on Istio versions.<ul id="asm_01_0063__ul4788103410502"><li id="asm_01_0063__li2788734195016"><strong id="asm_01_0063__b1223320133017">istio-injection=enabled</strong> can be used in Istio 1.13.9-r3 and earlier versions, as well as Istio 1.15.5-r2 and earlier versions.</li></ul>
|
|
<ul id="asm_01_0063__ul3789103425019"><li id="asm_01_0063__li87899349504"><strong id="asm_01_0063__b19540824143010">istio.io/rev=<revision></strong> can be used in Istio later than 1.13.9-r3, Istio later than 1.15.5-r2, and all Istio 1.18 versions.</li></ul>
|
|
</div>
|
|
</div></div>
|
|
</li></ul>
|
|
<ul id="asm_01_0063__ul77018142713"><li id="asm_01_0063__li168449341119">Injecting a sidecar into a workload<div class="p" id="asm_01_0063__p10496970111"><a name="asm_01_0063__li168449341119"></a><a name="li168449341119"></a>On the CCE console, locate the target workload, choose <strong id="asm_01_0063__b4452123114113">More</strong> > <strong id="asm_01_0063__b109016381012">Edit YAML</strong> in the <strong id="asm_01_0063__b157254481818">Operation</strong> column, and manually add the <strong id="asm_01_0063__b04982581119">annotations</strong> field.<pre class="screen" id="asm_01_0063__screen575018269110"> annotations:
|
|
sidecar.istio.io/inject: 'true'</pre>
|
|
</div>
|
|
<p id="asm_01_0063__p1794791520305"><span><img id="asm_01_0063__image115521522121112" src="en-us_image_0000001394586873.png"></span></p>
|
|
</li></ul>
|
|
<p id="asm_01_0063__p18904104210315">For more details about sidecar injection, see <a href="https://istio.io/latest/docs/setup/additional-setup/sidecar-injection/" target="_blank" rel="noopener noreferrer">Installing the Sidecar</a>.</p>
|
|
</p></li><li id="asm_01_0063__li127525055610"><a name="asm_01_0063__li127525055610"></a><a name="li127525055610"></a><span>If namespace injection is enabled for the cluster but no sidecar is injected into the pod, you need to manually restart the pod on the CCE console as follows:</span><p><p id="asm_01_0063__p6931112013420">On the CCE console, choose <strong id="asm_01_0063__b51514267743241">More</strong> > <strong id="asm_01_0063__b185900250343241">Redeploy</strong> in the <strong id="asm_01_0063__b143167820043241">Operation</strong> column of the target workload.</p>
|
|
</p></li><li id="asm_01_0063__li10713191914412"><span>Check whether the host network mode is configured for the workload as follows:</span><p><p id="asm_01_0063__p31276451075">On the CCE console, choose <strong id="asm_01_0063__b1371751914718">More</strong> > <strong id="asm_01_0063__b15717191914719">Edit YAML</strong> in the <strong id="asm_01_0063__b07176192714">Operation</strong> column of the target workload, and check whether <strong id="asm_01_0063__b1178116582714">spec.template.spec.hostNetwork: true</strong> is configured. If yes, check whether this field can be deleted or set to <strong id="asm_01_0063__b1692120472143">false</strong>. Otherwise, sidecars cannot be injected.</p>
|
|
<p id="asm_01_0063__p196591218181315"><span><img id="asm_01_0063__image1665921861311" src="en-us_image_0000001344069664.png"></span></p>
|
|
</p></li><li id="asm_01_0063__li127567207111"><span>Check whether the number of pods exceeds the service mesh scale.</span><p><p id="asm_01_0063__p1075619201610">If the number exceeds , the excess pods cannot be injected with sidecars.</p>
|
|
</p></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="asm_01_0060.html">Manual Fixing Items</a></div>
|
|
</div>
|
|
</div>
|
|
|