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

Kubernetes Handson Osaka

stormcat24
January 31, 2019

Kubernetes Handson Osaka

Docker/Kubernetes 実践コンテナ開発入門 Japan Tour 2019 in Osaka

stormcat24

January 31, 2019
Tweet

More Decks by stormcat24

Other Decks in Programming

Transcript

  1. PVUMJOF ‣ NJOͳͥࠓ,VCFSOFUFTΛ΍Δͷ͔ ‣ NJO-PDBMͰ͍͍ײ͡ͷ,VCFSOFUFT։ൃ؀ڥΛଗ͑Δ ‣ NJO,VCFSOFUFTͷجຊతͳϦιʔεɺΞϓϦέʔγϣϯͷσϓϩΠ ‣ NJOٳܜ ‣

    NJO)FMNͰΞϓϦέʔγϣϯΛύοέʔδϯά͢Δ ‣ NJOTLBGGPMEͰ͍͍ײ͡ʹ։ൃΛճͯ͠ΈΔ ‣ NJOͦͷଞϢʔεέʔεɺศརπʔϧ঺հ ‣ ࢒Γ༧උ࣌ؒɾ࣭ٙλΠϜ
  2. 1PE

  3. 1PEͷϚχϑΣετϑΝΠϧ BQJ7FSTJPOW LJOE1PE NFUBEBUB OBNFTJNQMFFDIP TQFD DPOUBJOFST OBNFOHJOY JNBHFHJIZPEPDLFSOHJOYQSPYZMBUFTU FOW

    OBNF#"$,&/%@)045 WBMVFMPDBMIPTU QPSUT DPOUBJOFS1PSU OBNFFDIP JNBHFHJIZPEPDLFSFDIPMBUFTU QPSUT DPOUBJOFS1PSU
  4. 3FQMJDB4FUͷϚχϑΣετϑΝΠϧ BQJ7FSTJPOBQQTW LJOE3FQMJDB4FU NFUBEBUB OBNFTJNQMFFDIP MBCFMT BQQFDIP TQFD SFQMJDBT TFMFDUPS

    NBUDI-BCFMT BQQFDIP UFNQMBUF NFUBEBUB MBCFMT BQQFDIP TQFD DPOUBJOFST OBNFOHJOY JNBHFHJIZPEPDLFSOHJOYMBUFTU FOW OBNF#"$,&/%@)045 WBMVFMPDBMIPTU QPSUT DPOUBJOFS1PSU OBNFFDIP JNBHFHJIZPEPDLFSFDIP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BQQTLVTUPNJ[FUFTUDSFBUFE Ұؾʹ࡟আ LVTUPNJ[FCVJMETLB⒎PMELVTUPNJ[FcLVCFDUMEFMFUFG
  14. )1"ͷϚχϑΣετ apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: name: echo spec: scaleTargetRef:

    apiVersion: apps/v1 kind: Deployment name: echo minReplicas: 1 maxReplicas: 3 metrics: - type: Resource resource: name: cpu targetAverageUtilization: 40