docker
kubernetes
docker-compose
dockerformac
kompose

docker edge for macでkubernetesお試し

$ wget https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
$ kubectl apply -f kubernetes-dashboard.yaml --record
$ kubectl proxy --address 0.0.0.0 --accept-hosts '.*' &
$ open http://localhost:8001/
  • komposeインストール
$ brew install kompose
  • docker-compose.yml変換
$ cat docker-compose.yml
version: '3'
services:
  app:
    image: nginx
    ports:
     - 8000:80

$ kompose convert
INFO Kubernetes file "app-service.yaml" created
INFO Kubernetes file "app-deployment.yaml" created
  • service.yamlのspecにtype追加
    • Ingress通すならNodePortになるのかも
$ vim 
+  type: LoadBalancer
  • kubernetesにデプロイ
$ kompose up
  • service起動
$ kubectl apply -f app-service.yaml --record
  • 疎通確認
$ kubectl describe svc app
$ open localhost:31874