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

Rancher 2.0 HA with Terraform

Rancher 2.0 HA with Terraform

2018/5/18 東京で行われたRancher 2.0リリースパーティでのLT資料。
TerraformとTerraform RKEプロバイダを用いてRancher 2.0をHA構成にする方法を紹介。

Kazumichi Yamamoto

May 18, 2018
Tweet

More Decks by Kazumichi Yamamoto

Other Decks in Technology

Transcript

  1. 3BODIFS.FFUVQ5PLZP
    !ZBNBNPUP@GFCD
    3BODIFS ͷ)"ߏ੒
    XJUI5FSSBGPN
    &

    View full-size slide

  2. ,B[VNJDIJ :BNBNPUP
    !ZBNBNPUP@GFCD

    8IP

    View full-size slide

  3. 3BODIFSͷΠϯετʔϧ
    $ docker run -d -p 80:80 –p 443:443 rancher/rancher
    EPDLFSSVO͚ͩͰ0,

    View full-size slide

  4. ຊ൪ӡ༻ͷ৔߹͸ʁ
    ྲྀੴʹ୆ͩͱෆ҆ʜ

    View full-size slide

  5. )"ߏ੒
    )JHI"WBJMBCJMJUZ

    View full-size slide

  6. )"ߏ੒ͷྫ
    IUUQTSBODIFSDPNEPDTSBODIFSWYFOJOTUBMMBUJPOIBTFSWFSJOTUBMM
    ,VCFSOFUFT্ʹ
    3BODIFSΛσϓϩΠ
    ϩʔυόϥϯα
    *OHSFTTͰ44-ऴ୺

    View full-size slide

  7. ,VCFSOFUFTΫϥελΛ
    Ͳ͏΍ͬͯ༻ҙ͢Δʁ

    View full-size slide

  8. 0WFSWJFX
    44)
    1SPWJTJPOJOH

    View full-size slide

  9. 3,&ͷৄࡉ͸ҎԼΛࢀর
    IUUQTTQFBLFSEFDLDPNZBNBNPUPGFCDCVJMEJOHIBLVCFSOFUFTDMVTUFSTXJUISLF

    View full-size slide

  10. )"ߏ੒ͰͷΠϯετʔϧ

    ϊʔυͷ४උ

    %/4ͷઃఆ

    -#ͷઃఆ

    3,&ͰLTߏங

    3BODIFSͷσϓϩΠ
    3,&ͷΠϯετʔϧ
    ఆٛϑΝΠϧͷ࡞੒
    DMVTUFSZNM

    lSLF VQz࣮ߦ

    View full-size slide

  11. )"ߏ੒ͰͷΠϯετʔϧ

    ϊʔυͷ४උ

    %/4ͷઃఆ

    -#ͷઃఆ

    3,&ͰLTߏங

    3BODIFSͷσϓϩΠ
    3,&ͷΠϯετʔϧ
    ఆٛϑΝΠϧͷ࡞੒
    DMVTUFSZNM

    lSLF VQz࣮ߦ

    View full-size slide

  12. 5FSSBGPSNͰϊʔυ౳ͷ४උ
    ˙%JHJUBM0DFBOͷ৔߹

    View full-size slide

  13. 5FSSBGPSNͰϊʔυ౳ͷ४උ
    ˙͘͞ΒͷΫϥ΢υͷ৔߹

    View full-size slide

  14. )"ߏ੒ͰͷΠϯετʔϧ

    ϊʔυͷ४උ

    %/4ͷઃఆ

    -#ͷઃఆ

    3,&ͰLTߏங

    3BODIFSͷσϓϩΠ
    3,&ͷΠϯετʔϧ
    ఆٛϑΝΠϧͷ࡞੒
    DMVTUFSZNM

    lSLF VQz࣮ߦ



    View full-size slide

  15. )"ߏ੒ͰͷΠϯετʔϧ

    ϊʔυͷ४උ

    %/4ͷઃఆ

    -#ͷઃఆ

    3,&ͰLTߏங

    3BODIFSͷσϓϩΠ
    3,&ͷΠϯετʔϧ
    ఆٛϑΝΠϧͷ࡞੒
    DMVTUFSZNM

    lSLF VQz࣮ߦ



    View full-size slide

  16. n %PXOMPBE3,&CJOBSZ
    *OTUBMM3,&
    $ curl -L -o rke $RKE_URL
    n 3VODINPE
    $ chmod +x rke
    3,&@63-IUUQTHJUIVCDPNSBODIFSSLFSFMFBTFTEPXOMPBEWSLF@EBSXJOBNE

    View full-size slide

  17. DMVTUFSZNMͷ࡞੒
    node:
    - address: <ϊʔυͷ*1ΞυϨε>
    role: [etcd, controlplane, worker]
    user: rancher
    ssh_key_path: <44)༻ͷൿີ伴>
    5FSSBGPSNͷ࣮ߦ݁ՌͳͲ͔Β
    ϊʔυͷ৘ใΛίϐϖ

    View full-size slide

  18. 3VOlSLF VQz
    $ ./rke up --config cluster.yml

    View full-size slide

  19. DMVTUFSZNMͷ࡞੒
    node:
    - address: <ϊʔυͷ*1ΞυϨε>
    role: [etcd, controlplane, worker]
    user: rancher
    ssh_key_path: <44)༻ͷൿີ伴>
    ϊʔυ࡞੒ͷ౎౓*1ΞυϨε͕
    มΘͬͨΓ͢Δͱ໘౗ʜ

    View full-size slide

  20. 5FSSBGPSNQSPWJEFSGPS3,&
    IUUQTXXXUFSSBGPSNJPEPDTQSPWJEFSTUZQFDPNNVOJUZJOEFYIUNM

    View full-size slide

  21. 5FSSBGPSNQSPWJEFSGPS3,&
    5FSSBGPSN3,&Λ౷߹

    View full-size slide

  22. 5FSSBGPSNQSPWJEFSGPS3,&
    $POGJHϑΝΠϧग़ྗ
    GPS LVCFDUM

    LVCFSOFUFTϓϩμΠόʔͱ
    ࿈ܞͤ͞Δ͜ͱ΋Մೳ
    IUUQTHJUIVCDPNZBNBNPUPGFCDUFSSBGPSNQSPWJEFSSLF

    View full-size slide

  23. )"ߏ੒ͰͷΠϯετʔϧ

    ϊʔυͷ४උ

    %/4ͷઃఆ

    -#ͷઃఆ

    3,&ͰLTߏங

    3BODIFSͷσϓϩΠ




    View full-size slide

  24. )"ߏ੒ͰͷΠϯετʔϧ

    ϊʔυͷ४උ

    %/4ͷઃఆ

    -#ͷઃఆ

    3,&ͰLTߏங

    3BODIFSͷσϓϩΠ




    View full-size slide

  25. 3BODIFSαʔόͷσϓϩΠ
    ͓޷͖ͳํ๏ΛͲ͏ͧʂ
    LVCFDUM ౳
    3,&ͷΞυΦϯ
    5FSSBGPSNͷ
    LTϓϩόΠμ

    View full-size slide

  26. ࣮ࡍ࢖ͬͯΔํ๏
    DFSUNBOBHFSͱ3BODIFSΛซ༻
    ˙*TTVFS ˙*OHSFTT
    3BODIFSαʔό༻ͷূ໌ॻͷऔಘߋ৽͸
    DFSUNBOBHFSʹ͓೚ͤ͢Δ

    View full-size slide

  27. ·ͱΊ
    LT্ʹσϓϩΠ͢Ε͹0,
    खܰʹLTΫϥελΛ࡞ΕΔ
    5FSSBGPSN
    3BODIFSͷ)"
    3,&
    ϊʔυ΍%/4-#ͷ࡞੒ɺ
    3,&ͰͷΫϥελߏஙΛ
    ·ͱΊͯѻ͑Δ

    View full-size slide