{"id":55712,"date":"2020-01-27T00:00:00","date_gmt":"2020-01-26T21:00:00","guid":{"rendered":"https:\/\/prohoster.info\/blog\/blog_prohoster\/tri-urovnya-avtomasshtabirovaniya-v-kubernetes-kak-ih-effektivno-ispolzovat"},"modified":"2020-02-18T14:03:51","modified_gmt":"2020-02-18T11:03:51","slug":"tri-urovnya-avtomasshtabirovaniya-v-kubernetes-kak-ih-effektivno-ispolzovat","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/tri-urovnya-avtomasshtabirovaniya-v-kubernetes-kak-ih-effektivno-ispolzovat","title":{"rendered":"Tre nivele t\u00eb automatik\u00ebs n\u00eb Kubernetes: si t'i p\u00ebrdorim ato n\u00eb m\u00ebnyr\u00eb efektive","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"Tre nivele t\u00eb automatik\u00ebs n\u00eb Kubernetes: si t&#039;i p\u00ebrdorim ato n\u00eb m\u00ebnyr\u00eb efektive\" src=\"\/wp-content\/uploads\/2020\/01\/0b076d65db116cabdd1b4ae380d3777d.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nP\u00ebr t'u njohur plot\u00ebsisht me Kubernetes, \u00ebsht\u00eb e nevojshme t\u00eb njihni m\u00ebnyrat e ndryshme t\u00eb skalimit t\u00eb burimeve t\u00eb klasterit: <noindex><a rel=\"nofollow\" href=\"https:\/\/speakerdeck.com\/thockin\/everything-you-ever-wanted-to-know-about-resource-scheduling-dot-dot-dot-almost\">sipas zhvilluesve t\u00eb sistemit<\/a><\/noindex>, kjo \u00ebsht\u00eb nj\u00eb nga detyrat kryesore t\u00eb Kubernetes. Ne kemi p\u00ebrgatitur nj\u00eb p\u00ebrmbledhje t\u00eb nivelit t\u00eb lart\u00eb t\u00eb mekanizmave t\u00eb automatizimit horizontal dhe vertical t\u00eb skalimit dhe rritjes s\u00eb madh\u00ebsis\u00eb s\u00eb klaster\u00ebve, si dhe rekomandime se si t'i p\u00ebrdorni ato n\u00eb m\u00ebnyr\u00eb efektive.<\/p>\n<p>Artikulli <noindex><a rel=\"nofollow\" href=\"https:\/\/www.magalix.com\/blog\/kubernetes-autoscaling-101\">Kubernetes Autoscaling 101: Cluster Autoscaler, Horizontal Autoscaler, dhe Vertical Pod Autoscaler<\/a><\/noindex> u p\u00ebrkthye nga ekipi q\u00eb implementoi automatizimin <noindex><a rel=\"nofollow\" href=\"https:\/\/mcs.mail.ru\/containers\/\">Kubernetes aaS nga Mail.ru<\/a><\/noindex>.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h2>Pse \u00ebsht\u00eb e r\u00ebnd\u00ebsishme t\u00eb mendoni p\u00ebr skalimin <\/h2>\n<p>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/mcs.mail.ru\/blog\/kubernetes-for-much-stuff\">Kubernetes<\/a><\/noindex> \u2014 nj\u00eb mjet p\u00ebr menaxhimin e burimeve dhe orkestrimin. Sigurisht, \u00ebsht\u00eb e bukur t\u00eb merremi me funksionet e mrekullueshme t\u00eb implementimit, monitorimit dhe menaxhimit t\u00eb pod-\u00ebve (moduli pod \u00ebsht\u00eb nj\u00eb grup kontejner\u00ebsh q\u00eb ekzekutohen n\u00eb p\u00ebrgjigje t\u00eb nj\u00eb k\u00ebrkese). <\/p>\n<p>Megjithat\u00eb, \u00ebsht\u00eb e nevojshme t\u00eb mendohet edhe p\u00ebr k\u00ebto pyetje:<\/p>\n<ol>\n<li>Si t\u00eb shkall\u00ebzojm\u00eb modulet dhe aplikacionet?\n<\/li>\n<li>Si t'i mbajm\u00eb kontejner\u00ebt n\u00eb nj\u00eb gjendje funksionale dhe efektive?\n<\/li>\n<li>Si t\u00eb reagojm\u00eb ndaj ndryshimeve t\u00eb vazhdueshme n\u00eb kod dhe ngarkesat nga p\u00ebrdoruesit?\n<\/li>\n<\/ol>\n<p>\nKonfigurimi i klastereve Kubernetes p\u00ebr balancimin e burimeve dhe performanc\u00ebs mund t\u00eb jet\u00eb nj\u00eb nga detyrat m\u00eb t\u00eb v\u00ebshtira, duke k\u00ebrkuar njohuri ekspert\u00ebsh p\u00ebr funksionimin e brendsh\u00ebm t\u00eb Kubernetes. Ngarkesa n\u00eb aplikacionin tuaj ose sh\u00ebrbimet mund t\u00eb ndryshoj\u00eb gjat\u00eb dit\u00ebs ose madje brenda nj\u00eb ore, k\u00ebshtu q\u00eb balancimi duhet t\u00eb paraqitet si nj\u00eb proces i vazhduesh\u00ebm.<\/p>\n<h2>Nivelet e automatizimit n\u00eb Kubernetes<\/h2>\n<p>\nAutomatizimi efektiv k\u00ebrkon koordinim midis dy niveleve: <\/p>\n<ol>\n<li>Niveli i pod\u00ebve, p\u00ebrfshir\u00eb shkall\u00ebzimin horizontal (Horizontal Pod Autoscaler, HPA) dhe shkall\u00ebzimin vertikal (Vertical Pod Autoscaler, VPA). Ky shkall\u00ebzim rregullon burimet ekzistuese p\u00ebr kontejner\u00ebt tuaj.\n<\/li>\n<li>Niveli i klasterit, i cili menaxhohet nga sistemi i automatizimit t\u00eb klasterit (Cluster Autoscaler, CA), i cili rrit ose ul numrin e nyjeve brenda klasterit.\n<\/li>\n<\/ol>\n<p><\/p>\n<h2>Moduli i automatizimit horizontal (HPA)<\/h2>\n<p>\nSi\u00e7 sugjeron emri, HPA shkall\u00ebzon numrin e kopjeve t\u00eb pod\u00ebve. Si shkak p\u00ebr ndryshimin e numrit t\u00eb kopjeve, shumica e DevOps p\u00ebrdorin ngarkes\u00ebn n\u00eb CPU dhe memorie. Megjithat\u00eb, sistemi mund t\u00eb shkall\u00ebzohet bazuar n\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/kubernetes.io\/docs\/tasks\/run-application\/horizontal-pod-autoscale\/#support-for-custom-metrics\">metrika t\u00eb personalizuara<\/a><\/noindex>, kombinimin e tyre <noindex><a rel=\"nofollow\" href=\"https:\/\/kubernetes.io\/docs\/tasks\/run-application\/horizontal-pod-autoscale\/#support-for-multiple-metrics\">metrika t\u00eb jashtme<\/a><\/noindex> ose madje <noindex><a rel=\"nofollow\" href=\"https:\/\/cloud.google.com\/kubernetes-engine\/docs\/tutorials\/external-metrics-autoscaling\">Schema e nivelit t\u00eb lart\u00eb e pun\u00ebs s\u00eb HPA:<\/a><\/noindex>.<\/p>\n<p>HPA kontrollon vazhdimisht vlerat e metrikeve t\u00eb caktuara gjat\u00eb vendosjes, me nj\u00eb interval t\u00eb paracaktuar prej 30 sekondash.<\/p>\n<ol>\n<li>HPA p\u00ebrpiqet t\u00eb rris\u00eb numrin e moduleve n\u00ebse arrihet nj\u00eb kufi i caktuar.\n<\/li>\n<li>HPA p\u00ebrdit\u00ebson numrin e replikave brenda kontrolluesit t\u00eb implementimit\/replikimit.\n<\/li>\n<li>Kontrolluesi i implementimit\/replikimit pastaj implementon t\u00eb gjitha modul\u00ebt e nevojsh\u00ebm shtes\u00eb.\n<\/li>\n<li>HPA fillon procesin e implementimit t\u00eb moduleve me arritjen e vler\u00ebs s\u00eb kufirit t\u00eb metrikeve\n<\/li>\n<\/ol>\n<p>\n<img decoding=\"async\" alt=\"Tre nivele t\u00eb automatik\u00ebs n\u00eb Kubernetes: si t&#039;i p\u00ebrdorim ato n\u00eb m\u00ebnyr\u00eb efektive\" src=\"\/wp-content\/uploads\/2020\/01\/e98534431712eb3303668446b0fe567b.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Kur p\u00ebrdorni HPA, merrni parasysh sa vijon:<\/i><\/p>\n<p>Intervali i kontrollit t\u00eb HPA \u00ebsht\u00eb n\u00eb default 30 sekonda. Ky \u00ebsht\u00eb vendosur me flamurin<\/p>\n<ul>\n<li>horizontal-pod-autoscaler-sync-period <i>n\u00eb menaxherin e kontrolluesit.<\/i> Gabimi relativ n\u00eb default \u00ebsht\u00eb 10%.\n<\/li>\n<li>Pas rritjes s\u00eb fundit t\u00eb numrit t\u00eb moduleve, HPA pret stabilizimin e metrikeve p\u00ebr tre minuta. Ky interval \u00ebsht\u00eb vendosur me flamurin\n<\/li>\n<li>horizontal-pod-autoscaler-upscale-delay <i>Pas uljes s\u00eb fundit t\u00eb numrit t\u00eb moduleve, HPA pret stabilizimin p\u00ebr pes\u00eb minuta. Ky interval \u00ebsht\u00eb vendosur me flamurin<\/i>.\n<\/li>\n<li>horizontal-pod-autoscaler-downscale-delay <i>HPA funksionon m\u00eb mir\u00eb me objektet e implementimit dhe jo me kontrolluesit e replikimit. Automatizimi horizontal \u00ebsht\u00eb i papajtuesh\u00ebm me p\u00ebrdit\u00ebsimet e rregullta (rolling update) q\u00eb ndikojn\u00eb drejtp\u00ebrdrejt n\u00eb kontrolluesit e replikimit. Kur implementohet, numri i replikave varet drejtp\u00ebrdrejt nga objektet e implementimit.<\/i>.\n<\/li>\n<li>HPA funksionon m\u00eb mir\u00eb me objektet e shp\u00ebrndarjes, jo me kontrollor\u00ebt e replikimit. Autoskalimi horizontal \u00ebsht\u00eb n\u00eb kund\u00ebrshtim me p\u00ebrdit\u00ebsimin rresht, i cili manipulohet drejtp\u00ebrdrejt nga kontrollor\u00ebt e replikimit. Gjat\u00eb shp\u00ebrndarjes, numri i replikave varet drejtp\u00ebrdrejt nga objektet e shp\u00ebrndarjes.\n<\/li>\n<\/ul>\n<p><\/p>\n<h2>Shkall\u00ebzimi vertikal i pod\u00ebve<\/h2>\n<p>\nShkall\u00ebzimi vertikal (VPA) ndan m\u00eb shum\u00eb (ose m\u00eb pak) koh\u00eb procesori ose memorie p\u00ebr pod\u00ebt ekzistues. \u00cbsht\u00eb i p\u00ebrshtatsh\u00ebm p\u00ebr pod\u00ebt me ruajtje t\u00eb shtetit (stateful) ose pa t\u00eb (stateless), por kryesisht \u00ebsht\u00eb i destinuar p\u00ebr sh\u00ebrbimet stateful. Megjithat\u00eb, ju mund ta aplikoni VPA edhe p\u00ebr modul\u00ebt pa ruajtje t\u00eb shtetit, n\u00ebse nevojitet rregullimi automatik i burimeve fillimisht t\u00eb ndara. <\/p>\n<p>VPA gjithashtu reagon ndaj ngjarjeve OOM (out of memory, munges\u00eb memorie). P\u00ebr t\u00eb ndryshuar koh\u00ebn e procesorit dhe volumet e memories, k\u00ebrkohet rinisja e pod\u00ebve. Gjat\u00eb rinisjes, VPA respekton buxhetin e ndarjes (<noindex><a rel=\"nofollow\" href=\"https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/disruptions\/\">pods distribution budget, PDB<\/a><\/noindex>), p\u00ebr t\u00eb garantuar numrin minimal t\u00eb moduleve t\u00eb nevojsh\u00ebm. <\/p>\n<p>Mund t\u00eb vendosni nj\u00eb sasi minimale dhe maksimale burimesh p\u00ebr \u00e7do modul. Pra, \u00ebsht\u00eb e mundur t\u00eb kufizohet sasia maksimale e memories n\u00eb 8 GB. Kjo \u00ebsht\u00eb e dobishme n\u00ebse nodet aktuale sakt\u00ebsisht nuk mund t\u00eb ofrojn\u00eb m\u00eb shum\u00eb se 8 GB memorie p\u00ebr kontejnerin. Specifikimet e detajuara dhe mekanizmi i funksionimit jan\u00eb p\u00ebrshkruar n\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/kubernetes\/community\/blob\/master\/contributors\/design-proposals\/autoscaling\/vertical-pod-autoscaler.md\">wiki-n zyrtare t\u00eb VPA<\/a><\/noindex>.<\/p>\n<p>P\u00ebr m\u00eb tep\u00ebr, VPA ka nj\u00eb funksion interesant rekomandimesh (VPA Recommender). Ai monitoron p\u00ebrdorimin e burimeve dhe ngjarjet OOM t\u00eb t\u00eb gjith\u00eb moduleve, p\u00ebr t'u ofruar vlera t\u00eb reja p\u00ebr memorie dhe koh\u00ebn e procesorit bazuar n\u00eb nj\u00eb algorit\u00ebm inteligjent q\u00eb merr parasysh metrikat historike. Gjithashtu, ka nj\u00eb nd\u00ebrfaqe API q\u00eb merr nj\u00eb descriptor pod dhe kthen vlerat e rekomanduara p\u00ebr burimet.<\/p>\n<p>Duhet theksuar se VPA Recommender nuk monitoron \"limitin\" e burimeve. Kjo mund t\u00eb \u00e7oj\u00eb n\u00eb faktin q\u00eb moduli monopolizon burimet brenda nod\u00ebve. \u00cbsht\u00eb m\u00eb mir\u00eb t\u00eb vendosni nj\u00eb kufi n\u00eb nivelin e hap\u00ebsir\u00ebs em\u00ebrtuese, p\u00ebr t\u00eb shmangur shpenzime t\u00eb m\u00ebdha t\u00eb memories ose koh\u00ebs s\u00eb procesorit.<\/p>\n<p>Skema e pun\u00ebs s\u00eb VPA n\u00eb nivel t\u00eb lart\u00eb:<\/p>\n<ol>\n<li>VPA kontrollon vazhdimisht vlerat e metrikave t\u00eb specifikuara gjat\u00eb vendosjes, me nj\u00eb interval t\u00eb paracaktuar prej 10 sekondash.\n<\/li>\n<li>N\u00ebse arrihet threshold-i i caktuar, VPA p\u00ebrpiqet t\u00eb ndryshoj\u00eb sasin\u00eb e burimeve t\u00eb ndara.\n<\/li>\n<li>VPA p\u00ebrdit\u00ebson sasin\u00eb e burimeve brenda kontrolluesit t\u00eb shp\u00ebrndarjes\/replikimit.\n<\/li>\n<li>Kur moduli riniset, t\u00eb gjitha burimet e reja aplikohen n\u00eb instancat e krijuara.\n<\/li>\n<\/ol>\n<p>\n<img decoding=\"async\" alt=\"Tre nivele t\u00eb automatik\u00ebs n\u00eb Kubernetes: si t&#039;i p\u00ebrdorim ato n\u00eb m\u00ebnyr\u00eb efektive\" src=\"\/wp-content\/uploads\/2020\/01\/324702d5e36e9fcf45ced8b3f276db52.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>VPA shton sasin\u00eb e nevojshme t\u00eb burimeve <\/i><\/p>\n<p>Konsideroni k\u00ebto pika kur p\u00ebrdorni VPA:<\/p>\n<ul>\n<li>Shkall\u00ebzimi k\u00ebrkon rinisjen e domosdoshme t\u00eb pod\u00ebve. Kjo \u00ebsht\u00eb e nevojshme p\u00ebr t\u00eb shmangur funksionimin e paq\u00ebndruesh\u00ebm pas ndryshimeve. P\u00ebr besueshm\u00ebri, modul\u00ebt rinisin dhe shp\u00ebrndahen mbi nyje sipas burimeve t\u00eb reja t\u00eb ndara.\n<\/li>\n<li>VPA dhe HPA aktualisht nuk jan\u00eb t\u00eb pajtuesh\u00ebm me nj\u00ebri-tjetrin dhe nuk mund t\u00eb punojn\u00eb n\u00eb t\u00eb nj\u00ebjt\u00ebt pod\u00eb. N\u00ebse ju aplikoni t\u00eb dy mekanizmat e shkall\u00ebzimit n\u00eb t\u00eb nj\u00ebjtin klaster, sigurohuni q\u00eb konfigurimet t\u00eb mos lejojn\u00eb aktivizimin e tyre n\u00eb t\u00eb nj\u00ebjt\u00ebt objekte.\n<\/li>\n<li>VPA konfiguron k\u00ebrkesat e burimeve t\u00eb kontejner\u00ebve vet\u00ebm n\u00eb baz\u00eb t\u00eb p\u00ebrdorimit t\u00eb kaluar dhe aktual. Ai nuk vendos limite p\u00ebr p\u00ebrdorimin e burimeve. Mund t\u00eb ndodhin probleme me funksionimin e gabuar t\u00eb aplikacioneve, t\u00eb cilat do t\u00eb fillojn\u00eb t\u00eb konsumojn\u00eb gjithnj\u00eb e m\u00eb shum\u00eb burime, duke shkaktuar q\u00eb Kubernetes t\u00eb ndaloj\u00eb k\u00ebt\u00eb pod.\n<\/li>\n<li>VPA \u00ebsht\u00eb ende n\u00eb faz\u00ebn e hershme t\u00eb zhvillimit. B\u00ebni kujdes q\u00eb sistemi mund t\u00eb kaloj\u00eb disa ndryshime s\u00eb shpejti. Mund t\u00eb lexoni rreth <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/kubernetes\/autoscaler\/tree\/master\/vertical-pod-autoscaler#known-limitations-of-the-alpha-version\">kufizimeve t\u00eb njohura<\/a><\/noindex> dhe <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/kubernetes\/community\/blob\/master\/contributors\/design-proposals\/autoscaling\/vertical-pod-autoscaler.md#future-work\">planet e zhvillimit<\/a><\/noindex>. Ka plane p\u00ebr t\u00eb realizuar bashk\u00ebpunimin e VPA me HPA, si dhe p\u00ebr t\u00eb zhvilluar modul\u00ebt s\u00eb bashku me politik\u00ebn e shkall\u00ebzimit vertikal p\u00ebr ta (p.sh., nj\u00eb etiket\u00eb speciale 'requires VPA').\n<\/li>\n<\/ul>\n<p><\/p>\n<h2>Automatizimi i klasterit Kubernetes<\/h2>\n<p>\nAutomatizimi i klasterit (Cluster Autoscaler, CA) ndryshon numrin e nod\u00ebve, n\u00eb baz\u00eb t\u00eb numrit t\u00eb moduleve pod q\u00eb presin. Sistemi kontrollon periodikisht n\u00ebse ka module n\u00eb pritje \u2014 dhe rrit madh\u00ebsin\u00eb e klasterit n\u00ebse k\u00ebrkohen m\u00eb shum\u00eb burime dhe n\u00ebse klasteri nuk kalon kufijt\u00eb e vendosur. CA bashk\u00ebpunon me ofruesin e sh\u00ebrbimeve cloud, duke k\u00ebrkuar nod\u00eb t\u00eb tjera ose \u00e7liruar ato q\u00eb nuk jan\u00eb n\u00eb p\u00ebrdorim. Versioni i par\u00eb publik i CA u prezantua n\u00eb Kubernetes 1.8.<\/p>\n<p>Skema e pun\u00ebs s\u00eb CA n\u00eb nivel t\u00eb lart\u00eb:<\/p>\n<ol>\n<li>CA kontrollon n\u00ebse ka module n\u00eb pritje me nj\u00eb interval t\u00eb paracaktuar prej 10 sekondash.\n<\/li>\n<li>N\u00ebse nj\u00eb ose disa module jan\u00eb n\u00eb pritje p\u00ebr shkak se klasteri nuk ka burime t\u00eb mjaftueshme p\u00ebr t'i alokuar, ai p\u00ebrpiqet t\u00eb p\u00ebrgatis\u00eb nj\u00eb ose disa nod\u00eb t\u00eb tjera.\n<\/li>\n<li>Kur ofruesi i sh\u00ebrbimeve cloud ofron nodin e nevojsh\u00ebm, ai bashkohet me klasterin dhe \u00ebsht\u00eb gati t\u00eb sh\u00ebrbej\u00eb moduleve pod.\n<\/li>\n<li>Planifikuesi i Kubernetes shp\u00ebrndan module t\u00eb pritura n\u00eb nodet e reja. N\u00ebse pas k\u00ebsaj disa module ende mbeten n\u00eb pritje, procesi p\u00ebrs\u00ebritet \u2014 dhe nod\u00eb t\u00eb reja shtohen n\u00eb klaster.\n<\/li>\n<\/ol>\n<p>\n<img decoding=\"async\" alt=\"Tre nivele t\u00eb automatik\u00ebs n\u00eb Kubernetes: si t&#039;i p\u00ebrdorim ato n\u00eb m\u00ebnyr\u00eb efektive\" src=\"\/wp-content\/uploads\/2020\/01\/2cd3c97f5d1b040b813940a4e804365e.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Shp\u00ebrndarja automatike e nod\u00ebve t\u00eb klasterit n\u00eb cloud<\/i><\/p>\n<p>Konsideroni k\u00ebt\u00eb gjat\u00eb p\u00ebrdorimit t\u00eb CA:<\/p>\n<ul>\n<li>CA garanton q\u00eb t\u00eb gjitha modulet n\u00eb klaster kan\u00eb vend p\u00ebr t\u00eb funksionuar, pavar\u00ebsisht nga niveli i ngarkes\u00ebs s\u00eb procesorit. P\u00ebr m\u00eb tep\u00ebr, ai p\u00ebrpiqet t\u00eb siguroj\u00eb q\u00eb n\u00eb klaster nuk ka nod\u00eb t\u00eb panevojshme.\n<\/li>\n<li>CA regjistron nevoj\u00ebn p\u00ebr skalim rreth 30 sekonda.\n<\/li>\n<li>Pasi nj\u00eb nod b\u00ebhet i panevojsh\u00ebm, CA sipas parazgjedhjes pret 10 minuta para se t\u00eb ndryshoj\u00eb madh\u00ebsin\u00eb e sistemit.\n<\/li>\n<li>N\u00eb sistemin e automatizimit t\u00eb skalimit ekziston koncepti i zgjeruesve (expanders). K\u00ebto jan\u00eb strategji t\u00eb ndryshme p\u00ebr t\u00eb zgjedhur grupin e nod\u00ebve, n\u00eb t\u00eb cilin do t\u00eb shtohen t\u00eb reja.\n<\/li>\n<li>P\u00ebrdorni mund\u00ebsin\u00eb me p\u00ebrgjegj\u00ebsi <i>cluster-autoscaler.kubernetes.io\/safe-to-evict (true)<\/i>. N\u00ebse vendosni shum\u00eb pod\u00eb ose n\u00ebse shum\u00eb prej tyre shp\u00ebrndahen p\u00ebrmes t\u00eb gjitha nyjeve, do t\u00eb humbni ndjesh\u00ebm mund\u00ebsin\u00eb p\u00ebr t\u00eb zvog\u00ebluar shkall\u00ebn e klasterit.\n<\/li>\n<li>P\u00ebrdorni <noindex><a rel=\"nofollow\" href=\"https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/disruptions\/\">PodDisruptionBudgets<\/a><\/noindex>, p\u00ebr t\u00eb parandaluar eliminimin e pod\u00ebve, i cili mund t\u00eb \u00e7oj\u00eb n\u00eb d\u00ebshtimin e plot\u00eb t\u00eb nj\u00eb pjese t\u00eb aplikacionit tuaj.\n<\/li>\n<\/ul>\n<p><\/p>\n<h2>Si sistemet e autoskalimit Kubernetes nd\u00ebrveprojn\u00eb me nj\u00ebra-tjetr\u00ebn<\/h2>\n<p>\nP\u00ebr harmoni ideale, \u00ebsht\u00eb e nevojshme t\u00eb aplikoni shkall\u00ebzimin edhe n\u00eb nivelin e pod\u00ebve (HPA\/VPA), ashtu si dhe n\u00eb nivelin e klasterit. Ato nd\u00ebrveprojn\u00eb relativisht leht\u00ebsisht me nj\u00ebri-tjetrin:<\/p>\n<ol>\n<li>HPA ose VPA p\u00ebrdit\u00ebsojn\u00eb kopjet e pod\u00ebve ose burimet e ndara p\u00ebr pod\u00ebt ekzistues.\n<\/li>\n<li>N\u00ebse n\u00ebnyjt\u00eb e planifikuara p\u00ebr shkall\u00ebzim jan\u00eb t\u00eb pamjaftueshme, CA v\u00ebren se ka pod\u00eb n\u00eb pritje.\n<\/li>\n<li>CA ndan nyja t\u00eb reja.\n<\/li>\n<li>Modulet shp\u00ebrndahen mbi nyjat e reja.\n<\/li>\n<\/ol>\n<p>\n<img decoding=\"async\" alt=\"Tre nivele t\u00eb automatik\u00ebs n\u00eb Kubernetes: si t&#039;i p\u00ebrdorim ato n\u00eb m\u00ebnyr\u00eb efektive\" src=\"\/wp-content\/uploads\/2020\/01\/09379f30f349a235bb26a670ad0d0bfd.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Sistemi i p\u00ebrbashk\u00ebt i shkall\u00ebzimit Kubernetes<\/i><\/p>\n<h2>Gabimet tipike n\u00eb autoskalimin Kubernetes<\/h2>\n<p>\nEkzistojn\u00eb disa probleme tipike me t\u00eb cilat DevOps p\u00ebrballen kur p\u00ebrpiqen t\u00eb zbatojn\u00eb autoskalimin.<\/p>\n<p>HPA dhe VPA varen nga metrikat dhe disa t\u00eb dh\u00ebna historike. N\u00ebse resurseve u jan\u00eb dh\u00ebn\u00eb m\u00eb pak se sa nevojiten, modulet do t\u00eb zvog\u00eblohen dhe nuk do t\u00eb ken\u00eb mund\u00ebsi t\u00eb gjenerojn\u00eb metrika. N\u00eb k\u00ebt\u00eb rast, autoskalimi nuk do t\u00eb realizohet kurr\u00eb.<\/p>\n<p>Vet\u00eb operacioni i shkall\u00ebzimit \u00ebsht\u00eb i ndjesh\u00ebm ndaj koh\u00ebs. Ne duam q\u00eb modul\u00ebt dhe klasteri t\u00eb shkall\u00ebzohen shpejt \u2014 para se p\u00ebrdoruesit t\u00eb v\u00ebrejn\u00eb ndonj\u00eb problem apo d\u00ebshtim. Prandaj, duhet t\u00eb merret parasysh koha mesatare e shkall\u00ebzimit t\u00eb pod\u00ebve dhe klasterit.<\/p>\n<p>Scenari ideal \u00ebsht\u00eb 4 minuta:<\/p>\n<ol>\n<li>30 sekonda. Rind\u00ebrtimi i metrikave t\u00eb synuara: 30-60 sekonda.\n<\/li>\n<li>30 sekonda. HPA kontrollon vlerat e metrikave: 30 sekonda.\n<\/li>\n<li>M\u00eb pak se 2 sekonda. Modulet pod krijohen dhe kalojn\u00eb n\u00eb gjendje pritjeje: 1 sekond\u00eb.\n<\/li>\n<li>M\u00eb pak se 2 sekonda. CA sheh modulet n\u00eb pritje dhe d\u00ebrgon thirrjet p\u00ebr p\u00ebrgatitjen e nyjave: 1 sekond\u00eb.\n<\/li>\n<li>3 minuta. Ofruesi i cloud-it ndan nyja. K8s pret q\u00eb ato t\u00eb jen\u00eb gati: deri n\u00eb 10 minuta (varet nga disa faktor\u00eb).\n<\/li>\n<\/ol>\n<p>\nScenari m\u00eb i keq (m\u00eb realist) \u00ebsht\u00eb 12 minuta:<\/p>\n<ol>\n<li>30 sekonda. Rind\u00ebrtimi i metrikave t\u00eb synuara.\n<\/li>\n<li>30 sekonda. HPA kontrollon vlerat e metrikave.\n<\/li>\n<li>M\u00eb pak se 2 sekonda. Modulet pod krijohen dhe kalojn\u00eb n\u00eb gjendje pritjeje.\n<\/li>\n<li>M\u00eb pak se 2 sekonda. CA sheh modulet n\u00eb pritje dhe d\u00ebrgon thirrjet p\u00ebr p\u00ebrgatitjen e nyjave.\n<\/li>\n<li>10 minuta. Ofruesi i cloud-it ndan nyja. K8s pret q\u00eb ato t\u00eb jen\u00eb gati. Koha e pritjes varet nga disa faktor\u00eb, si vonesa e ofruesit, vonesa e OS, funksionimi i mjeteve ndihm\u00ebse.\n<\/li>\n<\/ol>\n<p>\nMos i ngat\u00ebrroni mekanizmat e zgjerimit t\u00eb ofruesve t\u00eb mjeteve cloud me CA-n\u00eb ton\u00eb. E fundit punon brenda nj\u00eb klasteri Kubernetes, nd\u00ebrsa mekanizmi i ofruesit t\u00eb mjeteve cloud funksionon n\u00eb baz\u00eb t\u00eb shp\u00ebrndarjes s\u00eb nyjeve. Ai nuk di se \u00e7far\u00eb ndodh me pod&#8217;et tuaj ose aplikacionin. K\u00ebto sisteme punojn\u00eb paralelisht. <\/p>\n<h2>Si t\u00eb menaxhoni shkall\u00ebzimin n\u00eb Kubernetes<\/h2>\n<p><\/p>\n<ol>\n<li>Kubernetes \u00ebsht\u00eb nj\u00eb mjet p\u00ebr menaxhimin e burimeve dhe orkestrimin. Operacionet p\u00ebr menaxhimin e pod&#8217;eve dhe burimeve t\u00eb klasterit jan\u00eb nj\u00eb shk\u00ebputje kryesore n\u00eb zot\u00ebrimin e Kubernetes.\n<\/li>\n<li>Merrni parasysh logjik\u00ebn e zgjerueshm\u00ebris\u00eb s\u00eb pod&#8217;eve duke marr\u00eb parasysh HPA-n\u00eb dhe VPA-n\u00eb.\n<\/li>\n<li>CA duhet t\u00eb p\u00ebrdoret vet\u00ebm n\u00ebse kuptoni mir\u00eb nevojat e pod&#8217;eve dhe konteiner\u00ebve tuaj.\n<\/li>\n<li>P\u00ebr nj\u00eb konfigurim optimal t\u00eb klasterit, duhet t\u00eb kuptoni si funksionojn\u00eb s\u00eb bashku sistemet e ndryshme t\u00eb shkall\u00ebzimit.\n<\/li>\n<li>Kur vler\u00ebsoni koh\u00ebn e shkall\u00ebzimit, kini parasysh skenar\u00ebt m\u00eb t\u00eb keq dhe m\u00eb t\u00eb mir\u00eb.\n<\/li>\n<\/ol>\n<p>Burimi: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/484344\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u044f Kubernetes \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432: \u043f\u043e \u0441\u043b\u043e\u0432\u0430\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u044d\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 Kubernetes. \u041c\u044b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u043e\u0431\u0437\u043e\u0440 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438, \u043a\u0430\u043a \u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0421\u0442\u0430\u0442\u044c\u044e Kubernetes Autoscaling 101: Cluster Autoscaler, Horizontal Autoscaler, and Vertical Pod Autoscaler \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430, [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-55712","post","type-post","status-publish","format-standard","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e.\" \/>\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\/tri-urovnya-avtomasshtabirovaniya-v-kubernetes-kak-ih-effektivno-ispolzovat\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.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\u0422\u0440\u0438 \u0443\u0440\u043e\u0432\u043d\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 Kubernetes: \u043a\u0430\u043a \u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/tri-urovnya-avtomasshtabirovaniya-v-kubernetes-kak-ih-effektivno-ispolzovat\" \/>\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-01-26T21:00:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-02-18T11:03:51+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\udd47Tre nivelet e autoskalimit n\u00eb Kubernetes: si t\u2019i p\u00ebrdorni ato n\u00eb m\u00ebnyr\u00eb efektive | ProHoster","description":"P\u00ebr t\u00eb kompletuar.","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/tri-urovnya-avtomasshtabirovaniya-v-kubernetes-kak-ih-effektivno-ispolzovat","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\u0422\u0440\u0438 \u0443\u0440\u043e\u0432\u043d\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 Kubernetes: \u043a\u0430\u043a \u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c | ProHoster","og:description":"\u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e.","og:url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/tri-urovnya-avtomasshtabirovaniya-v-kubernetes-kak-ih-effektivno-ispolzovat","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-01-26T21:00:00+00:00","article:modified_time":"2020-02-18T11:03:51+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"55712","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 19:38:31","updated":"2022-09-29 14:33:55","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\/55712","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=55712"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/55712\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=55712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=55712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=55712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}