Mais conteúdo relacionado
Semelhante a Google Container Engine と Kubernetes で 無理をしないコンテナ管理 (20)
Google Container Engine と Kubernetes で 無理をしないコンテナ管理
- 8. 8
● Master:クラスタを管理
○ GKEでは表示されない
● Minion:Dockerが起動するノード
● Pod:コンテナのグループ
● Replication Controller:起動するPod数
や環境変数を管理(Replica Sets)
● Service:Pod郡のエンドポイント
Node1
Minion1
RC1 Pod1-1
Pod1-2
Pod2-1
Pod2-2
Service1 Service2
Kubernetesの構成
- 9. 9
apiVersion: v1
kind: ReplicationController
metadata:
name: abema-xxx
spec:
replicas: 4 ←起動するPodの数
selector:
name: abema-xxx
template:
metadata:
labels:
name: abema-xxx
environment: dev
spec:
containers:
- name: abema-xxx ↓環境変数
env:
- name: ENV
value: development
- name: REDIS_ADDR
value: redis-a:6379,redis-b:6379,redis-c:6379
image: asia.gcr.io/[projectid]/abema-xxx:v1.1.0
ports: ↑起動するDockerイメージとタグ
- containerPort: 30500
protocol: TCP
initialDelaySeconds: 15
timeoutSeconds: 5
apiVersion: v1
kind: Service
metadata:
name: abema-xxx
labels:
name: abema-xxx
spec:
selector:
name: abema-xxx
ports:
- port: 8484 ↓Pod郡にアクセスするためのポート
nodePort: 30200
protocol: TCP
name: http
type: NodePort
ReplicationController.yaml Service.yaml
- 10. 10
GKE at AbemaTV
● ホストOS : Debian GNU/Linux 7
● Kubernetes v1.2.0
● Docker 1.9.1
● ベースイメージ : Alpine Linux, Ubuntu