Upgrade to Pro — share decks privately, control downloads, hide ads and more …

kubectl apply の仕組み / How kubectl apply works

kubectl apply の仕組み / How kubectl apply works

Kubernetes Meetup Tokyo #5
2017.06.27
https://k8sjp.connpass.com/event/56945/

Takashi Kusumi

June 26, 2017
Tweet

More Decks by Takashi Kusumi

Other Decks in Technology

Transcript

  1. LVCFDUMBQQMZהכ Ӝ ؔـآؙؑزָ㶷㖈׃זֽ׸ל⡲䧭 1045 ծ㶷㖈ׅ׸ל䊴ⴓ 1"5$) ׾⿾僥׃גֻ׸׷⤑ⵃז؟ـ؝وٝس وصؿؑأزח״׷㹑鎉涸 EFDMBSBUJWF ז盖椚ָ〳腉

    Ӝ ⽃秪ז♳剅ֹדכזֻծ䊴ⴓ⿾僥ד֮׷ֿהח岣䠐 LVCFDUMSFQMBDFכ⽃秪ז♳剅ֹ 165  Ӝ 䊴ⴓכLVCFDUM⩎ד鎘皾ׁ׸׷ 
  2. ➭ך؟ـ؝وٝسהך麩ְ  ؟ـ؝وٝس ؔـآؙؑزָ㶷㖈׃זְ ؔـآؙؑزָ㶷㖈ׅ׷ BQQMZ 倜鋉⡲䧭 1045 䊴ⴓ⿾僥 1"5$)

    ˟ DSFBUF 倜鋉⡲䧭 1045 ⚠ؒٓ٦ SFQMBDF ⚠ؒٓ٦ ♳剅ֹ 165 QBUDI ⚠ؒٓ٦ 䊴ⴓ⿾僥 1"5$) EFMFUF ⚠ؒٓ٦ ⵴ꤐ %&-&5& ˟QSVOF׾⢪׏׋㜥さ%&-&5&׮֮׶䖤׷
  3. 㹑鎉涸 EFDMBSBUJWF ؔـآؙؑز盖椚 Ӝ BQQMZח״׶وصؿؑأز纇 㹑鎉 ׌ֽח״׷盖椚ָדֹ׷ Ӝ ؔـآؙؑزך⿾僥כLVCFDUMBQQMZGDPOH׌ֽ Ӝ

    QSVOF׾⢪ִל⵴ꤐ׮荈⹛ד遤ִ׷ BMQIB堣腉  Ӝ 鑫稢כⰕ䒭سًُؗٝز׾⿫撑 ,VCFSOFUFT0CKFDU.BOBHFNFOU  ZBNM
  4. ㉏겗ٖفٔؕ侧כוֲז׷   apiVersion: extensions/v1beta1 kind: Deployment metadata: name: myapp1

    spec: # レプリカ数を指定しない template: metadata: labels: run: myapp1 spec: containers: - image: nginx name: myapp1
  5. ㉏겗ٖفٔؕ侧כוֲז׷   apiVersion: extensions/v1beta1 kind: Deployment metadata: name: myapp2

    spec: replicas: 3 # レプリカ数を指定 template: metadata: labels: run: myapp2 spec: containers: - image: nginx name: myapp2
  6. ػحثה׃ג鷏⥋ׁ׸׷  { "metadata": { "annotations": { "kubectl.kubernetes.io/last-applied-configuration": "..." }

    }, "spec": { "replicas": null } } curl -XPATCH -H "Content-Type: application/strategic-merge-patch+json" ... https://.../apis/extensions/v1beta1/namespaces/default/deployments/myapp https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md