|
|
5 F( E+ R: w) `% Q {# F
<p>kubectl作为我们主要的操作K8S的工具,其具备非常丰富的功能,但是如果不经过打磨,使用起来还是存在诸多不便,今天我们来看看如何将我们的kubectl打磨的更加易用。</p>) L. @9 b8 e$ {# f- N1 S c4 o
<p> </p>
2 U: c$ J5 F8 h; p5 d<p>一、命令自动补全</p>
8 F5 R* l( q' J<p>kubectl中提供非常多的命令,如果每一次都要手动一个字符一个字符的敲未免太累了,那么如何配置自动补全呢?这里以ubuntu系统为例:</p>4 s7 h7 b" x9 d
<p>1、安装auto-completion工具</p>* g% n' s$ |6 a5 S
<div class="cnblogs_code">8 ^" s% C/ A. m7 Y! \
<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> apt update% i H, l# P; ^# w/ W3 k: _
Hit:</span><span style="color: rgba(128, 0, 128, 1)">1</span> http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">archive.ubuntu.com/ubuntu bionic InRelease</span>
, c! r" D# _5 E& z/ u, w0 Z1 ]Hit:<span style="color: rgba(128, 0, 128, 1)">2</span> http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">security.ubuntu.com/ubuntu bionic-security InRelease</span>
2 ^( h) g/ e n: f* Q5 t8 }Hit:<span style="color: rgba(128, 0, 128, 1)">3</span> http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">archive.ubuntu.com/ubuntu bionic-updates InRelease</span>
! {' i9 A! y2 s) m' e( W, vHit:<span style="color: rgba(128, 0, 128, 1)">4</span> https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">download.docker.com/linux/ubuntu bionic InRelease</span>8 q9 p( C2 [( F% U1 C; a5 P
Hit:<span style="color: rgba(128, 0, 128, 1)">5</span> http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">archive.ubuntu.com/ubuntu bionic-backports InRelease</span>. `' W3 K& M4 a/ t+ X3 \
<span style="color: rgba(0, 0, 0, 1)">Reading package lists... Done
; |3 g' |% k* h* F/ }! }Building dependency tree
- w0 L( ~4 F" P3 G# |Reading state information... Done
- Z7 u, b9 e1 Y' j6 d</span><span style="color: rgba(128, 0, 128, 1)">144</span> packages can be upgraded. Run <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">apt list --upgradable</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)"> to see them.
) g7 Z* F: X1 j4 |% @$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span> apt <span style="color: rgba(0, 0, 255, 1)">install</span> bash-<span style="color: rgba(0, 0, 0, 1)">completion
8 c( Q. a: l& OReading package lists... Done: D' l7 k% h7 V3 o3 @% w
Building dependency tree) ~ U2 E" K+ ] v7 ]) `! H$ \
Reading state information... Done- ]8 K/ P0 g$ S9 ~. X
bash</span>-completion is already the newest version (<span style="color: rgba(128, 0, 128, 1)">1</span>:<span style="color: rgba(128, 0, 128, 1)">2.8</span>-<span style="color: rgba(0, 0, 0, 1)">1ubuntu1).
/ Y8 A5 P1 g6 p; T</span><span style="color: rgba(128, 0, 128, 1)">0</span> upgraded, <span style="color: rgba(128, 0, 128, 1)">0</span> newly installed, <span style="color: rgba(128, 0, 128, 1)">0</span> to remove and <span style="color: rgba(128, 0, 128, 1)">144</span> not upgraded.</pre>1 m4 W$ R9 S# b0 f3 d+ t
</div>) k( p/ _/ ?8 Q8 q* L7 L/ k
<p>PS:如果是centos系统,则使用<span class="js_darkmode__0" data-darkmode-color-16446330660319="rgb(0, 104, 255)" data-darkmode-original-color-16446330660319="#fff|rgb(0, 82, 255)" data-style="color: rgb(0, 82, 255);"><strong data-darkmode-color-16446330660319="rgb(0, 104, 255)" data-darkmode-original-color-16446330660319="#fff|rgb(0, 82, 255)">yum install bash-completion -y</strong>命令安装</span></p>
* v- F) @# p4 K+ b; e! H, }<p>2、<span class="js_darkmode__1" data-darkmode-color-16446330660319="rgb(163, 163, 163)" data-darkmode-original-color-16446330660319="#fff|rgb(0, 0, 0)" data-style="color: rgb(0, 0, 0);">配置自动补全<br></span></p>
- d. D. V Q8 G" _6 _9 }<p><span class="js_darkmode__2" data-darkmode-color-16446330660319="rgb(163, 163, 163)" data-darkmode-original-color-16446330660319="#fff|rgb(0, 0, 0)" data-style="color: rgb(0, 0, 0);"><strong data-darkmode-color-16446330660319="rgb(163, 163, 163)" data-darkmode-original-color-16446330660319="#fff|rgb(0, 0, 0)">Bash</strong>:</span></p>. i( Y$ Q& q% V% A8 S# }5 @8 L7 O6 q
<div class="cnblogs_code">' c- m7 Y: N: O
<pre>source <<span style="color: rgba(0, 0, 0, 1)">(kubectl completion bash)
& m/ {, V; {: ~ C</span><span style="color: rgba(0, 0, 255, 1)">echo</span> <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">source <(kubectl completion bash)</span><span style="color: rgba(128, 0, 0, 1)">"</span> >> ~/.bashrc</pre>
6 t7 m9 E- ^$ b</div>
9 T( ^1 G4 ?% O<p><strong>Zsh</strong>:</p>
# H. o' c/ k i- {8 K<div class="cnblogs_code">
1 o! ^, `+ N7 F# d% |- h) N<pre>source <<span style="color: rgba(0, 0, 0, 1)">(kubectl completion zsh)' b& e2 A D8 [; ~
</span><span style="color: rgba(0, 0, 255, 1)">echo</span> <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">[[ $commands[kubectl] ]] && source <(kubectl completion zsh)</span><span style="color: rgba(128, 0, 0, 1)">"</span> >> ~/.zshrc</pre>0 A6 s# d" ^2 \4 c
</div>) y8 C) e/ K h; [" X/ p; f; H' d
<p>配置后就可以通过Tab键自动补全命令啦!</p>
# e6 Q3 q: p" U: Z<p> </p>
5 S% {" K" q1 X; g<p>二、配置kubectl别名</p>
5 H: u6 i& i* J<p>我们可以通过设置别名简化kubectl命令,编辑.bashrc文件,添加如下内容:</p>
9 E1 E; T. u2 X" ~<div class="cnblogs_code">
1 J& l: B/ h3 j$ { @ H( F5 B<pre>alias <span style="color: rgba(0, 0, 255, 1)">sudo</span>=<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">sudo </span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">- W& X& t, z( I- ~. |" B1 C
alias k</span>=<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">kubectl</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">
4 |7 x' F+ o" ]4 Z2 Calias ka</span>=<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">kubectl apply --recursive -f</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">! y/ W+ h I+ n8 P
alias kex</span>=<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">kubectl exec -i -t</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">
# m( h% s: ~$ Q1 H, m @alias klo</span>=<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">kubectl logs -f</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">
% B8 S- V! I: o% U; ?alias kg</span>=<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">kubectl get</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">
/ e7 O) T% g+ Q* D! [2 ~: s/ Zalias kd</span>=<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">kubectl describe</span><span style="color: rgba(128, 0, 0, 1)">'</span></pre>
9 g- H! ~! E; e T& U9 ]</div>2 ~8 T- b8 A$ R! w4 P
<p><span class="js_darkmode__4" data-darkmode-color-16446330660319="rgb(0, 104, 255)" data-darkmode-original-color-16446330660319="#fff|rgb(0, 82, 255)" data-style="color: rgb(0, 82, 255);"><strong data-darkmode-color-16446330660319="rgb(0, 104, 255)" data-darkmode-original-color-16446330660319="#fff|rgb(0, 82, 255)">PS:alias sudo是为了解决sudo下别名不可用问题</strong><br></span></p>
0 u2 ?5 [8 c1 E% V6 p$ c<p><span class="js_darkmode__5" data-darkmode-color-16446330660319="rgb(163, 163, 163)" data-darkmode-original-color-16446330660319="#fff|rgb(0, 0, 0)" data-style="color: rgb(0, 0, 0);">保存后记得执行 source ~/.bashrc哈,接着我们体验下:</span></p>
0 Z# ? {) e! }. r. J* B<div class="cnblogs_code">
& s' L T- q) Z# M* z<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> ka webapp_pod.yaml2 |. }, s" z) N$ r. ]2 m) z
pod</span>/<span style="color: rgba(0, 0, 0, 1)">webapp created
4 x2 ~! t7 U" W8 d: ? i$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> kg pods3 p. k! G7 W0 |2 I
NAME READY STATUS RESTARTS AGE
& q$ X+ a6 y9 Qwebapp </span><span style="color: rgba(128, 0, 128, 1)">0</span>/<span style="color: rgba(128, 0, 128, 1)">2</span> ContainerCreating <span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)"> 7s
0 K" z+ E# T+ m$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> kd pod webapp
$ e8 i1 B F$ I6 l5 A( QName: webapp* O8 K$ Q4 ^# |# Y: I+ m
Namespace: default
6 ?( j' E! [8 p+ N8 `Priority: </span><span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">
, @9 y' w- c$ g) g4 G+ K! `7 {% YNode: ayato</span>/<span style="color: rgba(128, 0, 128, 1)">172.16</span>.<span style="color: rgba(128, 0, 128, 1)">194.135</span><span style="color: rgba(0, 0, 0, 1)">
" S4 I" D! Y/ a1 C$ V* C8 S0 }! k3 zStart Time: Wed, </span><span style="color: rgba(128, 0, 128, 1)">09</span> Feb <span style="color: rgba(128, 0, 128, 1)">2022</span> <span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">44</span> +<span style="color: rgba(128, 0, 128, 1)">0000</span><span style="color: rgba(0, 0, 0, 1)">
7 J& O5 X7 l' M5 F- }/ r+ v5 |% NLabels: app</span>=<span style="color: rgba(0, 0, 0, 1)">webapp
$ r; m8 {% E2 t& i: z( _$ H9 I. [Annotations: </span><none><span style="color: rgba(0, 0, 0, 1)">
) L4 a W X) P# Y+ U2 pStatus: Running
# v( k* ?; X4 X* g/ e8 FIP: </span><span style="color: rgba(128, 0, 128, 1)">172.17</span>.<span style="color: rgba(128, 0, 128, 1)">0.6</span><span style="color: rgba(0, 0, 0, 1)">" @- K1 k1 w$ ]; t+ {. n' m3 T
IPs:& j/ a7 l+ f l4 o+ U8 a6 }
IP: </span><span style="color: rgba(128, 0, 128, 1)">172.17</span>.<span style="color: rgba(128, 0, 128, 1)">0.6</span><span style="color: rgba(0, 0, 0, 1)">
0 t$ A( n2 X8 S5 M3 y7 ~Containers:
& A: B. c5 O% b @: x webapp:5 A/ C8 a, H" ?
Container ID: docker:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">d9ddf9dd47de12b53f2119bf75df6706bee2e7711509638ad52adc9addeda704</span>
1 s3 k% D+ G! s; r8 x7 J Image: <span style="color: rgba(128, 0, 128, 1)">172.16</span>.<span style="color: rgba(128, 0, 128, 1)">194.135</span>:<span style="color: rgba(128, 0, 128, 1)">5000</span>/webapp:<span style="color: rgba(128, 0, 128, 1)">1.0</span><span style="color: rgba(0, 0, 0, 1)">- ^5 x: X4 _. _4 U- j, r
Image ID: docker</span>-pullable:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">172.16.194.135:5000/webapp@sha256:df3a447a013ada0642dec67bb31976f42f1a0699a68873d0452f514fa24e5c77</span>
7 e1 {* N9 U' W6 \' T% z8 s Port: <span style="color: rgba(128, 0, 128, 1)">5000</span>/<span style="color: rgba(0, 0, 0, 1)">TCP
v2 C' `% h5 Z: T7 V Host Port: </span><span style="color: rgba(128, 0, 128, 1)">0</span>/<span style="color: rgba(0, 0, 0, 1)">TCP
1 T) v3 n2 T! z; q3 X State: Running+ f: F( V+ z) O$ a
Started: Wed, </span><span style="color: rgba(128, 0, 128, 1)">09</span> Feb <span style="color: rgba(128, 0, 128, 1)">2022</span> <span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">46</span> +<span style="color: rgba(128, 0, 128, 1)">0000</span><span style="color: rgba(0, 0, 0, 1)">
1 W3 C( e! X$ M7 E5 ~ Ready: True3 y8 P" t! |8 Y$ D' n$ H" J" y
Restart Count: </span><span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">
8 J; p. t3 k' T- P- b6 G+ `0 P Environment: </span><none><span style="color: rgba(0, 0, 0, 1)">
, U9 K# M0 X" z# w' @" {4 | Mounts:8 p( Q1 l1 u( E* y% \ s- E
</span>/tmp from webapp-<span style="color: rgba(0, 0, 0, 1)">logs (rw)
& p% |! ^3 t1 d6 { </span>/var/run/secrets/kubernetes.io/serviceaccount from default-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h (ro)' c7 T* R: M: r( k
busybox:
0 K/ @* B) n$ d/ i( ~$ \ Container ID: docker:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">6a6a35a628a782fc643af3dd49986bbc77c23de1ae4726bc521c77f61abbbf5d</span>5 K. L( z5 |6 S8 \
<span style="color: rgba(0, 0, 0, 1)"> Image: busybox
1 O% Q/ V6 ?# A% J4 [0 G Image ID: docker</span>-pullable:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">busybox@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb</span>
( W) m6 i1 ^. V Port: <none><span style="color: rgba(0, 0, 0, 1)">
" e1 R2 Y+ [4 Y v+ m" D4 C Host Port: </span><none><span style="color: rgba(0, 0, 0, 1)">/ j) |. p. F0 H: o' k5 J
Command:
% ], {2 w2 b& y+ C3 E; `, p! ] </span><span style="color: rgba(0, 0, 255, 1)">sh</span>
4 F- D4 z* q/ e% T6 [$ t. K3 l -<span style="color: rgba(0, 0, 0, 1)">c. p" n7 y5 H( V
</span><span style="color: rgba(0, 0, 255, 1)">tail</span> -f /logs/<span style="color: rgba(0, 0, 0, 1)">log.out
" ?) _% p5 Y5 v: m State: Running S/ w6 ]. ]3 H
Started: Wed, </span><span style="color: rgba(128, 0, 128, 1)">09</span> Feb <span style="color: rgba(128, 0, 128, 1)">2022</span> <span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">06</span>:<span style="color: rgba(128, 0, 128, 1)">53</span> +<span style="color: rgba(128, 0, 128, 1)">0000</span><span style="color: rgba(0, 0, 0, 1)">: E9 [3 S3 _5 d5 S
Ready: True8 T* x* C) k. a3 T. ?. W/ u" p
Restart Count: </span><span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">* q9 k6 }' S$ @! N" i9 t
Environment: </span><none><span style="color: rgba(0, 0, 0, 1)">+ l" t; Y& |& {6 W
Mounts:
, `6 y! Q+ W7 @0 Q& l </span>/logs from webapp-<span style="color: rgba(0, 0, 0, 1)">logs (rw)
4 E+ |7 K; z/ Y$ Q9 i2 d5 p e0 U </span>/var/run/secrets/kubernetes.io/serviceaccount from default-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h (ro)
" v. H' U: o# m: B/ ~Conditions:0 L$ }5 R/ F5 [* b
Type Status
7 |6 Z- G7 V' D$ d* _7 r Initialized True
# w4 Q7 S3 Y$ f0 @ Ready True
# P2 ^6 q, s7 `) p ContainersReady True# T* [& L: u4 c5 }
PodScheduled True
6 \ N+ J4 S& y/ Y$ Y6 xVolumes:8 Q0 V! t2 B S
webapp</span>-<span style="color: rgba(0, 0, 0, 1)">logs:
/ m0 ~2 G# `0 u) M2 e+ s9 W2 @ Type: EmptyDir (a temporary directory that shares a pod</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">s lifetime)</span>
5 H% Q& c$ V1 L" @<span style="color: rgba(0, 0, 0, 1)"> Medium:
( I8 Q* |/ y) t: b/ r' ]6 @7 n0 ` SizeLimit: </span><unset><span style="color: rgba(0, 0, 0, 1)">
& G0 |& r. K0 u% a default</span>-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h:
8 J& n8 c+ K1 ~5 o# u4 d b! I! V Type: Secret (a volume populated by a Secret). j8 I X& M, E- v5 R- a8 V
SecretName: default</span>-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h
" R0 `6 _2 {2 C( V' _5 J3 b, R4 G Optional: </span><span style="color: rgba(0, 0, 255, 1)">false</span><span style="color: rgba(0, 0, 0, 1)">
, N& T4 a5 d3 H4 n% T& zQoS Class: BestEffort
8 d3 j8 h: q5 m: h) B8 k, BNode</span>-Selectors: <none><span style="color: rgba(0, 0, 0, 1)">9 x/ I4 Y% D( q
Tolerations: node.kubernetes.io</span>/not-ready:NoExecute op=Exists <span style="color: rgba(0, 0, 255, 1)">for</span><span style="color: rgba(0, 0, 0, 1)"> 300s
5 X7 d. d! B: s node.kubernetes.io</span>/unreachable:NoExecute op=Exists <span style="color: rgba(0, 0, 255, 1)">for</span><span style="color: rgba(0, 0, 0, 1)"> 300s( d' l! n0 S4 p, }4 G
Events:7 J0 B9 H: c0 s! m" I
Type Reason Age From Message n0 w" B3 ~% d. O( c7 ^" Q
</span>---- ------ ---- ---- -------<span style="color: rgba(0, 0, 0, 1)">8 t8 X- D) p% _
Normal Scheduled 2m23s default</span>-scheduler Successfully assigned default/<span style="color: rgba(0, 0, 0, 1)">webapp to ayato
& z) s6 {0 z- f4 e" j+ Z Normal Pulled 2m22s kubelet Container image </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">172.16.194.135:5000/webapp:1.0</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> already present on machine
4 P& F! Q3 T7 q3 R. A Normal Created 2m21s kubelet Created container webapp
% @; }$ ]) z4 r, b# M* F; m Normal Started 2m21s kubelet Started container webapp
( g9 A+ x$ L2 S% f* J. E Normal Pulling 2m21s kubelet Pulling image </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">busybox</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">3 Q, m. V) `. E& z
Normal Pulled 15s kubelet Successfully pulled image </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">busybox</span><span style="color: rgba(128, 0, 0, 1)">"</span> <span style="color: rgba(0, 0, 255, 1)">in</span> <span style="color: rgba(128, 0, 128, 1)">14</span><span style="color: rgba(0, 0, 0, 1)">.633078305s+ K# {$ f! s9 t" h, Z
Normal Created 15s kubelet Created container busybox3 s3 o, q/ ?" y, T
Normal Started 14s kubelet Started container busybox</span></pre>: N# r: w6 L8 L3 ?, S H
</div>
) u: Q b# R/ a: {$ B6 A<p>真的是飞一般的感觉!!!</p>
x7 f5 Y- h: b3 x<p> </p>, Y* A9 |3 d( V1 i- Q0 Y" B
<p>三、Context和Namespace切换</p>
( Y, {' P5 {; M) E<p>我们在公司的容器平台上使用kubectl时,经常需要切换context和namespace,导致命令非常繁琐,那有没有简便的方式呢?—— kubectx</p># ?2 P9 \6 p7 y8 ~ G$ \, T' ~
<p>kubectx安装</p>
/ P% l4 b$ ~: n8 w<div class="cnblogs_code">
$ n- ]2 ?5 O9 x9 B<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span> git clone https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">github.com/ahmetb/kubectx /opt/kubectx</span>6 T6 A+ ?/ t3 r' ]8 o$ A& E
Cloning into <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">/opt/kubectx</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">...# q0 m/ z3 F+ D- j9 _
remote: Enumerating objects: </span><span style="color: rgba(128, 0, 128, 1)">1457</span>, <span style="color: rgba(0, 0, 255, 1)">done</span><span style="color: rgba(0, 0, 0, 1)">.
& @* W7 Q- }/ O8 M1 Y' Y1 Jremote: Counting objects: </span><span style="color: rgba(128, 0, 128, 1)">100</span>% (<span style="color: rgba(128, 0, 128, 1)">172</span>/<span style="color: rgba(128, 0, 128, 1)">172</span>), <span style="color: rgba(0, 0, 255, 1)">done</span><span style="color: rgba(0, 0, 0, 1)">.
5 E' i: N) z9 _remote: Compressing objects: </span><span style="color: rgba(128, 0, 128, 1)">100</span>% (<span style="color: rgba(128, 0, 128, 1)">115</span>/<span style="color: rgba(128, 0, 128, 1)">115</span>), <span style="color: rgba(0, 0, 255, 1)">done</span><span style="color: rgba(0, 0, 0, 1)">.
# s8 ]! D! D0 x( j; B9 t$ m) }; jremote: Total </span><span style="color: rgba(128, 0, 128, 1)">1457</span> (delta <span style="color: rgba(128, 0, 128, 1)">85</span>), reused <span style="color: rgba(128, 0, 128, 1)">97</span> (delta <span style="color: rgba(128, 0, 128, 1)">51</span>), pack-reused <span style="color: rgba(128, 0, 128, 1)">1285</span><span style="color: rgba(0, 0, 0, 1)">6 [! g% ^1 l# O: _$ O. Y) k
Receiving objects: </span><span style="color: rgba(128, 0, 128, 1)">100</span>% (<span style="color: rgba(128, 0, 128, 1)">1457</span>/<span style="color: rgba(128, 0, 128, 1)">1457</span>), <span style="color: rgba(128, 0, 128, 1)">905.30</span> KiB | <span style="color: rgba(128, 0, 128, 1)">69.00</span> KiB/s, <span style="color: rgba(0, 0, 255, 1)">done</span><span style="color: rgba(0, 0, 0, 1)">.
6 o, V' E3 G% [9 xResolving deltas: </span><span style="color: rgba(128, 0, 128, 1)">100</span>% (<span style="color: rgba(128, 0, 128, 1)">817</span>/<span style="color: rgba(128, 0, 128, 1)">817</span>), <span style="color: rgba(0, 0, 255, 1)">done</span><span style="color: rgba(0, 0, 0, 1)">.
& n+ N5 p6 b' }2 L$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span> <span style="color: rgba(0, 0, 255, 1)">ln</span> -s /opt/kubectx/kubens /usr/local/bin/kubectl-<span style="color: rgba(0, 0, 0, 1)">ns, |3 w1 B8 f1 \% d6 R/ B# O
$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span> <span style="color: rgba(0, 0, 255, 1)">ln</span> -s /opt/kubectx/kubectx /usr/local/bin/kubectl-ctx</pre>+ H1 D' L2 K5 ?( Z3 `: E4 w! H# ?- `
</div>
( j3 C5 M# k+ O+ {) b<p>我们来看一下效果:</p>
/ [0 ~+ {( c* e8 d6 `! J/ U, @& F<div class="cnblogs_code">
0 Z1 r1 f( p( p& j% G( b) h<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ctx
4 ^- Q8 N) t1 M3 G$ Z( R" V; Q) xminikube
6 J3 _ ^& f% z' b$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ctx minikube
. E' q. a/ o% f) w9 g, B2 |Switched to context </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">minikube</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">.4 d( i( g7 o3 e1 u: u* N2 W
$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ns
5 t" ~+ F+ o; l: Z, Hdefault
/ a. Q9 t) L) [% T- ?2 X% {kube</span>-node-<span style="color: rgba(0, 0, 0, 1)">lease
* n" j% d( F0 X2 l: J; hkube</span>-<span style="color: rgba(0, 0, 0, 1)">public6 H4 T- n2 C6 D0 _. Y! Y% s# o
kube</span>-<span style="color: rgba(0, 0, 0, 1)">system
: T- w! [+ U8 @" s2 ^" @kubernetes</span>-<span style="color: rgba(0, 0, 0, 1)">dashboard
9 Y0 {! \* @! ^/ g7 ?+ I$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span> k ns kube-<span style="color: rgba(0, 0, 0, 1)">public( T2 S* m, B9 g4 ?
Context </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">minikube</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> modified.
: ?2 L+ E# L. v d; WActive namespace is </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">kube-public</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">.3 I* j, K7 J" x
$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ns default2 K& i' d% X2 x
Context </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">minikube</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> modified.
" s, W0 f" U n6 R. H# yActive namespace is </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">default</span><span style="color: rgba(128, 0, 0, 1)">"</span>.</pre>$ k n3 W* p/ J. b
</div>+ c3 J6 X" y& n# v- |
<p> </p>
+ `5 t: |" ~4 @9 f! @% S8 G<p>四、跟踪查看多个Pod的日志</p>4 N! S: ?+ K: b6 }/ i
<p>我们一般使用kubectl logs命令查看Pod日志,但是它不能通过-f参数同时跟踪查看多个Pod日志,这就不方便了,毕竟实际生产环境中每个服务都会有多个Pod,这时我们可以使用stern这个工具,它具备如下能力:</p>5 @; k& c$ [% s% m! h/ y
<ul class="list-paddingleft-2">
" Y3 K) w+ d' {5 X' n4 p4 M<li>
( {) \# Q# s9 C<p>允许使用正则表达式来选择需要查看的PodName</p>9 s9 Y" ~ n0 O- G7 H$ p9 J
</li>7 k% c' M, ]. c7 n, T6 d6 \
<li>, M; \+ g/ U* h8 V
<p>为不同 Pod 的日志展示不同的颜色</p>
, }0 ^0 v5 f" M5 Z( c) Z4 ~</li>! ?& o: v \; E7 z0 f( T- Q8 {- A
<li>& s: K$ v4 w- Y6 C3 @+ v; N. {1 n
<p>跟踪日志过程中假如有符合规则的新 Pod 被创建, 那么会自动添加到输出中</p>
# w0 g- |) T" o7 O2 S) g$ P3 r' r</li>: r& O' U: W8 J6 L
</ul>% p. U. J* B Q! v2 D% R
<p>首先安装stern(下载stern时可能较慢可以多试几次):</p>
' ^+ i) L; S4 D* m8 R# Y- Y<div class="cnblogs_code">8 f. j3 t9 Q& I) @* x, Z
<pre><span style="color: rgba(0, 0, 255, 1)">wget</span> https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">github.com/wercker/stern/releases/download/1.11.0/stern_linux_amd64</span>
! [8 Q; Q/ h. ]2 P/ D<span style="color: rgba(0, 0, 255, 1)">sudo</span> <span style="color: rgba(0, 0, 255, 1)">mv</span> stern_linux_amd64 /usr/local/bin/kubectl-<span style="color: rgba(0, 0, 255, 1)">tail</span>$ Z$ P- Z" z ]( p0 f
<span style="color: rgba(0, 0, 255, 1)">sudo</span> chomd +x /usr/local/bin/kubectl-<span style="color: rgba(0, 0, 255, 1)">tail</span></pre>* l2 J4 Y I: w+ j* A" \6 s0 }
</div>
2 ~% G/ U2 Q; x8 u* T6 C<p>安装完毕后让我一起感受一下stern的魅力吧,我的Pod里面有两个容器:webapp和busybox,如果使用kubectl logs 还得指定具体的容器,而使用stern就没有这样的限制。</p>
2 A/ \% o" l- d, z" { T2 ]/ i<div class="cnblogs_code">9 w. F$ R8 _7 H3 F# {
<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span> k <span style="color: rgba(0, 0, 255, 1)">tail</span><span style="color: rgba(0, 0, 0, 1)"> ." p$ G$ E# f7 S
</span>+<span style="color: rgba(0, 0, 0, 1)"> webapp › busybox6 Z6 x0 ` F4 v8 f: I& }/ q
</span>+<span style="color: rgba(0, 0, 0, 1)"> webapp › webapp
$ H5 L; p; [! G! C' ewebapp busybox </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.197</span> [INFO ] [main] [org.apache.coyote.http11.Http11NioProtocol] Initializing ProtocolHandler [<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">http-nio-4567</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">], g6 H- A9 [: f2 G% ?& I; v. r0 }
webapp busybox </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.200</span><span style="color: rgba(0, 0, 0, 1)"> [INFO ] [main] [org.apache.catalina.core.StandardService] Starting service [Tomcat]& c& o3 I5 Q+ D3 d
webapp busybox </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.201</span> [INFO ] [main] [org.apache.catalina.core.StandardEngine] Starting Servlet engine: [Apache Tomcat/<span style="color: rgba(128, 0, 128, 1)">9.0</span>.<span style="color: rgba(128, 0, 128, 1)">41</span><span style="color: rgba(0, 0, 0, 1)">]
9 U' H6 S+ m4 U2 ?1 F" Cwebapp busybox </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.324</span> [INFO ] [main] [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/<span style="color: rgba(0, 0, 0, 1)">]] Initializing Spring embedded WebApplicationContext
6 p+ f4 o9 M# i4 q) W1 P8 ?% dwebapp busybox </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.325</span> [INFO ] [main] [org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext] Root WebApplicationContext: initialization completed <span style="color: rgba(0, 0, 255, 1)">in</span> <span style="color: rgba(128, 0, 128, 1)">2952</span><span style="color: rgba(0, 0, 0, 1)"> ms
6 R0 X* t+ z8 R8 W8 x1 ywebapp busybox </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.801</span> [INFO ] [main] [org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor] Initializing ExecutorService <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">applicationTaskExecutor</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">
% J. X) t6 v s/ w) `2 F1 ^webapp busybox </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">54.264</span> [WARN ] [main] [org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$DefaultTemplateResolverConfiguration] Cannot <span style="color: rgba(0, 0, 255, 1)">find</span> template location: classpath:/templates/<span style="color: rgba(0, 0, 0, 1)"> (please add some templates or check your Thymeleaf configuration)
5 W! ~) D9 d. c( W2 B: h- Iwebapp busybox </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">54.377</span> [INFO ] [main] [org.apache.coyote.http11.Http11NioProtocol] Starting ProtocolHandler [<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">http-nio-4567</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
( e* Y) Z& W! p1 D9 Swebapp busybox </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">54.481</span> [INFO ] [main] [org.springframework.boot.web.embedded.tomcat.TomcatWebServer] Tomcat started on port(s): <span style="color: rgba(128, 0, 128, 1)">4567</span> (http) with context path <span style="color: rgba(128, 0, 0, 1)">''</span><span style="color: rgba(0, 0, 0, 1)">. n" Q' |7 V |, z" b: L7 S6 g0 I
webapp busybox </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">54.509</span> [INFO ] [main] [org.demo.webapp.todolist.TodoListApplication] Started TodoListApplication <span style="color: rgba(0, 0, 255, 1)">in</span> <span style="color: rgba(128, 0, 128, 1)">6.235</span> seconds (JVM running <span style="color: rgba(0, 0, 255, 1)">for</span> <span style="color: rgba(128, 0, 128, 1)">8.074</span><span style="color: rgba(0, 0, 0, 1)">)
) w) }9 h& h9 x% o8 C/ K, e( D0 \. rwebapp webapp
}9 r) F- `( S* j, i4 Q* xwebapp webapp . ____ _ __ _ _* S3 u; R% p& A/ W0 G0 _5 a
webapp webapp </span>/\\ / ___<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">_ __ _ _(_)_ __ __ _ \ \ \ \</span>
8 R2 t. P# w3 @3 `1 D7 Z* @1 @webapp webapp ( ( )\___ | <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">_ | </span><span style="color: rgba(128, 0, 0, 1)">'</span>_| | <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">_ \/ _` | \ \ \ \</span>" p" U) ?+ {" B+ H2 P
webapp webapp \\/ ___)| |_)| | | | | || (_| |<span style="color: rgba(0, 0, 0, 1)"> ) ) ) )
6 Z9 X' d$ [( ~webapp webapp </span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)"> |____| .__|_| |_|_| |_\__, | / / / /</span>
2 I& X) ~! x3 i! r2 O# G4 h5 Jwebapp webapp =========|_|==============|___/=/_/_/_/<span style="color: rgba(0, 0, 0, 1)">
+ U. m+ Q) f5 ]9 V4 P# awebapp webapp :: Spring Boot :: (v2.</span><span style="color: rgba(128, 0, 128, 1)">4.2</span><span style="color: rgba(0, 0, 0, 1)">)1 M' R: \4 c, c8 x9 m5 a
webapp webapp; x% U1 W/ `# O$ W, K
webapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">50.124</span> [INFO ] [main] [org.demo.webapp.todolist.TodoListApplication] Starting TodoListApplication v1.<span style="color: rgba(128, 0, 128, 1)">0</span>-SNAPSHOT using Java <span style="color: rgba(128, 0, 128, 1)">1.8</span>.0_111 on webapp with PID <span style="color: rgba(128, 0, 128, 1)">1</span> (/opt/soft/webapp.jar started by root <span style="color: rgba(0, 0, 255, 1)">in</span> /opt/<span style="color: rgba(0, 0, 0, 1)">soft)2 d9 i4 _0 C; z( h
webapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">50.165</span><span style="color: rgba(0, 0, 0, 1)"> [INFO ] [main] [org.demo.webapp.todolist.TodoListApplication] No active profile set, falling back to default profiles: default
3 h! S1 [9 ?& F, V% A" t* Nwebapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.158</span> [INFO ] [main] [org.springframework.boot.web.embedded.tomcat.TomcatWebServer] Tomcat initialized with port(s): <span style="color: rgba(128, 0, 128, 1)">4567</span><span style="color: rgba(0, 0, 0, 1)"> (http)
) c+ N& F" g/ |! c6 I2 |" ywebapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.197</span> [INFO ] [main] [org.apache.coyote.http11.Http11NioProtocol] Initializing ProtocolHandler [<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">http-nio-4567</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
# } o Z: {; C+ V% Dwebapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.200</span><span style="color: rgba(0, 0, 0, 1)"> [INFO ] [main] [org.apache.catalina.core.StandardService] Starting service [Tomcat]+ h/ ]# e7 j. ~! [' P7 i" a
webapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.201</span> [INFO ] [main] [org.apache.catalina.core.StandardEngine] Starting Servlet engine: [Apache Tomcat/<span style="color: rgba(128, 0, 128, 1)">9.0</span>.<span style="color: rgba(128, 0, 128, 1)">41</span><span style="color: rgba(0, 0, 0, 1)">]9 k1 L, `. X0 t* p, L- z: A5 Y& z
webapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.324</span> [INFO ] [main] [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/<span style="color: rgba(0, 0, 0, 1)">]] Initializing Spring embedded WebApplicationContext2 b8 r1 q# A4 M. @; r5 |9 p
webapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.325</span> [INFO ] [main] [org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext] Root WebApplicationContext: initialization completed <span style="color: rgba(0, 0, 255, 1)">in</span> <span style="color: rgba(128, 0, 128, 1)">2952</span><span style="color: rgba(0, 0, 0, 1)"> ms
: g' T9 @1 w/ S+ \4 v R! awebapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">53.801</span> [INFO ] [main] [org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor] Initializing ExecutorService <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">applicationTaskExecutor</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">
2 j1 J! u+ t% p& Ewebapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">54.264</span> [WARN ] [main] [org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$DefaultTemplateResolverConfiguration] Cannot <span style="color: rgba(0, 0, 255, 1)">find</span> template location: classpath:/templates/<span style="color: rgba(0, 0, 0, 1)"> (please add some templates or check your Thymeleaf configuration)# a, x5 Q5 m4 f `6 h
webapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">54.377</span> [INFO ] [main] [org.apache.coyote.http11.Http11NioProtocol] Starting ProtocolHandler [<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">http-nio-4567</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
+ F) }/ a4 j3 L2 v# D) {webapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">54.481</span> [INFO ] [main] [org.springframework.boot.web.embedded.tomcat.TomcatWebServer] Tomcat started on port(s): <span style="color: rgba(128, 0, 128, 1)">4567</span> (http) with context path <span style="color: rgba(128, 0, 0, 1)">''</span><span style="color: rgba(0, 0, 0, 1)">* N; B& }& S9 R+ l
webapp webapp </span><span style="color: rgba(128, 0, 128, 1)">14</span>:<span style="color: rgba(128, 0, 128, 1)">04</span>:<span style="color: rgba(128, 0, 128, 1)">54.509</span> [INFO ] [main] [org.demo.webapp.todolist.TodoListApplication] Started TodoListApplication <span style="color: rgba(0, 0, 255, 1)">in</span> <span style="color: rgba(128, 0, 128, 1)">6.235</span> seconds (JVM running <span style="color: rgba(0, 0, 255, 1)">for</span> <span style="color: rgba(128, 0, 128, 1)">8.074</span>)</pre>
: I+ R+ |3 y. @: N, K, M</div>
8 c* Q; q& Z/ _2 b* H<p> </p>$ r v. e) W5 s* }
|
|