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

Kubernetes入門

 Kubernetes入門

社内勉強会での発表資料です。

2019/04/19 内容を更新

Kyohei Mizumoto

January 24, 2019
Tweet

More Decks by Kyohei Mizumoto

Other Decks in Technology

Transcript

  1. 2019/4/19 Kubernetes⼊⾨ 127.0.0.1:5500/#65 58/66 Pod apiVersion: v1 kind: Pod metadata:

    name: sample-pod spec: containers: - name: nginx-container image: nginx:1.12
  2. 2019/4/19 Kubernetes⼊⾨ 127.0.0.1:5500/#65 59/66 ReplicaSet apiVersion: apps/v1 kind: ReplicaSet metadata:

    name: sample-rs spec: replicas: 3 selector: matchLabels: app: sample-app template: metadata: labels: app: sample-app spec: containers: - name: nginx-container image: nginx:1.12 ports: - containerPort: 80
  3. 2019/4/19 Kubernetes⼊⾨ 127.0.0.1:5500/#65 60/66 Deployment apiVersion: apps/v1 kind: Deployment metadata:

    name: sample-deployment spec: replicas: 3 selector: matchLabels: app: sample-app template: metadata: labels: app: sample-app spec: containers: - name: nginx-container image: nginx:1.12 ports: - containerPort: 80
  4. 2019/4/19 Kubernetes⼊⾨ 127.0.0.1:5500/#65 61/66 Job apiVersion: batch/v1 kind: Job metadata:

    name: sample-job spec: completions: 1 parallelism: 1 backoffLimit: 10 template: spec: containers: - name: sleep-container image: centos:6 command: ["sleep"] args: ["60"] restartPolicy: Never
  5. 2019/4/19 Kubernetes⼊⾨ 127.0.0.1:5500/#65 62/66 Secret apiVersion: v1 kind: Pod metadata:

    name: sample-secret-single-env spec: containers: - name: secret-container image: nginx:1.12 env: - name: DB_USERNAME valueFrom: secretKeyRef: name: sample-db-auth key: username