|
|
/ V; _/ I& j4 r: u j% p& c+ Q
<p>kubectl作为我们主要的操作K8S的工具,其具备非常丰富的功能,但是如果不经过打磨,使用起来还是存在诸多不便,今天我们来看看如何将我们的kubectl打磨的更加易用。</p>- j9 H$ [2 l* x1 |- W
<p> </p>& J# J c0 R! ]2 m
<p>一、命令自动补全</p>/ f3 m" d/ s8 N) o# _9 e8 a9 F
<p>kubectl中提供非常多的命令,如果每一次都要手动一个字符一个字符的敲未免太累了,那么如何配置自动补全呢?这里以ubuntu系统为例:</p>- {% q+ l$ v3 h3 ?5 k$ U8 L" o
<p>1、安装auto-completion工具</p>
' Q# v5 z) _8 _; y<div class="cnblogs_code">
+ m7 S- i5 t/ ~+ q! Q( V<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> apt update
+ U9 [: I9 W$ h9 z7 c) Q: D5 CHit:</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>
3 i( m" l# x" v: oHit:<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 ^5 O: t) U2 B0 l+ J) g2 rHit:<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>" c4 |- O% z0 o) F6 g
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>) U2 s$ ^( e2 y# N/ y: P7 l6 @0 ]
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>
8 ~0 k4 H2 ?3 X2 Y9 S+ ~<span style="color: rgba(0, 0, 0, 1)">Reading package lists... Done1 J R9 ~# z+ l& t% a7 V
Building dependency tree
. }2 a/ y/ c0 [$ mReading state information... Done& {0 ]+ m/ f9 U m
</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% f, @9 L! p( b$ </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% a6 `4 V* \4 i, S! I
Reading package lists... Done
* }+ X6 \0 h6 p, p Q4 vBuilding dependency tree: |% z q9 f+ p; |* k
Reading state information... Done
! \% E5 S2 z, q" w" M$ x. p( K/ ?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).& m, H' O, d/ h/ ^. \3 |
</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>" v0 C# q+ O# c& c2 m, ?+ W9 t" N. k
</div>/ M3 [! G, R, j/ B2 e
<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>
0 `* ^! e3 y+ n; Z4 v, m<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># y) o7 N7 E L E
<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>/ U/ ]! @, j( w) g4 X- {- i
<div class="cnblogs_code">5 |) B6 K/ ?: A( x& q3 O. y
<pre>source <<span style="color: rgba(0, 0, 0, 1)">(kubectl completion bash)
* n7 _1 E" T$ m* |</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 D1 J- K6 J( Y H& C* B" Q</div>
9 X0 C) t& h. [! E# u<p><strong>Zsh</strong>:</p>
/ G% T/ R1 B6 a. B- d" |% Z1 E0 R* R<div class="cnblogs_code">7 o, Z1 V: v. @! ~7 o8 L9 R. e4 m
<pre>source <<span style="color: rgba(0, 0, 0, 1)">(kubectl completion zsh)
; Z5 U( E; M* K' r+ I) r</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 j4 R. T6 }7 |1 V0 G4 e</div>
6 C5 m: Z$ n1 u: }. L+ x" m<p>配置后就可以通过Tab键自动补全命令啦!</p>
- u h2 T7 V$ M% T9 D% O7 Q<p> </p>
8 _7 k |! l+ `2 M6 Y; }<p>二、配置kubectl别名</p>; Y9 y+ b( o7 b" E; i- b
<p>我们可以通过设置别名简化kubectl命令,编辑.bashrc文件,添加如下内容:</p> o9 H5 [+ O9 `3 X4 T
<div class="cnblogs_code">
# z1 r7 C1 G# q1 R1 ^5 U3 u- E3 F<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)">
* J5 A. e( g7 Xalias 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)">, m% Z, O+ U+ s: c5 V1 W5 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)">
; M/ h& q: i! j( yalias 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)">: I' s0 a/ W9 z, ~. M1 g
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)">* n" I, W8 q0 k5 a) F' v, H
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)">$ ^3 g G$ ^& v+ \
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>
: x, r9 o' f. w8 t6 \3 Q</div>9 P2 A1 d5 q6 {2 {* s, }
<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>
+ {3 I- R1 y; V( y<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> @' G( U2 B# ~& |7 ], h
<div class="cnblogs_code">
. \" ?2 E9 \3 G- @( c+ V2 ]<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> ka webapp_pod.yaml
4 C" G+ g' `$ Y! m: Ppod</span>/<span style="color: rgba(0, 0, 0, 1)">webapp created
8 o1 F0 O. q+ Y! F' t$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> kg pods2 B: U4 t! }7 P" E
NAME READY STATUS RESTARTS AGE, y r% y1 q: m& O$ X
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)"> 7s0 G/ c* D/ y4 _7 B& b. Q: ]
$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> kd pod webapp
( y) A y8 a9 u5 p. @+ XName: webapp
9 D* _ }! X ^$ b2 m. s& kNamespace: default
B- k1 n+ f, DPriority: </span><span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">
5 Y$ X0 H! G9 c+ qNode: 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)">
* w& H2 m. ] f9 z0 b) s* RStart 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)">
5 z/ _) O; s T$ _. n/ ]Labels: app</span>=<span style="color: rgba(0, 0, 0, 1)">webapp
5 v5 H; O2 h: t7 d* U; {Annotations: </span><none><span style="color: rgba(0, 0, 0, 1)">
. j n5 b$ n& Z$ dStatus: Running& R) `4 f G% n' g& ^. q: m+ g
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)">7 [3 e m9 s2 P' J+ Q3 k
IPs:
; }/ N9 n8 K7 P5 o. P4 E 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)">6 f- ]7 n) G- O0 [% R) @
Containers:. ~: a# L8 g0 Z. I
webapp:
u8 k. _! b5 G+ g& Q+ C Container ID: docker:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">d9ddf9dd47de12b53f2119bf75df6706bee2e7711509638ad52adc9addeda704</span>
W: G; M- B" } 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)">
8 k1 \; B+ i* V; Y$ f2 y 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>
/ ~. c* L1 c' U# @2 J Port: <span style="color: rgba(128, 0, 128, 1)">5000</span>/<span style="color: rgba(0, 0, 0, 1)">TCP1 D1 Z7 ?7 f! X; S9 r
Host Port: </span><span style="color: rgba(128, 0, 128, 1)">0</span>/<span style="color: rgba(0, 0, 0, 1)">TCP
- K# c7 c5 I+ F, f) t; g State: Running n& ` B* j3 l7 Z( S
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 _/ \9 P$ V! n Ready: True5 ~0 E( r8 q" ^ E* C- c3 `
Restart Count: </span><span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">- R- S9 h& V' \: C/ ?, ]
Environment: </span><none><span style="color: rgba(0, 0, 0, 1)">
5 x/ T7 O/ E$ @/ a) e1 M1 M5 I Mounts:0 B6 U5 Z5 R" h# @# {9 X8 H$ O
</span>/tmp from webapp-<span style="color: rgba(0, 0, 0, 1)">logs (rw)$ n7 H5 s& _1 a9 K& ]' i5 a/ a
</span>/var/run/secrets/kubernetes.io/serviceaccount from default-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h (ro)
$ S( s; h2 m6 y. } busybox:
: P. ^7 V% D0 [ F8 e3 L& Q Container ID: docker:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">6a6a35a628a782fc643af3dd49986bbc77c23de1ae4726bc521c77f61abbbf5d</span>! Z9 X& F8 l$ k7 _
<span style="color: rgba(0, 0, 0, 1)"> Image: busybox
0 Q$ K0 n1 X5 a 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>5 j6 O6 }( z$ c, M8 Y
Port: <none><span style="color: rgba(0, 0, 0, 1)">
0 k3 y$ b, `0 B: y2 k7 u Host Port: </span><none><span style="color: rgba(0, 0, 0, 1)">6 x! }$ V( `5 w* {) p- J P4 _& i' M
Command:
# g- ^+ T+ e& F6 z </span><span style="color: rgba(0, 0, 255, 1)">sh</span>
7 R( m" A" h; u! } H% o8 d -<span style="color: rgba(0, 0, 0, 1)">c
^# i: F. P( Z9 i </span><span style="color: rgba(0, 0, 255, 1)">tail</span> -f /logs/<span style="color: rgba(0, 0, 0, 1)">log.out
, M( {4 j/ [' O- c( u6 S State: Running* e$ g' P8 L( C6 k
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)">" w% V8 U' |7 O
Ready: True
* w6 E0 z1 p8 V. R Restart Count: </span><span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)">, W( M, T1 Y3 c# D0 K
Environment: </span><none><span style="color: rgba(0, 0, 0, 1)">
( }; f i, F7 N Mounts:
* P+ c: |7 C) x- Z- s i7 N </span>/logs from webapp-<span style="color: rgba(0, 0, 0, 1)">logs (rw)
4 O8 f; F% c, g) P: K. ` </span>/var/run/secrets/kubernetes.io/serviceaccount from default-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h (ro)
% }/ e" ~( S8 qConditions:
! P1 h O7 N0 w: i3 `$ Q8 A Type Status V) D0 }9 P7 |4 ~1 l( Q4 E% o
Initialized True
6 C& R5 \- ^# n! P6 I g Ready True
2 X: G F4 p( G6 V& J/ N- K- l ContainersReady True
# M; b' _' Q W, J6 b! P8 `( ^ PodScheduled True
& a0 U+ A( L4 y9 o- t7 f' fVolumes:* z G( J0 C6 t
webapp</span>-<span style="color: rgba(0, 0, 0, 1)">logs:- e, A; G; l, A" W3 B. {
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>
6 Q' k6 l5 f3 k. j1 U8 ]- t<span style="color: rgba(0, 0, 0, 1)"> Medium:3 {$ r3 c* [. h/ e4 v
SizeLimit: </span><unset><span style="color: rgba(0, 0, 0, 1)">2 U9 s1 Q5 K5 x/ w
default</span>-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h:! K6 W- D7 ~, }8 o6 a
Type: Secret (a volume populated by a Secret)
9 V: c) Z. g. u4 d! l& v SecretName: default</span>-token-<span style="color: rgba(0, 0, 0, 1)">pcr2h8 t- K% ]& x6 M9 |
Optional: </span><span style="color: rgba(0, 0, 255, 1)">false</span><span style="color: rgba(0, 0, 0, 1)">6 k( p8 q! t- \3 z
QoS Class: BestEffort9 ]' m* J& J# W# r+ ]
Node</span>-Selectors: <none><span style="color: rgba(0, 0, 0, 1)">2 t; I3 f2 j C6 \$ C
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)"> 300s8 o4 C9 m7 Q" R2 Q7 ^( k/ _
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
3 X' i0 O- U" p! Y% yEvents:0 B6 j/ Q0 f/ t
Type Reason Age From Message
# v( j3 Q9 b" J# } </span>---- ------ ---- ---- -------<span style="color: rgba(0, 0, 0, 1)">
$ E) c9 `3 |7 Z5 H# y! ? Normal Scheduled 2m23s default</span>-scheduler Successfully assigned default/<span style="color: rgba(0, 0, 0, 1)">webapp to ayato
2 G% {; T" p( T. g 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 machine1 q' @- g( O, M2 z k
Normal Created 2m21s kubelet Created container webapp7 L9 L, h7 M* C# y Y( e3 k. ~) w
Normal Started 2m21s kubelet Started container webapp7 m2 y4 R. B. g' Q) Q
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)">
& n8 k- b) P5 r* J0 l 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
* N9 t) \3 U2 R+ C# X Normal Created 15s kubelet Created container busybox4 F& y! T$ P y* q. J. m8 F3 v, Y2 b
Normal Started 14s kubelet Started container busybox</span></pre>3 c6 L3 y3 q! Q
</div>6 Y$ `1 U2 ]9 t3 ^$ `
<p>真的是飞一般的感觉!!!</p>/ s) r. J1 d5 B6 z
<p> </p>) G+ q6 z1 {+ k7 |3 p( l
<p>三、Context和Namespace切换</p>* {: j8 Z0 N: j: S
<p>我们在公司的容器平台上使用kubectl时,经常需要切换context和namespace,导致命令非常繁琐,那有没有简便的方式呢?—— kubectx</p>& U/ ]8 j5 {) l" g6 T& [
<p>kubectx安装</p>( I% ?( Y; L5 U3 ?
<div class="cnblogs_code">
5 Z0 b7 d4 @4 A" h<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>
9 j' C4 k- u D2 K% O, R7 \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)">...8 f5 p* m$ w8 q3 `: P7 x
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)">.
) }$ P1 }1 U& C6 t) L* tremote: 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)">.
& C4 f: V* r$ ?2 z% Uremote: 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)">.5 @/ q4 \4 R2 c Y3 Y$ \3 R0 u; ~3 Z
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)">
; H: R, b: H: Y, ?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)">. p# C. ], f- g% S
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)">.
2 L- v% ~( B: i& o# 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
( J- M; Q' T' N5 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/kubectx /usr/local/bin/kubectl-ctx</pre>$ I0 `+ k2 _- n+ A5 W# h* N5 N
</div>
' H2 {1 {- }# L$ V<p>我们来看一下效果:</p>/ S1 e# i! V6 H1 U# y
<div class="cnblogs_code">
4 G5 A. @9 Z9 a4 o9 d<pre>$ <span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ctx% ^" l% D" G# {4 g" [8 S! v
minikube% ^3 Y9 v! h9 p. X* u: m; j
$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ctx minikube3 q/ o, S2 U$ U7 N$ M
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)">.* M# r, i N( z g
$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ns
3 q9 s6 _7 P: {9 h0 e9 t9 ]- p2 udefault! O( l( \9 i- ]/ m
kube</span>-node-<span style="color: rgba(0, 0, 0, 1)">lease
; a1 o- T8 H' Z0 t. J" _kube</span>-<span style="color: rgba(0, 0, 0, 1)">public
: [. M7 ^/ {: B: j8 [7 j' Xkube</span>-<span style="color: rgba(0, 0, 0, 1)">system1 k' h6 ^4 r0 ^7 t n
kubernetes</span>-<span style="color: rgba(0, 0, 0, 1)">dashboard
- O( ]) y0 P0 x |6 X$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span> k ns kube-<span style="color: rgba(0, 0, 0, 1)">public
3 |! e& C" Y) vContext </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.* \. q: a# V; [5 e, J- n1 `0 Q- o3 S
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)">.
( A7 N) G" l0 r* j$ </span><span style="color: rgba(0, 0, 255, 1)">sudo</span><span style="color: rgba(0, 0, 0, 1)"> k ns default
4 [/ h- K, t+ e% H. UContext </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.) E( @: K$ I% {- `
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>& ?) s- k0 i1 c# r; W1 P
</div>& E" Q# Y3 D0 U+ z/ x
<p> </p>
4 X- w% P- }, E; p3 {<p>四、跟踪查看多个Pod的日志</p>
- I; h- [, ` K4 v) S/ j V<p>我们一般使用kubectl logs命令查看Pod日志,但是它不能通过-f参数同时跟踪查看多个Pod日志,这就不方便了,毕竟实际生产环境中每个服务都会有多个Pod,这时我们可以使用stern这个工具,它具备如下能力:</p>, B ~0 {. |6 b5 p) W6 g# o
<ul class="list-paddingleft-2">$ i% e" T7 m- m. P& M' z& A% B
<li>
0 z& W& V. K6 j6 x" X6 S+ {<p>允许使用正则表达式来选择需要查看的PodName</p>
5 K k8 n4 r6 d+ \4 d. F. W4 `8 U</li>
, K2 M2 w4 z2 k<li>/ J/ F0 }$ k; }/ W/ r
<p>为不同 Pod 的日志展示不同的颜色</p>
2 a. Q+ }( K' U( s</li>! e+ R! ~5 t+ R0 f* w
<li>- g5 b& g. S+ N( X2 W8 a( C c
<p>跟踪日志过程中假如有符合规则的新 Pod 被创建, 那么会自动添加到输出中</p>$ Z+ f' e7 W4 N* p
</li>! @* P/ q# ^% Q$ M3 w$ @* b5 n
</ul>; N7 C9 c& W# T C6 G* Z
<p>首先安装stern(下载stern时可能较慢可以多试几次):</p>
# n, }1 W% q0 @0 P* Z<div class="cnblogs_code">
" q6 P9 {& W+ u( X; D<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>0 G. l3 r* `/ E' K* k
<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 {# L, I* H. O' m; g# 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>0 u" X# _' k; ?; Z* G7 q/ R' U
</div>
6 _/ T* f9 |& I% J0 k<p>安装完毕后让我一起感受一下stern的魅力吧,我的Pod里面有两个容器:webapp和busybox,如果使用kubectl logs 还得指定具体的容器,而使用stern就没有这样的限制。</p>. _: `) T/ B6 `; `* Y. A% H
<div class="cnblogs_code">) Z! C0 l v1 P/ F) |) G5 w5 h5 a
<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)"> .$ ^* M. y- `& m+ `. f
</span>+<span style="color: rgba(0, 0, 0, 1)"> webapp › busybox
* i1 g8 ^" g: g; h& B</span>+<span style="color: rgba(0, 0, 0, 1)"> webapp › webapp' w. I6 l1 h$ }* P
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.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)">]
8 g6 d2 J- f( s( {8 ^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]* e7 P' k$ {4 b# q4 H+ 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)">]' e& Q) h( B. x* N! a; i5 [' 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)">53.324</span> [INFO ] [main] [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/<span style="color: rgba(0, 0, 0, 1)">]] Initializing Spring embedded WebApplicationContext
3 U; s) T$ V( T" a9 S; N# w5 Hwebapp 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
0 e8 F- \/ _8 _: uwebapp 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 Y" [/ f1 e' ?) Uwebapp 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)" v+ P! N: }! ?
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.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)">]* }' \9 d5 \9 z3 Z- N
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)">
4 w: y$ V, v6 V+ ^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)">)% j$ p" F* b! D% x" i" H+ J
webapp webapp
9 _, k# {) s" w& R( c! i1 [webapp webapp . ____ _ __ _ _, a \ R2 f% E4 o) l' O) \3 \
webapp webapp </span>/\\ / ___<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">_ __ _ _(_)_ __ __ _ \ \ \ \</span>
+ Y# _2 J* w |- W- N& Hwebapp 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>
% q1 ]1 L- T) K" y: qwebapp webapp \\/ ___)| |_)| | | | | || (_| |<span style="color: rgba(0, 0, 0, 1)"> ) ) ) )3 f- q7 g: S7 r, m+ J# e
webapp webapp </span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)"> |____| .__|_| |_|_| |_\__, | / / / /</span>0 k8 t! ^8 M9 {4 ] Z: ]
webapp webapp =========|_|==============|___/=/_/_/_/<span style="color: rgba(0, 0, 0, 1)">
' ?" `3 N7 C$ swebapp 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 B7 F0 v! L3 ?$ L
webapp webapp
! `* ~- A1 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)">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)
3 ^5 \& c. p/ C. t0 a3 hwebapp 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! H: E- x" B/ d {0 c
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)
8 q$ R4 z* y4 ~" hwebapp 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)">]0 |! W% ^, v5 p) 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)">53.200</span><span style="color: rgba(0, 0, 0, 1)"> [INFO ] [main] [org.apache.catalina.core.StandardService] Starting service [Tomcat]" O% w) a! O4 u8 {# f& t
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)">]' F" N2 B4 {' B }& { L: Q: 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.324</span> [INFO ] [main] [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/<span style="color: rgba(0, 0, 0, 1)">]] Initializing Spring embedded WebApplicationContext n w" j; _0 u1 F0 k& H) g
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: x) s, v; C) V& p+ _# t
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)">/ |6 u( d8 \5 D! b8 ^+ ^* A6 u
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)
- A, g& h# d7 h. }! q5 K* h. T9 ^ 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.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)">]
- [6 J; N. y7 H! Gwebapp 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)">
4 ~. [. y7 Y: o2 jwebapp 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>
( \: `7 p) V+ v: L</div>
7 X, m ^3 M$ T/ \* N; Z<p> </p>
+ n, j% N, c; g5 x! P, W4 I |
|