$30 off During Our Annual Pro Sale. View Details »

自作 Controller による Secret の配布と収集 / Distributing ...

Takayuki Kasai
September 27, 2019

自作 Controller による Secret の配布と収集 / Distributing and collecting secrets with self-made controller

Kubernetes Meetup Tokyo #23

Takayuki Kasai

September 27, 2019
Tweet

More Decks by Takayuki Kasai

Other Decks in Programming

Transcript

  1. ©2019 Wantedly, Inc. ࣗ࡞ Controller ʹΑΔ Secret ͷ഑෍ͱऩू Kubernetes Meetup

    Tokyo #23 Takayuki Kasai (@unblee) Wantedly, Inc. 2019.9.27 -
  2. ©2019 Wantedly, Inc. w 4FDSFUͷ഑෍ w શͯͷ/BNFTQBDFʹڞ௨͢Δ4FDSFUΛઃఆ͍ͨ͠ w XBOUFEMZLOTLFM ӡ༻্ͷ՝୊

    w 4FDSFUͷऩू w ෳ਺/BNFTQBDFͷ4FDSFUΛͭͷ/BNFTQBDFʹू໿͍ͨ͠ w XBOUFEMZSJHHFS
  3. ©2019 Wantedly, Inc. w 4FDSFUͷ഑෍ w શͯͷ/BNFTQBDFʹڞ௨͢Δ4FDSFUΛઃఆ͍ͨ͠ w XBOUFEMZLOTLFM ӡ༻্ͷ՝୊

    w 4FDSFUͷऩू w ෳ਺/BNFTQBDFͷ4FDSFUΛͭͷ/BNFTQBDFʹू໿͍ͨ͠ w XBOUFEMZSJHHFS
  4. ©2019 Wantedly, Inc. 4FDSFUͷ഑෍ w શͯͷ/BNFTQBDFʹڞ௨ͯ͠ઃఆͯ͠ཉ͍͠4FDSFU͕͋Δ w JNBHF1VMM4FDSFU EEBHFOUUPLFO FUD

    w /BNFTQBDFΛ࡞Δͨͼʹઃఆ͢Δͷ͸໘౗ w 4FDSFUΛ௥Ճมߋ࡟আͨ͠Βطଘͷ/BNFTQBDFʹ΋൓өͯ͠΄͍͠ ˠXBOUFEMZLOTLFMͱ͍͏$POUSPMMFSΛ࡞੒ͨ͠ w DMJFOUHP࣮૷ w ࡞੒ͨ͠ͷ͸Կ΋ແ͔ͬͨ೥લɹࠓͳΒ1PE1SFTFUΛ࢖͏
  5. ©2019 Wantedly, Inc. w 4FDSFUͷ഑෍ w શͯͷ/BNFTQBDFʹڞ௨͢Δ4FDSFUΛઃఆ͍ͨ͠ w XBOUFEMZLOTLFM ӡ༻্ͷ՝୊

    w 4FDSFUͷऩू w ෳ਺/BNFTQBDFͷ4FDSFUΛͭͷ/BNFTQBDFʹू໿͍ͨ͠ w XBOUFEMZSJHHFS
  6. ©2019 Wantedly, Inc. എܠ"SHPͷಋೖ templates: - name: alpine container: image:

    alpine command: - job-A - name: ubuntu container: image: ubuntu command: - job-Z - name: argo-workflow dag: tasks: - name: alpine-job-A template: alpine - name: ubuntu-job-Z dependencies: [alpine-job-A] template: ubuntu "SHP8PSLqPXϑΝΠϧͷྫ ʢؔ܎ͳ͍෦෼͸লུʣ
  7. ©2019 Wantedly, Inc. 4FDSFUͷऩूϞνϕʔγϣϯ "SHP8PSLqPXͷઃܭͱ8BOUFEMZͷӡ༻ϧʔϧͷ૬ੑ͕ѱ͍ w /BNFTQBDF.JDSPTFSWJDFͱ͍͏ӡ༻ϧʔϧ w ֤.JDSPTFSWJDFͷ؀ڥม਺͸֤/BNFTQBDFͷઐ༻4FDSFUͰ؅ཧ͞Ε͍ͯΔ w

    ͭͷ8PSLqPX͕ෳ਺ͷ.JDSPTFSWJDFͰߏ੒͞ΕΔ͜ͱ͕͋Δ w 8PSLqPXʹؚ·ΕΔ֤εςοϓ͸શͯͭͷ/BNFTQBDF಺Ͱ࣮ߦ͞ΕΔ w ֤εςοϓͰඞཁͳ؀ڥม਺͕ผͷ/BNFTQBDFʹ͋ͬͯಡΈࠐΊͳ͍ ෳ਺.JDSPTFSWJDFͷ4FDSFUΛͭͷ/BNFTQBDFʹू໿͢Δඞཁੑ
  8. ©2019 Wantedly, Inc. 4FDSFUͷऩूͲ͏΍͔ͬͨ w ,VCFCVJMEFSW BMQIB Ͱ࣮૷ͨ͠$3%$POUSPMMFS w ಛఆͷ໊લʹҰக͢Δ4FDSFUΛશͯͷ/BNFTQBDF͔Βऩू͠


    ࢦఆͨ͠/BNFTQBDF΁ෳ੡ɾಉظ͢Δ w ର৅ͷ4FDSFUͷ஋͕௥Ճߋ৽࡟আ͞Εͨͱ͖͸
 ෳ੡ͨ͠4FDSFUʹ΋ࣗಈతʹ൓ө͢Δ XBOUFEMZSJHHFS
  9. ©2019 Wantedly, Inc. 4FDSFUͷऩूͲ͏΍͔ͬͨ apiVersion: rigger.k8s.wantedly.com/v1beta1 kind: Plan metadata: name:

    plan-sample spec: syncTargetSecretName: env syncDestNamespace: sync-dest XBOUFEMZSJHHFS w 1MBO3FTPVSDFͰઃఆ͢Δ w TZOD5BSHFU4FDSFU/BNF w ෳ੡ݩͷ4FDSFU໊ w TZOD%FTU/BNFTQBDF w ෳ੡ઌͷ/BNFTQBDF໊