youkan | 技術共有会
コンテナ化されたアプリケーションの デプロイ、スケーリング、管理を自動化する オープンソースのプラットフォーム
┌─────────────────────────────────────────┐ │ Control Plane │ │ ┌──────────┐ ┌──────────┐ ┌─────────┐ │ │ │ API Server│ │ Scheduler│ │ etcd │ │ │ └──────────┘ └──────────┘ └─────────┘ │ └─────────────────────────────────────────┘ │ ┌────────▼────────┐ ┌────────────────────┐ │ Node 1 │ │ Node 2 │ │ ┌──────────┐ │ │ ┌──────────┐ │ │ │ kubelet │ │ │ │ kubelet │ │ │ └──────────┘ │ │ └──────────┘ │ │ ┌────┐ ┌────┐ │ │ ┌────┐ ┌────┐ │ │ │ Pod│ │ Pod│ │ │ │ Pod│ │ Pod│ │ │ └────┘ └────┘ │ │ └────┘ └────┘ │ └─────────────────┘ └────────────────────┘
apiVersion: v1 kind: Pod metadata: name: my-pod spec: containers: - name: nginx image: nginx:latest ports: - containerPort: 80
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: replicas: 3 selector: matchLabels: app: nginx template: # Pod template...
apiVersion: v1 kind: Service metadata: name: nginx-service spec: selector: app: nginx ports: - port: 80 targetPort: 80 type: ClusterIP
# クラスター情報 kubectl cluster-info kubectl get nodes # リソース操作 kubectl get pods kubectl describe pod <name> kubectl logs <pod-name> # 適用・削除 kubectl apply -f manifest.yaml kubectl delete -f manifest.yaml # デバッグ kubectl exec -it <pod> -- /bin/sh
まずはminikubeで触ってみよう!
Kubernetesの世界へようこそ!
@youkan