|
9 Z% N8 R: u% e& X4 F8 Z7 O
<p>kubectl作为我们主要的操作K8S的工具,其具备非常丰富的功能,但是如果不经过打磨,使用起来还是存在诸多不便,今天我们来看看如何将我们的kubectl打磨的更加易用。</p>
& k* W5 x- j, u2 |7 D' b' n4 m<p> </p>
+ O2 b$ t. m0 s! V7 F<p>一、命令自动补全</p>2 |9 F: j5 ]0 ~
<p>kubectl中提供非常多的命令,如果每一次都要手动一个字符一个字符的敲未免太累了,那么如何配置自动补全呢?这里以ubuntu系统为例:</p>- V K8 @5 v7 Q6 h' \
<p>1、安装auto-completion工具</p>1 x5 j: m& @9 [, |7 b+ m
<div class="cnblogs_code">6 P, O' R! M2 l1 ]
<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> apt update9 d4 l: u! R' v" o7 F D2 S
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>. o, R3 ~: v. }/ r3 k" E& V+ \
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>3 ]9 p! d% k/ @9 N8 f# J
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>
4 @, N! _, d r9 X2 K) CHit:<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>$ _# P) _! e. u x7 X. }" Q
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>
/ M" M) b7 ]' S6 }+ P8 J<span style="color: rgba(0, 0, 0, 1)">Reading package lists... Done8 v* b% t2 \0 E4 ]0 A
Building dependency tree, @/ b' m. c& j- K/ Z, L" I5 ]
Reading state information... Done' K1 y9 _6 v# c6 l6 G
</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.
: n' h0 {/ v" Y* X$ </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* `$ e# P# L# P
Reading package lists... Done( B6 R* [' w9 h5 q5 M! Q
Building dependency tree0 ]0 |1 g0 @1 P; O
Reading state information... Done. W3 [/ @& [$ W0 Z& M- |- d
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).9 v S: O; [" V2 |) x1 `
</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>! O( A* |- S, o) t4 i
</div>% n ~' F( p# s
<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>8 B0 C% N+ ]7 X( l
<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>9 E. a& N# q# q
<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>
1 C* F0 F m4 p/ _3 H<div class="cnblogs_code">
$ X6 Y# g: A! m1 P2 c% ]<pre>source <<span style="color: rgba(0, 0, 0, 1)">(kubectl completion bash)
4 ]8 ~( H) f( w3 G" n</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>, b3 w0 ^- s5 ^2 c3 z4 L
</div>0 b$ O. l& \5 ?% q1 K- o
<p><strong>Zsh</strong>:</p>" [& S' N6 n" u* i( b0 n ]- p
<div class="cnblogs_code">& Y: }& J6 V* B' l" U
<pre>source <<span style="color: rgba(0, 0, 0, 1)">(kubectl completion zsh)5 j! S5 }. }& |( J5 q$ u& O0 B
</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>
& }$ A6 ]$ f, O2 |$ s) e</div>
+ f% E6 }8 l; o5 W<p>配置后就可以通过Tab键自动补全命令啦!</p>. r9 v" n6 U, ]+ G
<p> </p>' R/ @' c6 _% ~
<p>二、配置kubectl别名</p>
6 Q( ^4 V" l: t4 [; h, l<p>我们可以通过设置别名简化kubectl命令,编辑.bashrc文件,添加如下内容:</p>( j; ~, L# J5 [$ a( C/ g* k" j
<div class="cnblogs_code">& } w6 R; a( q& L0 e( Z
<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)">5 e! C. J; j; J& W/ T9 [- ~9 v
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)">
G$ u0 t) e% ?alias 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)">
6 j: U$ ^2 M( F- w' f8 ^2 Halias 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)">
$ C- {- F& ~! H, Falias 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)">7 p/ _$ ~; k4 F$ w6 | i; q4 |
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)">9 B6 u; {/ n, G' {) p: L" e
alias 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>
. y3 c) h0 ^1 [( M5 [' K</div>
& C( }" } Q0 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>
, X8 i; u% |+ A4 R* d<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>
: ] V* d, a) F+ k$ E<div class="cnblogs_code">
5 B! g2 |. v6 ]# V% y" ^4 W i<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> ka webapp_pod.yaml
! h" r* j5 \4 r7 @! k: H4 Wpod</span>/<span style="color: rgba(0, 0, 0, 1)">webapp created- Z, E% [( m- m. U& _
$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> kg pods+ Y \$ L @8 S% a( }
NAME READY STATUS RESTARTS AGE5 z- y% v! R$ V: y5 W
webapp </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
9 `8 O+ S7 M: B z% O: }& v$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> kd pod webapp& K" S# T# E1 T' z$ E) l/ z
Name: webapp
1 [0 Z, c! f& |9 ?2 U( m$ p( @" SNamespace: default7 U+ \: l; P. K5 M
Priority: </span><span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">
4 N; L2 N0 A5 I$ XNode: 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)">
" H9 S1 x3 Z' WStart 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)">. w* s7 @* c( @0 z
Labels: app</span>=<span style="color: rgba(0, 0, 0, 1)">webapp2 |2 d& p, X# {9 X/ V; r
Annotations: </span><none><span style="color: rgba(0, 0, 0, 1)">8 y+ J h# j0 ^: C* Y2 S
Status: Running
/ o5 J7 M2 H+ k* L# X% _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)">
3 k8 Q4 f8 y3 {4 B9 PIPs:
( H7 }" Q0 w* K# c6 O# y 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)">1 X. S) @8 O( i% B! A
Containers:
9 V' K" M% u: h% @* O* ` webapp:. D; y' A4 N, W. ~6 a+ F! O$ v m
Container ID: docker:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">d9ddf9dd47de12b53f2119bf75df6706bee2e7711509638ad52adc9addeda704</span>
, K: P+ Y; p$ o& V 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)">
* f& s" t+ x6 d5 v 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> J0 C+ m6 ]4 ^1 R( [9 O
Port: <span style="color: rgba(128, 0, 128, 1)">5000</span>/<span style="color: rgba(0, 0, 0, 1)">TCP
6 R( t7 J0 n& R! C Host Port: </span><span style="color: rgba(128, 0, 128, 1)">0</span>/<span style="color: rgba(0, 0, 0, 1)">TCP* z. t9 S7 L* O3 ? }; W
State: Running: m0 ~% O) `0 a5 u$ \" U- p' @
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)">
* \ A4 R2 s9 f; K5 R Ready: True0 d0 k* U6 \( `% w
Restart Count: </span><span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">6 e2 h7 d `% E. ]! x
Environment: </span><none><span style="color: rgba(0, 0, 0, 1)">
@& L7 u/ B2 X4 s Mounts:
& w3 X1 [9 L" Z, w! [; R) W </span>/tmp from webapp-<span style="color: rgba(0, 0, 0, 1)">logs (rw)
. ]4 s0 _3 D3 e2 v) f </span>/var/run/secrets/kubernetes.io/serviceaccount from default-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h (ro)
' P, C2 t& ~5 h# Q busybox:) k, T s1 u0 w4 j1 h' K* N# d" B; k' Y
Container ID: docker:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">6a6a35a628a782fc643af3dd49986bbc77c23de1ae4726bc521c77f61abbbf5d</span>( h# g% o( d) S- H
<span style="color: rgba(0, 0, 0, 1)"> Image: busybox0 n; m$ [8 p5 T
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>
+ s1 @4 u' F9 P5 ]. h8 a Port: <none><span style="color: rgba(0, 0, 0, 1)">, T. o2 E p4 o. `7 r! s X- X
Host Port: </span><none><span style="color: rgba(0, 0, 0, 1)">
6 J1 l/ s6 @5 I0 i Command:+ H! C% w: F/ k+ j; R4 d
</span><span style="color: rgba(0, 0, 255, 1)">sh</span>& \- U& J; t" Q, h ^
-<span style="color: rgba(0, 0, 0, 1)">c
) ~& K' \1 l/ `" Z9 x </span><span style="color: rgba(0, 0, 255, 1)">tail</span> -f /logs/<span style="color: rgba(0, 0, 0, 1)">log.out
& b. r8 U7 S: ~1 l, q* A/ a State: Running6 P, M+ ^; S0 Q9 l9 N
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)">% s/ e d/ b6 @9 {
Ready: True( N7 R* C6 o0 s$ d& v
Restart Count: </span><span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">
2 \+ n5 o6 g* V+ S1 a Environment: </span><none><span style="color: rgba(0, 0, 0, 1)">
7 f+ ^( \7 E- v' f5 h7 ~& I/ Y Mounts:
& o* q) ?. z. ~% i </span>/logs from webapp-<span style="color: rgba(0, 0, 0, 1)">logs (rw)' o9 C: p ?( w C: j6 V1 G. X
</span>/var/run/secrets/kubernetes.io/serviceaccount from default-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h (ro)% C) v7 p4 o# I; Y: x
Conditions:% t% n9 y& J K& F" g% e2 K+ X
Type Status
- w+ V7 I, n4 y; B Initialized True3 H3 R- [+ y, Q/ w
Ready True
0 y2 g7 j# N# w. A$ p/ k b' ~ ContainersReady True+ f. X, P- ]( H |
PodScheduled True1 M8 n+ M) ~. l v! \
Volumes:! m+ k7 K3 ]" ?1 C
webapp</span>-<span style="color: rgba(0, 0, 0, 1)">logs:0 ^+ ]7 B B: a) g/ r
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>
: k3 q' J4 J6 \4 x0 }/ d<span style="color: rgba(0, 0, 0, 1)"> Medium:- |1 i F- H! ]/ G( k; t
SizeLimit: </span><unset><span style="color: rgba(0, 0, 0, 1)">
+ H5 j O5 z2 M! a- s- ^6 [ default</span>-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h:
3 g+ n; p/ Q/ t, @7 f Type: Secret (a volume populated by a Secret)7 V) ~# S% S- C& U7 [
SecretName: default</span>-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h
' f$ R! o4 U. S6 P$ x; P* w/ g T& v Optional: </span><span style="color: rgba(0, 0, 255, 1)">false</span><span style="color: rgba(0, 0, 0, 1)">
; G0 ^3 y2 z! m. _QoS Class: BestEffort* L/ o: N) o$ I8 j/ [0 X
Node</span>-Selectors: <none><span style="color: rgba(0, 0, 0, 1)">; ]: \0 D1 J. s5 E, `# k* S: |: d
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
1 z; U" N, N0 X" ?4 `, T ?! {2 R 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
D6 ]* j" m0 p/ i0 G# Y% UEvents:
$ ~4 n( q" u7 c( f9 o9 d6 r Type Reason Age From Message9 \' R. I, |( ?4 Q5 Y
</span>---- ------ ---- ---- -------<span style="color: rgba(0, 0, 0, 1)">; V; W, H5 a/ z. q* g0 k
Normal Scheduled 2m23s default</span>-scheduler Successfully assigned default/<span style="color: rgba(0, 0, 0, 1)">webapp to ayato
1 y" ^3 a$ p5 W8 B* A9 L* X. ? H* H 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 machine0 y/ @" g+ z C' t: I
Normal Created 2m21s kubelet Created container webapp
; J) v+ V9 Z: j- P |1 q Normal Started 2m21s kubelet Started container webapp
# i: b+ m2 x" Z% g 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)"> j) P( N/ l. y; \9 W) v G' Z) Y9 C
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" _$ ~; n& c3 d. J! G
Normal Created 15s kubelet Created container busybox& g0 o7 }: K+ w3 `8 u% U! B
Normal Started 14s kubelet Started container busybox</span></pre>1 o! X m$ [# K2 W2 q( S% l/ F' E
</div>+ y4 K$ J; r/ Q9 G
<p>真的是飞一般的感觉!!!</p>! d r* V4 c7 A$ {! }
<p> </p>
/ l4 F l6 P2 `; p4 `) }<p>三、Context和Namespace切换</p>, j4 \. E6 R% R( I+ I7 w
<p>我们在公司的容器平台上使用kubectl时,经常需要切换context和namespace,导致命令非常繁琐,那有没有简便的方式呢?—— kubectx</p>& K3 l2 T1 {- b. @
<p>kubectx安装</p>
7 ? E' k: ^$ x- o0 ~% W( k<div class="cnblogs_code">+ B5 ]+ ~: E: e# s
<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>: Z# o ?) p% E9 s! ~
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)">...+ O: T- C! k: G& C" H
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)">.
9 X' W# M7 b+ _. fremote: 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)">.
( B) }. b4 K; D6 Jremote: 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)">.
1 x: J1 Z$ m! O8 m# }1 f0 Premote: 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)">
9 D8 {1 S) R; V- cReceiving 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)">.
+ t+ S/ {8 w+ JResolving 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)">.9 i; K% O5 Z/ M; H* Z' M5 j+ j, y
$ </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
) c8 x2 n& F$ U/ w- l- {; y, v3 K$ </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>8 z$ q5 Y% T) @5 P- `; n
</div>5 u8 Q3 |+ h8 k
<p>我们来看一下效果:</p>
0 z. p% N! x9 j' ? U8 b<div class="cnblogs_code">
2 l# L. C8 r5 A X9 A. {<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ctx
0 M% u% l5 N0 C0 G/ N( \3 Pminikube
6 I2 K) g+ l2 ~$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ctx minikube2 P/ |5 @6 E! [9 k* \
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)">.
! G1 u M$ J2 d8 y) {6 J$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ns
! z2 |! R( t# ]& bdefault
* o& U- m5 P/ wkube</span>-node-<span style="color: rgba(0, 0, 0, 1)">lease
+ m9 h' @5 h' J2 f ^4 l) Bkube</span>-<span style="color: rgba(0, 0, 0, 1)">public/ b( U9 _) T C# ^! q6 G
kube</span>-<span style="color: rgba(0, 0, 0, 1)">system1 C# \2 I8 a) U! s: c) `
kubernetes</span>-<span style="color: rgba(0, 0, 0, 1)">dashboard! u4 |$ _1 _* R$ B& K
$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span> k ns kube-<span style="color: rgba(0, 0, 0, 1)">public$ w. f9 P5 \6 h! u" l7 ]$ K
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.9 |5 s8 D: W3 C8 x+ Z7 G
Active 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)">.1 w6 g2 Q7 h4 f/ j4 j* w
$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ns default0 m. B. {, j, u# I9 }
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.
9 ~) ~/ V! e5 n: t: gActive 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>$ }+ r3 N: }6 Z# _ h
</div>8 g, x4 m6 I7 v( @9 f
<p> </p>! _# ^$ H; K0 R4 i6 b4 a- G3 A
<p>四、跟踪查看多个Pod的日志</p>
+ ? u7 C7 o9 x5 S<p>我们一般使用kubectl logs命令查看Pod日志,但是它不能通过-f参数同时跟踪查看多个Pod日志,这就不方便了,毕竟实际生产环境中每个服务都会有多个Pod,这时我们可以使用stern这个工具,它具备如下能力:</p>
- f' S7 \- p% _, Z* M' T' C<ul class="list-paddingleft-2">
- y3 v M9 G7 l<li>/ D$ w* G/ K K, T M
<p>允许使用正则表达式来选择需要查看的PodName</p>/ q8 u" ?6 I0 B% U) Q
</li> `2 n- r0 m. b/ C$ K9 V
<li>( `# X( q; \" T- x
<p>为不同 Pod 的日志展示不同的颜色</p>( R1 Q6 a! h" _$ [$ j
</li>
& ~' c! y# E" l$ `9 b<li>
# q: B* L6 @, Z/ {- E<p>跟踪日志过程中假如有符合规则的新 Pod 被创建, 那么会自动添加到输出中</p>* f0 C- ~, y& A( u" }* G2 `& E
</li>
: \0 Q* i+ v) [; h+ G</ul>" P* l# S6 V2 a- z# E X7 O" P
<p>首先安装stern(下载stern时可能较慢可以多试几次):</p>
& L. J% w3 y+ k" U: h. }- ?<div class="cnblogs_code">* y8 B: H0 S1 [% ~! M* _4 C
<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>
- n% K8 ^& S: u1 t<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>0 G& h9 d7 K$ x# b, Y+ m% X0 c8 P
<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>
& X: l3 G+ P0 ~8 y5 b" o. f</div>
1 Z+ F! h" c2 v1 m% v0 j<p>安装完毕后让我一起感受一下stern的魅力吧,我的Pod里面有两个容器:webapp和busybox,如果使用kubectl logs 还得指定具体的容器,而使用stern就没有这样的限制。</p>
3 o/ s5 [4 @5 G+ C2 Y<div class="cnblogs_code">8 p" j% ]$ P0 i; h5 I- r) E n
<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)"> .: X/ |! Q' |; |. a) W; r
</span>+<span style="color: rgba(0, 0, 0, 1)"> webapp › busybox! F. H- y; s9 ]0 v, Y
</span>+<span style="color: rgba(0, 0, 0, 1)"> webapp › webapp
x/ z# v9 x+ U4 Gwebapp 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)">]
9 k, m$ r8 i/ X$ F- d. v1 }, k5 ^' K2 S8 J8 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)">53.200</span><span style="color: rgba(0, 0, 0, 1)"> [INFO ] [main] [org.apache.catalina.core.StandardService] Starting service [Tomcat]" u/ `& F1 B: r
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)">]6 H' W( A: U5 J( b3 c7 ` k2 W
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.324</span> [INFO ] [main] [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/<span style="color: rgba(0, 0, 0, 1)">]] Initializing Spring embedded WebApplicationContext4 @* X7 y. D; `3 N* j% o" {$ 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)">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
3 @0 c8 r4 ]& \. Y4 I$ jwebapp 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)">
0 x# H* V0 S e! {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)
' y$ y) I/ |- {. `& I) awebapp 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)">]$ U+ d# _% a/ U% D, L$ J+ M
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.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)">
! ^$ K& q7 E9 q9 O- y, ?! w; E4 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)">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)">)
r; S8 u2 w B m# \webapp webapp
* y, W) o6 }6 `/ H% e+ V; rwebapp webapp . ____ _ __ _ _2 y* T9 J# [9 u- i( j
webapp webapp </span>/\\ / ___<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">_ __ _ _(_)_ __ __ _ \ \ \ \</span>
' H/ N* ^* m% {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>0 p0 v3 g" |( s+ `
webapp webapp \\/ ___)| |_)| | | | | || (_| |<span style="color: rgba(0, 0, 0, 1)"> ) ) ) )
3 }" s1 G0 ]: j' R& O4 uwebapp webapp </span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)"> |____| .__|_| |_|_| |_\__, | / / / /</span>9 y x$ U6 z6 o v. c
webapp webapp =========|_|==============|___/=/_/_/_/<span style="color: rgba(0, 0, 0, 1)">
, a+ G; N" N1 T( A+ i1 M* P2 Xwebapp webapp :: Spring Boot :: (v2.</span><span style="color: rgba(128, 0, 128, 1)">4.2</span><span style="color: rgba(0, 0, 0, 1)">)
6 J, A0 N% d! L' q! r2 B1 Zwebapp webapp- n8 ?3 g# v0 k( z6 V2 ?9 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.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)
0 ]" H! u1 N+ Swebapp 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: default5 t5 U# \8 x+ {9 n* l8 L1 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.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)
7 Z% p2 a R7 @+ W8 vwebapp 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)">]/ D) y, {! T5 v8 U. 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)">53.200</span><span style="color: rgba(0, 0, 0, 1)"> [INFO ] [main] [org.apache.catalina.core.StandardService] Starting service [Tomcat]- m. s* h5 j0 a6 f
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)">]+ B- D: {& a m0 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)">53.324</span> [INFO ] [main] [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/<span style="color: rgba(0, 0, 0, 1)">]] Initializing Spring embedded WebApplicationContext# W7 a( [* p" q/ _ {% @# K1 N
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( b- f' p1 h2 ?
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.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)">
7 t) v1 t- L+ v9 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.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)% b1 P$ A; |: c( a! z, 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)">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)">]
" x: c4 i% I) z1 ? ?& 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)">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)">5 @( I6 _# @$ ?* @
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>
0 z* p! g+ ]$ k' k</div>' h E0 J, |2 C! I% }$ \
<p> </p>
4 h: }6 _- `% N6 r: J* e$ g |
|