Kev siv ConfigMap hauv Kubernetes yog dab tsi?
Kev siv ConfigMap hauv Kubernetes yog dab tsi?

Video: Kev siv ConfigMap hauv Kubernetes yog dab tsi?

Video: Kev siv ConfigMap hauv Kubernetes yog dab tsi?
Video: 26 - Использование ConfigMap и переменных окружения в Kubernetes 2024, Kaum ib hlis
Anonim

Cov ConfigMap API cov peev txheej muab cov txheej txheem los txhaj cov ntim nrog cov ntaub ntawv teeb tsa thaum khaws cov ntim tsis raug cai Kubernetes . ConfigMap ua tau siv khaws cov ntaub ntawv zoo xws li cov khoom ntiag tug lossis cov ntaub ntawv ntxhib xws li tag nrho cov ntaub ntawv teeb tsa lossis JSON blobs.

Raws li, ConfigMap yog dab tsi hauv Kubernetes?

A ConfigMap yog ib phau ntawv txhais lus ntawm kev teeb tsa. Cov phau ntawv txhais lus no muaj cov ntsiab lus tseem ceeb ntawm cov hlua. Kubernetes muab cov txiaj ntsig no rau koj cov ntim khoom. Zoo li nrog rau lwm cov phau ntawv txhais lus (daim duab qhia chaw, hashes,) tus yuam sij cia koj tau txais thiab teeb tsa tus nqi.

Ib sab saum toj no, Kuv yuav teeb tsa ib puag ncig hloov pauv hauv Kubernetes li cas? Thaum koj tsim Pod, koj tuaj yeem ua tau teem ib puag ncig variables rau cov thawv uas khiav hauv Pod. Rau teem ib puag ncig variables , suav nrog env lossis envFrom teb hauv cov ntaub ntawv teeb tsa. Hauv koj lub plhaub, khiav cov lus txib printenv los sau cov ib puag ncig hloov pauv . Txhawm rau tawm ntawm lub plhaub, nkag mus tawm.

Ntawm no, kuv yuav tsim ConfigMap hauv Kubernetes li cas?

  1. Koj yuav tsum muaj Kubernetes pawg, thiab cov cuab yeej kubectl hais kom ua kab yuav tsum tau teeb tsa kom sib txuas lus nrog koj pawg.
  2. Siv kubectl tsim configmap hais kom ua los tsim ConfigMaps los ntawm cov npe, cov ntaub ntawv, lossis cov txiaj ntsig zoo:
  3. Koj tuaj yeem siv kubectl piav qhia lossis kubectl tau txais cov ntaub ntawv hais txog ConfigMap.

Dab tsi yog zais hauv Kubernetes?

Kev tshaj tawm. zais cia tuaj yeem txhais raws li Kubernetes cov khoom siv los khaws cov ntaub ntawv rhiab xws li tus neeg siv lub npe thiab tus password nrog encryption. Muaj ntau txoj hauv kev tsim secrets hauv Kubernetes.

Pom zoo: