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

Kubernetes動かしてみた

 Kubernetes動かしてみた

2019/1/27の、相模原 Docker&Kubernetes MeetUpでの発表資料です。Kubernetesに付いて、pod、serviceの起動といった基本的な部分を説明しています。

hashimotosyuta

January 27, 2019
Tweet

More Decks by hashimotosyuta

Other Decks in Technology

Transcript

  1. 4 橋本 修太 • openSUSE ユーザ会で主に活動中 • その他、小江戸 LUG などの LUG

    に出没 • 最近は途上国関連のイベントにも参加 Twitter @syuta_openSUSE FB: syutah 海に出よう >
  2. 15 Pod & Service •Service pod へのアクセスを制御 pod は Kubernetes

    が自動生成し たりするので、 IP が変わってしま う。そこで Service が一元管理
  3. 18 Pod を作成してみよう apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment

    labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 実際の yaml ファイル
  4. 20 Pod を作成してみよう 情報取得 $ kubectl get deployment $ kubectl

    get replicaset $ kubectl get pod 詳細情報取得 $ kubectl describe deployment/nginx-test
  5. 21 Pod を作成してみよう pod (コンテナ)のログ取得 $ kubectl logs 【 pod

    名】 pod (コンテナ)に入る $kubectl exec -it 【 pod 名】 bash
  6. 24 Service を作成してみよう apiVersion: v1 kind: Service metadata: name: nginx-nodeport

    spec: type: NodePort ports: - port: 80 protocol: TCP targetPort: 80 selector: app: nginx 実際の yaml ファイル
  7. General Disclaimer This document is not to be construed as

    a promise by any participating organisation to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. openSUSE makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for openSUSE products remains at the sole discretion of openSUSE. Further, openSUSE reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All openSUSE marks referenced in this presentation are trademarks or registered trademarks of SUSE LLC, in the United States and other countries. All third-party trademarks are the property of their respective owners. License This slide deck is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license. It can be shared and adapted for any purpose (even commercially) as long as Attribution is given and any derivative work is distributed under the same license. Details can be found at https://creativecommons.org/licenses/by-sa/4.0/ Credits Template Richard Brown [email protected] Design & Inspiration openSUSE Design Team http://opensuse.github.io/branding- guidelines/