{"id":97736,"date":"2020-10-21T14:42:17","date_gmt":"2020-10-21T12:42:17","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/obzor-k9s-prodvinutogo-terminalnogo-interfejsa-dlya-kubernetes"},"modified":"2020-10-21T14:42:17","modified_gmt":"2020-10-21T12:42:17","slug":"obzor-k9s-prodvinutogo-terminalnogo-interfejsa-dlya-kubernetes","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/obzor-k9s-prodvinutogo-terminalnogo-interfejsa-dlya-kubernetes","title":{"rendered":"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/11274841ee84b0e2c3ac74c9c738faba.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/k9scli.io\/\">K9s<\/a><\/noindex> ofron nj\u00eb nd\u00ebrfaqe terminali p\u00ebr t\u00eb nd\u00ebrvepruar me klaster\u00ebt Kubernetes. Q\u00ebllimi i k\u00ebtij projekti Open Source \u00ebsht\u00eb t\u00eb leht\u00ebsoj\u00eb navigimin e duhur n\u00eb aplikacionet n\u00eb K8s, monitorimin e tyre dhe menaxhimin e tyre. K9s vazhdimisht ndjek ndryshimet n\u00eb Kubernetes dhe ofron komanda t\u00eb shpejta p\u00ebr pun\u00ebn me burimet q\u00eb po monitorohen.<\/p>\n<p>Projekti \u00ebsht\u00eb shkruar n\u00eb Go, ka ekzistuar p\u00ebr m\u00eb shum\u00eb se nj\u00eb ka mbi nj\u00eb vit e gjysm\u00eb: komiti i par\u00eb \u00ebsht\u00eb b\u00ebr\u00eb m\u00eb 1 shkurt 2019. N\u00eb momentin e shkruar t\u00eb k\u00ebtij artikulli, num\u00ebrohen mbi 9000 yje n\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/derailed\/k9s\">GitHub<\/a><\/noindex> dhe rreth 80 kontribues. Le t\u00eb shohim \u00e7far\u00eb di t\u00eb b\u00ebj\u00eb k9s?<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h2>Instalimi dhe nisja<\/h2>\n<p>\nKy \u00ebsht\u00eb nj\u00eb aplikacion klient (n\u00eb lidhje me klasterin Kubernetes), i cili m\u00eb leht\u00eb mund t\u00eb nis\u00ebt si nj\u00eb imazh Docker:<\/p>\n<pre><code class=\"bash\">docker run --rm -it -v $KUBECONFIG: \/root\/.kube\/config quay.io \/derailed\/k9s<\/code><\/pre>\n<p>\nP\u00ebr disa distribucione Linux dhe sisteme t\u00eb tjera operuese, gjithashtu ka di\u00e7ka t\u00eb gatshme p\u00ebr instalim. <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/derailed\/k9s#installation\">paketat<\/a><\/noindex>N\u00eb p\u00ebrgjith\u00ebsi p\u00ebr sistemet Linux mund t\u00eb instaloni skedarin binar:<\/p>\n<pre><code class=\"bash\">sudo wget -qO- https:\/\/github.com\/derailed\/k9s\/releases\/download\/v0.22.0\/k9s_Linux_x86_64.tar.gz | tar zxvf - -C \/tmp\/\nsudo mv \/tmp\/k9s \/usr\/local\/bin<\/code><\/pre>\n<p>\nNuk ka ndonj\u00eb k\u00ebrkes\u00eb specifike p\u00ebr vet\u00eb klasterin K8s. Sipas komenteve, aplikacioni punon gjithashtu me versione kaq t\u00eb vjetra t\u00eb Kubernetes si 1.12.<\/p>\n<p>Aplikacioni niset duke p\u00ebrdorur konfigurimin standard <code>.kube\/config<\/code> - ashtu si\u00e7 b\u00ebn <code>kubectl<\/code>.<\/p>\n<h2>Navigim<\/h2>\n<p>\nN\u00eb m\u00ebnyr\u00eb t\u00eb paracaktuar, hapet nj\u00eb dritare me hap\u00ebsir\u00ebn em\u00ebrore standarde q\u00eb \u00ebsht\u00eb specifikuar p\u00ebr kontekstin. K\u00ebshtu, n\u00ebse keni shkruar <code>kubectl config set-context --current --namespace=test<\/code>, at\u00ebher\u00eb hapet hap\u00ebsira em\u00ebrore <code>test<\/code>. <i>(P\u00ebr nd\u00ebrrimin e konteksteve \/ hap\u00ebsirave em\u00ebrore shih m\u00eb posht\u00eb.) <\/i><\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/820fcbdd376abc95d67bf202f34c880c.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nKalim n\u00eb <b>modin e komandave<\/b> ndodhi duke shtypur \u201c:\u201d. Pas k\u00ebsaj, mund t\u00eb menaxhoni pun\u00ebn e k9s me komandat \u2014 p\u00ebr shembull, p\u00ebr t\u00eb par\u00eb list\u00ebn e StatefulSets (n\u00eb hap\u00ebsir\u00ebn aktuale em\u00ebrore) mund t\u00eb shkruani <code>:sts<\/code>.<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/840724fc656b22e67519c53983065862.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nP\u00ebr disa burime t\u00eb tjera Kubernetes:<\/p>\n<ul>\n<li> <code>:ns<\/code> - Hap\u00ebsirat em\u00ebrore;<\/li>\n<li> <code>:deploy<\/code> - Instalimet;<\/li>\n<li> <code>:ing<\/code> - Ingresset;<\/li>\n<li> <code>:svc<\/code> - Sh\u00ebrbimet.<\/li>\n<\/ul>\n<p>\nP\u00ebr t\u00eb shfaqur list\u00ebn e plot\u00eb t\u00eb llojeve t\u00eb burimeve t\u00eb disponueshme p\u00ebr t'u par\u00eb, ka komand\u00ebn <code>:aliases<\/code>.<\/p>\n<p>\u00cbsht\u00eb e dobishme p\u00ebr t\u00eb par\u00eb gjithashtu list\u00ebn e komandave t\u00eb disponueshme p\u00ebr kombinime t\u00eb nxehta t\u00eb \u00e7el\u00ebsave brenda dritares aktuale: p\u00ebr k\u00ebt\u00eb mjafton t\u00eb shtypni \"?\".<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/54d329f9eeda2424f457aef6b977ae63.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nPo ashtu, n\u00eb k9s ka <b>nj\u00eb mod t\u00eb k\u00ebrkimit<\/b>, p\u00ebr t\u00eb kaluar n\u00eb t\u00eb, \u00ebsht\u00eb e mjaftueshme t\u00eb shkruani \u201c\/\u201d. Me t\u00eb, b\u00ebhet k\u00ebrkimi n\u00eb p\u00ebrmbajtjen e \u201cdritares\u201d aktuale. Supozoni, n\u00ebse m\u00eb par\u00eb keni shkruar <code>:ns<\/code>, keni hapur list\u00ebn e hap\u00ebsirave em\u00ebrore. N\u00ebse ka shum\u00eb prej tyre, at\u00ebher\u00eb p\u00ebr t\u00eb mos e zgjatur skrollimin, mjafton t\u00eb shkruani n\u00eb dritaren me hap\u00ebsirat em\u00ebrore <code>\/mynamespace<\/code>.<\/p>\n<p>P\u00ebr t\u00eb k\u00ebrkuar sipas etiketave, mund t\u00eb zgjidhni t\u00eb gjitha pod-\u00ebt n\u00eb hap\u00ebsir\u00ebn e duhur t\u00eb emrave, pas s\u00eb cil\u00ebs n\u00eb p\u00ebrputhje me, <code>\/ -l app=whoami<\/code>do t\u00eb marrim nj\u00eb list\u00eb pod-\u00ebsh me k\u00ebt\u00eb etiket\u00eb:<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/88b8e09a5b7819bcf49334bf351b040b.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nK\u00ebrkimi funksionon n\u00eb t\u00eb gjitha llojet e dritareve, duke p\u00ebrfshir\u00eb log-et, shikimin e manifest\u00ebve YAML dhe <code>p\u00ebrshkruaj<\/code> p\u00ebr burimet \u2014 p\u00ebr detaje mbi k\u00ebto mund\u00ebsi shihni m\u00eb posht\u00eb.<\/p>\n<p>Si duket n\u00eb p\u00ebrgjith\u00ebsi sekuenca e veprimeve p\u00ebr navigimin?<\/p>\n<p>Me an\u00eb t\u00eb komand\u00ebs <code>:ctx<\/code> mund t\u00eb zgjidhni kontekstin:<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/a5e780a3fc98961913c966222e167d51.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nP\u00ebr t\u00eb zgjedhur hap\u00ebsir\u00ebn e emrave tashm\u00eb ekziston komanda e p\u00ebrmendur m\u00eb par\u00eb <code>:ns<\/code>, pastaj mund t\u00eb p\u00ebrdorni k\u00ebrkimin p\u00ebr hap\u00ebsir\u00ebn e duhur: <code>\/test<\/code>.<\/p>\n<p>N\u00ebse tani zgjidhni burimin q\u00eb na intereson (p\u00ebr shembull, StatefulSet e nj\u00ebjt\u00eb), informacione p\u00ebr t\u00eb do t\u00eb shfaqen: sa pod-e jan\u00eb t\u00eb hapura me nj\u00eb p\u00ebrmbledhje t\u00eb shkurt\u00ebr p\u00ebr to.<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/8e0d8c41b8673b7c29f2605d3ae59503.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nMund t\u00eb jen\u00eb t\u00eb interesuar vet\u00ebm pod-\u00ebt \u2014 at\u00ebher\u00eb mjafton t\u00eb shkruani <code>:pod<\/code>. N\u00eb rastin e ConfigMap-\u00ebve (<code>:cm<\/code> \u2014 p\u00ebr list\u00ebn e k\u00ebtyre burimeve) mund t\u00eb zgjidhni objektin e interesuar dhe t\u00eb klikoni 'u', pas s\u00eb cil\u00ebs K9s do t'ju tregoj\u00eb se kush konkretisht e p\u00ebrdor at\u00eb (k\u00ebto CM).<\/p>\n<p>Nj\u00eb tipar tjet\u00ebr i k\u00ebndsh\u00ebm p\u00ebr shikimin e burimeve \u00ebsht\u00eb <b>\u2018rentgeni\u2019 (pamja XRay)<\/b>. Ky mod \u00ebsht\u00eb i aktivizuar nga komanda <code>:xray RESOURCE<\/code> dhe... m\u00eb e leht\u00eb \u00ebsht\u00eb t\u00eb tregosh si funksionon, sesa t\u00eb shpjegosh. K\u00ebtu \u00ebsht\u00eb nj\u00eb ilustruar p\u00ebr StatefulSets:<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/de40ebfe06ca935d2bc36323b3f16f3e.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>(\u00c7do nga k\u00ebto burime mund t\u00eb redaktohet, t\u00eb ndryshohet, t\u00eb b\u00ebhet <code>p\u00ebrshkruaj<\/code>.)<\/i><\/p>\n<p>Ja nj\u00eb shembull i Deployment me Ingress:<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/598c1b25b787dcb1cf9660fa730d74c5.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<h2>Puna me burimet<\/h2>\n<p>\nP\u00ebr \u00e7do burim mund t\u00eb merrni informacion n\u00eb YAML ose t\u00eb tij\u00ebn <code>p\u00ebrshkruaj<\/code> duke klikuar n\u00eb kombinimet p\u00ebrkat\u00ebse t\u00eb ky\u00e7jeve ('y' dhe 'd' p\u00ebrkat\u00ebsisht). Operacione baz\u00eb, sigurisht, ka edhe m\u00eb shum\u00eb: lista e tyre dhe kombinimet e ky\u00e7jeve jan\u00eb gjithmon\u00eb n\u00eb pamje fal\u00eb 'kepit' t\u00eb leht\u00eb n\u00eb nd\u00ebrfaqe (fshihet duke klikuar Ctrl + e).<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/6bbe4ca07442e1e14a462586d14ef98d.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nKur redaktoni \u00e7do burim ('e' pas p\u00ebrzgjedhjes s\u00eb tij) hapet nj\u00eb redaktues teksti, i p\u00ebrcaktuar n\u00eb variablat e ambientit (<code>eksporto EDITOR=vim<\/code>).<\/p>\n<p>Ja si duket p\u00ebrshkrimi i detajuar i burimit (<code>p\u00ebrshkruaj<\/code>):<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/05fdb57e3b85d1b81c9bfc6414aca117.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nKy dalje (apo dalje e shikimit t\u00eb manifestit YAML t\u00eb burimit) mund t\u00eb ruhet me ndihm\u00ebn e kombinimit t\u00eb zakonsh\u00ebm t\u00eb ky\u00e7jeve Ctrl + s. Do t\u00eb dihet ku do t\u00eb ruhet nga mesazhi i K9s:<\/p>\n<pre><code class=\"plaintext\">Log \/tmp\/k9s-screens-root\/kubernetes\/Describe-1601244920104133900.yml ruajtur me sukses!<\/code><\/pre>\n<p>\nNga skedar\u00ebt e krijuar si kopje rezerv\u00eb mund t\u00eb rikuperoni burime, pas heqjes s\u00eb etiketave dhe anotacioneve sistemike. P\u00ebr k\u00ebt\u00eb do t\u00eb duhet t\u00eb kaloni n\u00eb direktorin\u00eb me to (<code>:dir \/tmp<\/code>), pastaj t\u00eb zgjidhni skedarin e nevojsh\u00ebm dhe ta aplikoni <code>aplikoni<\/code>.<\/p>\n<p>N\u00eb \u00e7do moment, mund t\u00eb riktheheni n\u00eb ReplicaSet-in e kaluar n\u00ebse ka probleme me t\u00eb tanishmin. P\u00ebr k\u00ebt\u00eb, duhet t\u00eb zgjidhni RS-in e nevojsh\u00ebm (<code>:rs<\/code> nga lista e tyre):<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/de0ea37d970c51514559288661bdc6f2.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\n\u2026 dhe t\u00eb kryeni ri-kthimin me Ctrl + l. Duhet t\u00eb marrim nj\u00eb njoftim se gjith\u00e7ka shkoi mir\u00eb:<\/p>\n<pre><code class=\"plaintext\">k9s\/whoami-5cfbdbb469 u rikthye me sukses<\/code><\/pre>\n<p>\nDhe p\u00ebr t\u00eb shkall\u00ebzuar replikat, mjafton t\u00eb shtypni \"s\" (scale) dhe t\u00eb zgjidhni numrin e duhur t\u00eb instancave:<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/145093030db754c9ef85810cbba3ed5c.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nN\u00eb \u00e7do kontenier mund t\u00eb hysh p\u00ebrmes shell: p\u00ebr k\u00ebt\u00eb, kaloni te pod-i i nevojsh\u00ebm, shtypni \"s\" (shell) dhe zgjidhni kontenerin.<\/p>\n<h2>Mund\u00ebsi t\u00eb tjera<\/h2>\n<p>\nSigurisht, mb\u00ebshtetet gjithashtu shqyrtimi i log\u00ebve (\"l\" p\u00ebr burimin e zgjedhur). Dhe p\u00ebr t\u00eb par\u00eb log\u00ebt e reja, nuk \u00ebsht\u00eb e nevojshme t\u00eb shtypni vazhdimisht Enter: mjafton t\u00eb b\u00ebni markim (\"m\"), pas s\u00eb cil\u00ebs do t\u00eb ndiqni vet\u00ebm mesazhet e reja.<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/05aa9657f744b9e3d09034862e1befe7.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nPo ashtu, n\u00eb k\u00ebt\u00eb dritare mund t\u00eb zgjidhni nj\u00eb interval kohor p\u00ebr shfaqjen e log\u00ebve:<\/p>\n<ul>\n<li> \u00e7el\u00ebsi \"1\" \u2014 p\u00ebr 1 minut\u00eb;<\/li>\n<li> \"2\" \u2014 5 minuta;<\/li>\n<li> \"3\" \u2014 15 minuta;<\/li>\n<li> \"4\" \u2014 30 minuta;<\/li>\n<li> \"5\" \u2014 1 or\u00eb;<\/li>\n<li> \"0\" \u2014 p\u00ebr t\u00eb gjith\u00eb koh\u00ebzgjatjen e pod-it.<\/li>\n<\/ul>\n<p>\nNj\u00eb m\u00ebnyr\u00eb e ve\u00e7ant\u00eb e pun\u00ebs \u00ebsht\u00eb Pulse (komanda <code>:pulse<\/code>) e cila tregon informacion t\u00eb p\u00ebrgjithsh\u00ebm p\u00ebr Kubernetes-n:<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/413d241ad7518f49c523fa59f51702a6.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nN\u00eb t\u00eb mund t\u00eb shihni numrin e burimeve dhe gjendjen e tyre ( ato me ngjyr\u00eb t\u00eb gjelb\u00ebr tregojn\u00eb statusin <code>Running<\/code>).<\/p>\n<p>Nj\u00eb funksion tjet\u00ebr interesant i K9s quhet <b>Popeye<\/b>. Ai kontrollon t\u00eb gjitha burimet p\u00ebr kritere t\u00eb caktuara korrekt\u00ebsie dhe jep \"vler\u00ebsimin\" me shpjegime. P\u00ebr shembull, mund t\u00eb shihni se mungojn\u00eb kufij ose limitet, ose ndonj\u00eb kontenier mund t\u00eb ekzekutohet n\u00ebn root...<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/a6bc5ea45b5749fb4e1038b82374b3c4.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nEkziston mb\u00ebshtetje baz\u00eb p\u00ebr Helm. P\u00ebr shembull, k\u00ebshtu mund t\u00eb shihni l\u00ebshimet e vendosura n\u00eb klaster:<\/p>\n<pre><code class=\"bash\">:helm all # t\u00eb gjitha\n:helm $namespace # n\u00eb hap\u00ebsir\u00ebn e ve\u00e7ant\u00eb t\u00eb emrit\n<\/code><\/pre>\n<p><\/p>\n<h2>Benchmark<\/h2>\n<p>\nN\u00eb K9s e kan\u00eb integruar madje <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/rakyll\/hey\">hey<\/a><\/noindex> \u2014 kjo \u00ebsht\u00eb nj\u00eb gjenerator i thjesht\u00eb ngarkese p\u00ebr serverin HTTP, alternativ\u00eb ndaj m\u00eb t\u00eb njohurit ab (ApacheBench).<\/p>\n<p>P\u00ebr ta aktivizuar at\u00eb, k\u00ebrkohet aktivizimi i port-forward n\u00eb pod. P\u00ebr k\u00ebt\u00eb, zgjedhim pod-in dhe shtypim Shift + f, kalojm\u00eb n\u00eb n\u00ebnmenun\u00eb port-forward me aliasin \"pf\".<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/651f25269c0998c716ab9c0c4b5e0455.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nPas zgjedhjes s\u00eb portit dhe shtypjes s\u00eb Ctrl + b, do t\u00eb nis\u00eb vet\u00eb benchmark-u. Rezultatet e tij ruhen n\u00eb <code>\/tmp<\/code> dhe jan\u00eb t\u00eb disponueshme p\u00ebr shqyrtim n\u00eb K9s. <\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/57b2fe1d078e9aca1c6afccd318094da.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/3b2bf031e8442e47eb3482187ac5b64d.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nP\u00ebr t\u00eb ndryshuar konfigurimin e benchmark-ut, duhet t\u00eb krijoni nj\u00eb skedar <code>$HOME\/.k9s\/bench-.yml<\/code> (definohet p\u00ebr \u00e7do klaster).<\/p>\n<p><i>NB: \u00cbsht\u00eb e r\u00ebnd\u00ebsishme q\u00eb t\u00eb gjitha skedar\u00ebt YAML n\u00eb direktorin\u00eb <code>.k9s<\/code> t\u00eb ken\u00eb pik\u00ebrisht <code>.yml<\/code> (<code>.yaml<\/code> (nuk funksionon si\u00e7 duhet).<\/i><\/p>\n<p>Shembulli i konfigurimit:<\/p>\n<pre><code class=\"bash\">benchmark:\n  defaults:\n    # Numri i proceseve\n    concurrency: 2\n    # Numri i k\u00ebrkesave\n    requests: 1000\n  containers:\n    # Cil\u00ebsimet p\u00ebr kontejnerin e benchmark\n    # Kontejneri p\u00ebrcaktohet si namespace\/pod-name:container-name\n    default\/nginx:nginx:\n      concurrency: 2\n      requests: 10000\n      http:\n        path: \/\n        method: POST\n        body:\n          {\"foo\":\"bar\"}\n        header:\n          Accept:\n            - text\/html\n          Content-Type:\n            - application\/json\n services:\n    # Mund t\u00eb kryhen benchmark n\u00eb sh\u00ebrbime si NodePort dhe LoadBalancer\n    # Sintaksa: namespace\/service-name\n    default\/nginx:\n      concurrency: 5\n      requests: 500\n      http:\n        method: GET\n        path: \/auth\n      auth:\n        user: flant\n        password: s3cr3tp455w0rd\n<\/code><\/pre>\n<p><\/p>\n<h2>Nd\u00ebrfaqja<\/h2>\n<p>\nPamja e kolonave p\u00ebr listat e burimeve modifikohet duke krijuar nj\u00eb skedar <code>$HOME\/.k9s\/views.yml<\/code>. Shembulli i p\u00ebrmbajtjes s\u00eb tij:<\/p>\n<pre><code class=\"plaintext\">k9s:\n views:\n   v1\/pods:\n     columns:\n       - AGE\n       - NAMESPACE\n       - NAME\n       - IP\n       - NODE\n       - STATUS\n       - READY\n   v1\/services:\n     columns:\n       - AGE\n       - NAMESPACE\n       - NAME\n       - TYPE\n       - CLUSTER-IP\n<\/code><\/pre>\n<p>\n<i>E v\u00ebrteta, i mungon kolon\u00eb p\u00ebr etiketat, p\u00ebr \u00e7ka ka <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/derailed\/k9s\/issues\/605\">\u00e7\u00ebshtje n\u00eb projekt<\/a><\/noindex>.<\/i><\/p>\n<p>Sortimi sipas kolonave arrihet me kombinime t\u00eb tasteve:<\/p>\n<ul>\n<li> Shift + n \u2014 sipas emrit;<\/li>\n<li> Shift + o \u2014 sipas nyjave;<\/li>\n<li> Shift + i \u2014 sipas IP;<\/li>\n<li> Shift + a \u2014 sipas koh\u00ebzgjatjes s\u00eb kontejnerit;<\/li>\n<li> Shift + t \u2014 sipas numrit t\u00eb ribrikimeve;<\/li>\n<li> Shift + r \u2014 sipas statusit t\u00eb gatishm\u00ebris\u00eb;<\/li>\n<li> Shift + c \u2014 sipas konsumit t\u00eb CPU;<\/li>\n<li> Shift + m \u2014 sipas konsumit t\u00eb memories.<\/li>\n<\/ul>\n<p>\nN\u00ebse dikujt nuk i p\u00eblqen dizajni i paracaktuar, n\u00eb K9s mb\u00ebshteten madje <noindex><a rel=\"nofollow\" href=\"https:\/\/k9scli.io\/topics\/skins\/\">temat<\/a><\/noindex>. Shembuj t\u00eb gatsh\u00ebm (7 n\u00eb total) jan\u00eb n\u00eb dispozicion <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/derailed\/k9s\/tree\/master\/skins\">k\u00ebtu<\/a><\/noindex>. Ja nj\u00eb shembull i nj\u00eb prej k\u00ebtyre temave <i>(in the navy)<\/i>:<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/4a4378f2c2d36eb3985e2b71d733c444.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<h2>Plugins<\/h2>\n<p>\nFinally, <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/derailed\/k9s\/tree\/master\/plugins\">plugina<\/a><\/noindex> lejojn\u00eb zgjerimin e mund\u00ebsive t\u00eb K9s. Un\u00eb n\u00eb praktik\u00eb kam p\u00ebrdorur vet\u00ebm nj\u00eb prej tyre \u2014 <code>kubectl get all -n $namespace<\/code>.<\/p>\n<p>Duket k\u00ebshtu. Krijojm\u00eb nj\u00eb skedar <code>$HOME\/.k9s\/plugin.yml<\/code> me k\u00ebt\u00eb p\u00ebrmbajtje:<\/p>\n<pre><code class=\"bash\">plugin:\n get-all:\n   shortCut: g    \n   confirm: false    \n   description: get all\n   scopes:\n   - all\n   command: sh\n   background: false\n   args:\n   - -c\n   - \"kubectl -n $NAMESPACE get all -o wide | less\"<\/code><\/pre>\n<p>\nTani mund t\u00eb kalosh n\u00eb hap\u00ebsir\u00ebn e emrit dhe t\u00eb shtyp\u00ebsh \"g\" p\u00ebr t\u00eb ekzekutuar me komand\u00ebn p\u00ebrkat\u00ebse:<\/p>\n<p><img decoding=\"async\" alt=\"Shqyrtim i k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes\" src=\"\/wp-content\/uploads\/2020\/10\/c79bbf26b6c321a97cedabf22f1699b9.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nNd\u00ebr plugin\u00ebt ka, p\u00ebr shembull, integrime me kubectl-jq dhe mjetin p\u00ebr shikimin e logeve <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/wercker\/stern\">stern<\/a><\/noindex>.<\/p>\n<h2>P\u00ebrfundim<\/h2>\n<p>\nN\u00eb mendimin tim, K9s ishte shum\u00eb e p\u00ebrshtatshme p\u00ebr pun\u00eb: u m\u00ebsova mjaft shpejt t\u00eb gjej gjith\u00e7ka t\u00eb nevojshme pa p\u00ebrdorimin e <code>kubectl<\/code>. M\u00eb p\u00eblqeu shikimi dhe ruajtja e logeve, redaktimi i shpejt\u00eb i burimeve, shpejt\u00ebsia e p\u00ebrgjithshme e pun\u00ebs*, doli t\u00eb ishte i dobish\u00ebm funksioni Popeye. Vlera e ve\u00e7ant\u00eb jan\u00eb mund\u00ebsit\u00eb p\u00ebr t\u00eb krijuar plugin\u00eb dhe p\u00ebr t\u00eb modifikuar aplikacionin sipas nevojave t\u00eb mia.<\/p>\n<p><i>* Megjith\u00ebse kur ka nj\u00eb volum t\u00eb madh logesh kam v\u00ebn\u00eb re gjithashtu nj\u00eb pun\u00eb t\u00eb ngadalt\u00eb t\u00eb K9s. N\u00eb ato momente, utilita \"therte\" 2 b\u00ebrthama nga Intel Xeon E312xx dhe madje mund t\u00eb ngadal\u00ebsohej.<\/i><\/p>\n<p>\u00c7far\u00eb i mungon n\u00eb k\u00ebt\u00eb moment? Nj\u00eb rikthim t\u00eb shpejt\u00eb n\u00eb versionin e m\u00ebparsh\u00ebm (nuk flasim p\u00ebr RS) pa kaluar n\u00eb direktorin\u00eb. P\u00ebr m\u00eb tep\u00ebr, rikuperimi ndodh vet\u00ebm p\u00ebr <i>t\u00eb gjith\u00eb<\/i> resurset: n\u00ebse keni fshir\u00eb nj\u00eb annotim ose nj\u00eb etiket\u00eb, do t\u00eb duhet t\u00eb fshini dhe t\u00eb rikuperoni t\u00eb gjith\u00eb burimin (k\u00ebtu do t\u00eb jet\u00eb e nevojshme t\u00eb kaloni n\u00eb direktorin\u00eb). Nj\u00eb detaj tjet\u00ebr \u2013 mungon data e atyre \"backup-ev\" t\u00eb ruajtur.<\/p>\n<h2>P.S.<\/h2>\n<p>\nLexoni gjithashtu n\u00eb blogun ton\u00eb:<\/p>\n<ul>\n<li> \u00ab<noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/506948\/\">P\u00ebrmbledhje e nd\u00ebrfaqeve grafike p\u00ebr Kubernetes<\/a><\/noindex>\u00bb;<\/li>\n<li> \u00ab<noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/468041\/\">Ankandi i nd\u00ebrfaqes n\u00eb web Kubernetes Web View (dhe nj\u00eb p\u00ebrmbledhje e shkurt\u00ebr e nd\u00ebrfaqeve t\u00eb tjera web p\u00ebr Kubernetes)<\/a><\/noindex>\u00bb;<\/li>\n<li> \u00ab<noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/426985\/\">kubebox dhe konzolla t\u00eb tjera p\u00ebr Kubernetes<\/a><\/noindex>\u00bb.<\/li>\n<\/ul>\n<p>Burimi: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/524196\/\">habr.com<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>K9s \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u043c\u0438 Kubernetes. \u0426\u0435\u043b\u044c \u044d\u0442\u043e\u0433\u043e Open Source-\u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u2014 \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u043f\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u0432 K8s, \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u0437\u0430 \u043d\u0438\u043c\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043c\u0438. K9s \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 Kubernetes \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 Go, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0443\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0443\u0442\u043e\u0440\u0430 \u043b\u0435\u0442: \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043c\u043c\u0438\u0442 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":97737,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-97736","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2.1 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/obzor-k9s-prodvinutogo-terminalnogo-interfejsa-dlya-kubernetes\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"sq_AL\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041e\u0431\u0437\u043e\u0440 k9s \u2014 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0433\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f Kubernetes | ProHoster\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/obzor-k9s-prodvinutogo-terminalnogo-interfejsa-dlya-kubernetes\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-10-21T12:42:17+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-10-21T12:42:17+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47P\u00ebrmbledhje e k9s \u2014 nj\u00eb nd\u00ebrfaqe terminali e avancuar p\u00ebr Kubernetes | ProHoster","description":"","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/obzor-k9s-prodvinutogo-terminalnogo-interfejsa-dlya-kubernetes","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sq_AL","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041e\u0431\u0437\u043e\u0440 k9s \u2014 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0433\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f Kubernetes | ProHoster","og:url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/obzor-k9s-prodvinutogo-terminalnogo-interfejsa-dlya-kubernetes","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-10-21T12:42:17+00:00","article:modified_time":"2020-10-21T12:42:17+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"97736","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 10:14:39","updated":"2022-10-03 07:12:05","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/97736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/comments?post=97736"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/97736\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media\/97737"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=97736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=97736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=97736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}