Cov txheej txheem:

Kubectl nthuav tawm ua dab tsi?
Kubectl nthuav tawm ua dab tsi?

Video: Kubectl nthuav tawm ua dab tsi?

Video: Kubectl nthuav tawm ua dab tsi?
Video: Nkauj Tawm Tshiab. Vim Dab Tsi By Qhua Hawj 2024, Kaum ib hlis
Anonim

A Kubernetes Kev pabcuam yog txheej txheej abstraction uas txhais cov txheej txheem ntawm Pods thiab ua rau muaj kev cuam tshuam rau sab nraud, thauj khoom sib npaug thiab kev pabcuam nrhiav pom rau cov Pods.

Hauv qhov no, koj yuav nthuav tawm cov kev pabcuam Kubernetes li cas?

Tsim ib qho Kev Pabcuam kom nthuav tawm koj qhov kev xa tawm

  1. Hauv nplooj ntawv nthuav dav, nyem Expose.
  2. Hauv lub thawv tshiab chaw nres nkoj, teeb chaw nres nkoj rau 80, thiab teeb lub hom phiaj chaw nres nkoj rau 8080.
  3. Los ntawm Kev Pabcuam hom drop-down ntawv qhia zaub mov, xaiv Pawg IP.
  4. Rau Kev Pabcuam npe, sau kuv-cip-service.
  5. Nyem Expose.

Tsis tas li ntawd, 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.

Yog li, kuv yuav nkag mus rau Kubernetes kev pabcuam sab nraud li cas?

Nkag mus rau cov kev pabcuam los ntawm pej xeem IPs

  1. Siv cov kev pabcuam nrog hom NodePort lossis LoadBalancer los ua kom cov kev pabcuam ncav cuag sab nraud pawg.
  2. Nyob ntawm koj qhov chaw ib puag ncig, qhov no tsuas yog nthuav tawm cov kev pabcuam rau koj lub tuam txhab network, lossis nws tuaj yeem nthuav tawm hauv Is Taws Nem.
  3. Muab cov pods tom qab kev pabcuam.

Kuv yuav nkag mus rau ClusterIP li cas?

Mus txog qhov ClusterIp los ntawm lub khoos phis tawj sab nraud, koj tuaj yeem qhib Kubernetes npe ntawm lub khoos phis tawj sab nraud thiab pawg. Koj tuaj yeem siv kubectl los tsim cov npe zoo li no. Thaum lub npe sawv cev, koj txuas ncaj qha rau pawg, thiab koj tuaj yeem siv tus IP sab hauv ( ClusterIp ) rau qhov Service.

Pom zoo: