|
|
' D: y+ @; T- k6 j1 S<p>kubectl作为我们主要的操作K8S的工具,其具备非常丰富的功能,但是如果不经过打磨,使用起来还是存在诸多不便,今天我们来看看如何将我们的kubectl打磨的更加易用。</p>1 V' R O" {, s; z* G
<p> </p>
7 R3 ^* e8 _1 ~/ ?0 a7 J0 o<p>一、命令自动补全</p>
/ b. X: R3 Y8 z- p+ C<p>kubectl中提供非常多的命令,如果每一次都要手动一个字符一个字符的敲未免太累了,那么如何配置自动补全呢?这里以ubuntu系统为例:</p>
$ e Y/ B* w! _! S% B' }<p>1、安装auto-completion工具</p>
; T" i2 [+ U H9 D% ^<div class="cnblogs_code">
1 Y( E0 U& x& H<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> apt update
0 Y! B5 t. k9 j2 z8 `" q/ BHit:</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>5 {& D$ E4 }, M6 F' x5 b
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> ^5 x" p* W1 L# ~/ u( C& h q
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>( O. A! Z1 K' l5 Q7 P: i- m
Hit:<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>
- n" F b1 h! Y7 }# G5 |6 XHit:<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>5 C% T5 }; i* I2 |; W, F: r
<span style="color: rgba(0, 0, 0, 1)">Reading package lists... Done# `) I: v5 f8 |8 u5 ]5 N+ I( ^
Building dependency tree2 b6 B7 ?7 O8 { J
Reading state information... Done6 Z9 y' b% L2 C8 L9 X, V+ Q, M6 `; H
</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.8 j; M$ u5 g# V+ b! B8 o
$ </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
* \3 d+ r0 _ f7 ], [* ]4 x) iReading package lists... Done$ ~+ v- q* G) d' U
Building dependency tree9 F( z3 ~ W7 z" W& i% `: l, j8 E
Reading state information... Done+ j8 X) y5 U% a1 h& c- U7 V
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).
/ R. ?; j6 _0 T: r) H4 A+ |, I4 [6 ~</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>
" Q& N, [. D* j( o* ~' q</div>
9 q6 x9 Q9 Y* U% I8 o. ^5 u<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>: f! o) z6 l- D A4 \" S3 y
<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>- L( D0 ?# h9 ^8 {2 N( L4 w B- {
<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>
% h: U5 @3 k6 {/ q, J<div class="cnblogs_code">4 H( m! W' x% w2 ` b6 ^
<pre>source <<span style="color: rgba(0, 0, 0, 1)">(kubectl completion bash)
, E( i: S4 ~1 t; w) c& z4 v</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>
& q$ w/ f7 J" F% Q</div>
2 @0 x+ Y2 I7 l0 J7 S<p><strong>Zsh</strong>:</p>% T @9 d. z' \5 B+ Y0 E0 m# S
<div class="cnblogs_code">
, F& b/ J8 v$ H<pre>source <<span style="color: rgba(0, 0, 0, 1)">(kubectl completion zsh)) S5 |, i2 O, `& z' V: H
</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>) s0 r }2 v: J# U+ i' V' j
</div>
8 |- l. x$ _% ~8 N<p>配置后就可以通过Tab键自动补全命令啦!</p>: q* h4 E6 V a
<p> </p>: m; E; u2 ?! _; [( e$ F4 g
<p>二、配置kubectl别名</p>% m+ O6 \0 i# |- M
<p>我们可以通过设置别名简化kubectl命令,编辑.bashrc文件,添加如下内容:</p>
5 ^. H j! G r$ N<div class="cnblogs_code">
1 J4 J' G* j% J" ], [, I- `<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)">
/ M b9 S/ r9 S- m9 J5 a Walias 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)">' Q# t8 I$ L9 D& T; e/ P, s
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)">1 s+ _ g/ u6 K9 t, l/ e0 A) i
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)">7 a# Y4 g* T8 N
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)">
: K/ d; K) D, p1 S; ?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)">
8 g; M" ?* ~( K7 R, Falias 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>7 | `: N$ F: u0 P9 f
</div>& ^/ Z6 Y+ A: x/ Y2 T! a, q, X
<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>
2 O5 z2 F) ~- D; }/ \; O* k" C* k<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>
% |! q. |5 e6 d- q9 R1 d<div class="cnblogs_code">
9 O- W9 N9 E6 r" f) X% |<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> ka webapp_pod.yaml
$ h3 A: G( [5 k4 Spod</span>/<span style="color: rgba(0, 0, 0, 1)">webapp created
) Y2 R7 p5 s5 c6 F* h$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> kg pods B# d9 d0 ^! L9 Z& y$ |" w5 b4 D
NAME READY STATUS RESTARTS AGE& a6 @6 X D6 a3 D n. U5 I
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
% X# O% v5 `" q$ N$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> kd pod webapp
1 d. o# t T! ?" G4 v9 lName: webapp
( E. T( N' P: s4 X f. e( mNamespace: default
7 [; F6 k% F* S8 ~/ j, g4 u) p4 _* uPriority: </span><span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">9 @( _; ]2 d& E8 D4 e3 E, J) U
Node: 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)">7 K9 i. P4 V4 Q
Start 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)">
; {' S- @" a& v9 wLabels: app</span>=<span style="color: rgba(0, 0, 0, 1)">webapp
6 @9 J* x9 t) K cAnnotations: </span><none><span style="color: rgba(0, 0, 0, 1)">
) K$ k; d; ?, e/ ^Status: Running
: P) g( v; R) j& x, O' N( |" |5 ?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)">. Y2 U: E* y: t" n, m6 l
IPs:
/ b& P% I% o9 B1 e7 _5 z* I% f3 p! w 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)">! J* i; @1 p0 B( A0 g" g0 o
Containers:
" H+ U& [( s2 h+ V1 ]* e webapp:
' j+ n, I$ e! ^3 j. Z N1 C Container ID: docker:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">d9ddf9dd47de12b53f2119bf75df6706bee2e7711509638ad52adc9addeda704</span>
! H& X @, {: i& `7 m 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)">6 K) x: L' q8 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>
5 q+ t: B* T3 m2 n Port: <span style="color: rgba(128, 0, 128, 1)">5000</span>/<span style="color: rgba(0, 0, 0, 1)">TCP# \+ ^) U. k5 ^& B" O6 E
Host Port: </span><span style="color: rgba(128, 0, 128, 1)">0</span>/<span style="color: rgba(0, 0, 0, 1)">TCP
! U6 B' J- [, N- f4 p1 h: w6 H* N6 e0 ] State: Running: W8 @# W! B: u0 m- R3 V
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)">
5 r4 J% f1 ]+ `3 C Ready: True
8 P# U4 K. ?( D* J. F$ O7 I; o Restart Count: </span><span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">
0 o/ I. |# N% e/ e/ b" ~, U Environment: </span><none><span style="color: rgba(0, 0, 0, 1)">
# t* p6 l2 R* \9 o" _6 ~" T Mounts:
7 J9 o6 t$ q4 _. r1 T </span>/tmp from webapp-<span style="color: rgba(0, 0, 0, 1)">logs (rw)9 ?" _$ z4 B8 a$ T
</span>/var/run/secrets/kubernetes.io/serviceaccount from default-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h (ro)
+ m/ A% r. H9 b' G: o) G/ P* | l# N busybox:9 t. T+ D( r4 j- ^ t7 r
Container ID: docker:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">6a6a35a628a782fc643af3dd49986bbc77c23de1ae4726bc521c77f61abbbf5d</span>
" E5 r! Y: b6 p! t% R<span style="color: rgba(0, 0, 0, 1)"> Image: busybox& z# i$ j1 y0 \( t. G1 f4 M4 U
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>
( K4 c' a( @# {% Y% F0 k Port: <none><span style="color: rgba(0, 0, 0, 1)">- G& H7 W* t2 ]* T
Host Port: </span><none><span style="color: rgba(0, 0, 0, 1)">
: S2 C/ x# t6 N2 K3 d% j# K Command:
5 G) p8 R: i; w8 ^ </span><span style="color: rgba(0, 0, 255, 1)">sh</span>
9 @1 ]$ J! S% g* Q. A -<span style="color: rgba(0, 0, 0, 1)">c8 R# F+ i' F2 {! l
</span><span style="color: rgba(0, 0, 255, 1)">tail</span> -f /logs/<span style="color: rgba(0, 0, 0, 1)">log.out
8 J9 R- D s* B# j0 b( ~7 P State: Running
: _% `0 X! z9 z) @& O 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)">' g- }0 Z- A P
Ready: True" N# m3 a U5 K
Restart Count: </span><span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">. u/ R; H. `! q& D- n
Environment: </span><none><span style="color: rgba(0, 0, 0, 1)">: R3 K" n% _$ b2 ?
Mounts:
/ k* \6 W' B O9 B </span>/logs from webapp-<span style="color: rgba(0, 0, 0, 1)">logs (rw)$ C' u5 O1 g# X4 g
</span>/var/run/secrets/kubernetes.io/serviceaccount from default-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h (ro) `' `) r) U F
Conditions:
% u$ [6 u, k* o9 D9 k: w Type Status6 V, L/ F7 l! l
Initialized True7 P6 j5 s; k6 W2 h: U( F9 M
Ready True$ o Z+ {# k: I
ContainersReady True. F& e' r* t/ ?7 O/ }
PodScheduled True& ]+ G5 x3 @8 l- D( _3 S
Volumes:: q& P/ j* r$ B* t+ W8 c
webapp</span>-<span style="color: rgba(0, 0, 0, 1)">logs:" i" t8 _6 m1 M2 e* D0 @
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>
! e% U# U1 n3 n. f( J7 h: i<span style="color: rgba(0, 0, 0, 1)"> Medium:' Y1 a7 e% {4 h. q# [ h4 j, h
SizeLimit: </span><unset><span style="color: rgba(0, 0, 0, 1)">! D! S: h* X3 R: r# a" R ?
default</span>-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h:
1 k( R( X. w- h$ X5 s/ h6 Q, Z Type: Secret (a volume populated by a Secret)
+ R! J; |! B( I5 Y; R' k& u* C6 x SecretName: default</span>-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h
: p+ G$ _& Q; G/ R5 m Optional: </span><span style="color: rgba(0, 0, 255, 1)">false</span><span style="color: rgba(0, 0, 0, 1)">
- F: m) N( M2 T: a) ~: F# gQoS Class: BestEffort
2 ?( V. l$ k7 e, K# `* S$ qNode</span>-Selectors: <none><span style="color: rgba(0, 0, 0, 1)">
1 j2 C/ f; k* {# S9 sTolerations: 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
: ^' T8 `% d' b, t7 h 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
- M4 e0 L) v, O& A* UEvents:
) P$ O$ @5 W. r Type Reason Age From Message% a1 ?2 ~# {7 ^9 m8 Z
</span>---- ------ ---- ---- -------<span style="color: rgba(0, 0, 0, 1)">1 O {* V; L: b/ t$ b% l
Normal Scheduled 2m23s default</span>-scheduler Successfully assigned default/<span style="color: rgba(0, 0, 0, 1)">webapp to ayato# o( r# Y* v3 h2 I7 s
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
9 K" Y: r0 \5 [! c, ^ Normal Created 2m21s kubelet Created container webapp. S: M- U: }3 e( x+ T! ]9 S+ P d N
Normal Started 2m21s kubelet Started container webapp- C; v C7 d8 g7 T
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)">
. c0 l( E! B: r5 n% j5 \6 e 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
# S. r/ p3 P& D& ~5 A Normal Created 15s kubelet Created container busybox
# B, A$ I- \* U* ] Normal Started 14s kubelet Started container busybox</span></pre>
2 _2 `8 n5 B) t8 [</div>
) o4 D! Q. _5 A- [<p>真的是飞一般的感觉!!!</p>0 ?# |* U: `& j7 D
<p> </p>
( u9 s! Y5 N- u& L$ A<p>三、Context和Namespace切换</p>/ S3 l D9 @' b; [. m( O
<p>我们在公司的容器平台上使用kubectl时,经常需要切换context和namespace,导致命令非常繁琐,那有没有简便的方式呢?—— kubectx</p>
% F$ Q" v& _2 H* X. w* T7 \: N<p>kubectx安装</p>
4 V5 T! f9 X( f4 {& {<div class="cnblogs_code">: P- ]/ j2 X4 x* _# Y
<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># c# q9 G' b7 _$ ?3 K5 {5 t8 q. F; Y
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)">...
, B/ R# B) ~6 b- l0 _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)">.& R5 [4 O, ` h$ X) n/ `) ^) y a
remote: 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)">.8 Z2 ?& C7 r3 a2 V! H* z
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)">.
6 P* e( l2 y: X# ^remote: 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)">* K8 D4 K: W& \( e! s
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)">.4 |4 |. Z7 @ M' i/ {% A2 Y" a
Resolving 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)">.
$ K9 S$ d( |( b* Q( J. f: P3 m2 z$ </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)">ns2 Y5 F8 k' [) ` 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/kubectx /usr/local/bin/kubectl-ctx</pre>
2 \( ?' E! |$ ~ Q: G7 g, l</div>
9 G& T6 ]+ F" D: `<p>我们来看一下效果:</p>
# s% p9 a0 O' o( O E6 g' g$ R: y<div class="cnblogs_code">
; T& W7 s6 P( m5 c2 R! F. z# p9 z<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ctx
) Q! q3 H- k4 R. i4 c. o& `minikube" ~- L+ b! W: c
$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ctx minikube$ t7 n) t' i3 M4 | a( v$ e
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)">.
) t' e, ~2 Z$ J! j% l$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ns
+ g! @ P L1 i- q7 H: V, F; ^default
0 d+ B2 W$ K* B2 H: x( B9 jkube</span>-node-<span style="color: rgba(0, 0, 0, 1)">lease
, a0 D! |0 j( t/ \) k* |kube</span>-<span style="color: rgba(0, 0, 0, 1)">public
6 e* @: q. W& d2 Y' L% Lkube</span>-<span style="color: rgba(0, 0, 0, 1)">system
9 }$ `# |' K9 Y0 S& Ukubernetes</span>-<span style="color: rgba(0, 0, 0, 1)">dashboard
7 n% q; _0 v) Z# E8 b. H$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span> k ns kube-<span style="color: rgba(0, 0, 0, 1)">public
& u- C! L, ^: C, v gContext </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.
, P' a6 e4 V; T/ v2 B! jActive 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)">.
, \5 E0 R. j/ n) L$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ns default' j% U R' J. u, v9 E0 E3 |
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., p f$ j4 Z0 \0 n4 _& z! p+ T
Active 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>
Y' z$ k) l: h$ U</div>
$ h& J0 ~ Y4 e" [<p> </p>
; B% e4 a6 Z. W+ K5 r<p>四、跟踪查看多个Pod的日志</p>" P: [5 { y" R
<p>我们一般使用kubectl logs命令查看Pod日志,但是它不能通过-f参数同时跟踪查看多个Pod日志,这就不方便了,毕竟实际生产环境中每个服务都会有多个Pod,这时我们可以使用stern这个工具,它具备如下能力:</p>
# ?3 x! B/ v) A7 A9 L8 `<ul class="list-paddingleft-2">8 v% ]1 N' @; O) ]
<li>
3 m' N; n8 I- Q4 W4 ?5 ~<p>允许使用正则表达式来选择需要查看的PodName</p>
4 ^& C0 F6 l+ T' E</li>
- X7 [ ]- a4 E<li>
* G2 ^2 ~( X+ G* g<p>为不同 Pod 的日志展示不同的颜色</p>
2 s2 u# l6 H$ @; {1 v/ z1 h</li>
/ r+ c, r2 j4 i4 i2 S<li>
0 y7 K" }6 s# j8 \0 @<p>跟踪日志过程中假如有符合规则的新 Pod 被创建, 那么会自动添加到输出中</p>
" c [/ j# p0 V4 _</li>. T/ L1 T7 b8 O0 |2 I5 X i& S L
</ul>+ M. H* j$ ]$ ?7 M# b4 ?7 s& Y5 F
<p>首先安装stern(下载stern时可能较慢可以多试几次):</p>% N7 G6 z1 L6 i9 G7 _* p
<div class="cnblogs_code">
' C" K' q: s0 v# ~<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>
4 E& S. _6 R* | U, v4 m% j5 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>
9 b5 p) s; N- x8 Y: U( u1 s<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>
+ Z. j0 Q! y9 y</div>8 D! o8 s* a7 C
<p>安装完毕后让我一起感受一下stern的魅力吧,我的Pod里面有两个容器:webapp和busybox,如果使用kubectl logs 还得指定具体的容器,而使用stern就没有这样的限制。</p>
% N; E; K8 x5 w7 t3 J<div class="cnblogs_code">
5 d* H3 a" x2 x L( R* z$ C6 {" y<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)"> .- Y G8 f% i7 k/ J0 @0 i; }
</span>+<span style="color: rgba(0, 0, 0, 1)"> webapp › busybox2 P; f. d0 q+ [( q! Q" v
</span>+<span style="color: rgba(0, 0, 0, 1)"> webapp › webapp
! p. l h! ~+ \ j( [( A5 Pwebapp 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)">]$ g) a( p9 [# \. x$ U9 o! g2 _
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]
, B" `: I+ r# T# u" ?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)">]
' p4 F, `; X2 y" w# _0 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.324</span> [INFO ] [main] [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/<span style="color: rgba(0, 0, 0, 1)">]] Initializing Spring embedded WebApplicationContext+ |$ c9 e- d" O$ a" l/ k1 v5 A8 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)"> ms1 Z- K- n0 i* R- S9 L* 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.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)">! R! u ?; }" M+ r8 @5 `
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)
# o, V7 B$ k. s3 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)">]
1 @5 p! q" k) a& mwebapp 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)">. p# f/ Q5 R$ m; D2 J3 c% X: I9 \% 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)">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)">)" I( r6 X# V4 O
webapp webapp
) p: U0 E/ D- P# l0 R5 _4 ewebapp webapp . ____ _ __ _ _
4 k9 B% ]4 @- w$ g) ?# rwebapp webapp </span>/\\ / ___<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">_ __ _ _(_)_ __ __ _ \ \ \ \</span>
; O, s0 G- B3 }4 L+ C2 T5 vwebapp 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>
+ O6 k% y, n* p+ z4 R+ k: t' h9 I8 Pwebapp webapp \\/ ___)| |_)| | | | | || (_| |<span style="color: rgba(0, 0, 0, 1)"> ) ) ) )
' k, N# t: _. A& T* {webapp webapp </span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)"> |____| .__|_| |_|_| |_\__, | / / / /</span>
% h. o) d# r2 w9 E3 C! Jwebapp webapp =========|_|==============|___/=/_/_/_/<span style="color: rgba(0, 0, 0, 1)">$ `! d) Q. L$ ~# f% r; _4 a
webapp webapp :: Spring Boot :: (v2.</span><span style="color: rgba(128, 0, 128, 1)">4.2</span><span style="color: rgba(0, 0, 0, 1)">)
' a0 w/ d: J: X0 q5 Jwebapp webapp# k' |: X% N& b2 [; Y+ 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)/ e+ b. Y2 Z2 D+ X/ o8 h1 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)">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
0 K8 i# @- s: e+ T+ D( Fwebapp 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)" o- S# u" D0 ]' 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.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)">]
C6 w; \8 u4 s. @8 M) x3 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.200</span><span style="color: rgba(0, 0, 0, 1)"> [INFO ] [main] [org.apache.catalina.core.StandardService] Starting service [Tomcat]
( d5 ~8 k* M1 ^5 F8 Xwebapp 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)">]" T: e. g8 o5 ^( A# \3 b. s
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
7 r' u/ \, a, y- w3 O+ R2 mwebapp 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
1 Z: L. ~/ x* U8 C: rwebapp 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)">: \* f* q$ o. e/ v# O' {
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)- {/ U3 f/ i3 M P/ L! ^) f i
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)">]- t# B$ M x& \8 ^2 D% M3 P" _0 i
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)">
) E3 m) M% G" c5 ^! L; V# 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)">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>
" n) H9 c2 B' r+ |! U</div>
/ l- F5 t: | R+ ]<p> </p>
t0 o% K$ Z5 _) H3 t+ o" F |
|