Dab tsi yog ClusterIP hauv Kubernetes?
Dab tsi yog ClusterIP hauv Kubernetes?

Video: Dab tsi yog ClusterIP hauv Kubernetes?

Video: Dab tsi yog ClusterIP hauv Kubernetes?
Video: Объяснение сервисов Kubernetes | ClusterIP против NodePort против LoadBalancer против Headless Service 2024, Kaum ib hlis
Anonim

ClusterIP : ClusterIP yog lub neej ntawd kubernets kev pabcuam. Qhov kev pabcuam no yog tsim hauv pawg thiab tsuas yog nkag tau los ntawm lwm cov pods hauv pawg ntawd. Yog li qhov pib peb siv hom kev pabcuam no thaum peb xav nthuav tawm cov kev pabcuam rau lwm cov pods hauv tib pawg. Qhov kev pabcuam no yog siv tau kubernets npe.

Kuj paub yog, Kubernetes ClusterIP ua haujlwm li cas?

A ClusterIP yog tus IP nkag mus tau rau sab hauv Kubernetes pawg thiab tag nrho cov kev pabcuam hauv nws. Rau NodePort, a ClusterIP yog tsim ua ntej thiab tom qab ntawd tag nrho cov tsheb thauj khoom sib npaug ntawm qhov chaw nres nkoj. Qhov kev thov raug xa mus rau ib qho ntawm Pods ntawm TCP chaw nres nkoj teev los ntawm lub hom phiajPort teb.

Tsis tas li ntawd, qhov kev pabcuam spec hauv Kubernetes yog dab tsi? Kev tshaj tawm. A kev pabcuam tuaj yeem txhais tau tias yog ib qho laj thawj ntawm cov pods. Nws tuaj yeem txhais tau tias yog kev paub daws teeb meem nyob rau sab saum toj ntawm cov pods uas muab ib qho chaw nyob IP thiab DNS npe los ntawm cov pods tuaj yeem nkag mus. Nrog Kev pabcuam , nws yog ib qho yooj yim heev los tswj load balancing configuration. Nws pab pods kom scale yooj yim heev.

Raws li, qhov txawv ntawm NodePort thiab ClusterIP yog dab tsi?

Dab tsi yog qhov Qhov sib txawv ntawm ClusterIP , NodePort thiab LoadBalancer hom kev pabcuam hauv Kubernetes? NodePort : Tshaj tawm cov kev pabcuam ntawm txhua Node tus IP ntawm qhov chaw nres nkoj zoo li qub (tus NodePort ). A ClusterIP service, uas NodePort kev pab cuam yuav txoj kev, yog cia li tsim.

Dab tsi yog kev siv pawg IP hauv Kubernetes?

Qhov kev qhia tshwj xeeb no tsim cov khoom siv tshiab hu ua "kuv-kev pabcuam", uas yog lub hom phiaj TCP chaw nres nkoj 9376 ntawm ib qho Pod nrog lub app = MyApp daim ntawv lo. Kubernetes muab qhov Service no IP chaw nyob (qee zaum hu ua " pawg IP ”), uas yog siv los ntawm Service proxies (saib Virtual IPs thiab cov kev pabcuam hauv qab no).

Pom zoo: