Managed k8s Services
- Google Kubernetes Engine
- Amazon EKS
- Azure Kubernetes Service
- Oracle Container Service
- IBM Cloud Kubernetes Service
- etc.
// login
$ gcloud auth login
// set project
$ gcloud config set project
// set credential
$ gcloud container clusters get-credentials --zone=asia-northeast1-a
Connecting GKE Cluster
gcloudのcliを使用して認証情報を取得します。
Slide 28
Slide 28 text
Connecting GKE Cluster 2
とりあえず、つなげているか確認してみましょう
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
gke-prod-my-cluster-default-pool-55afabbf-5483 Ready 3d v1.10.4-gke.0
gke-prod-my-cluster-default-pool-55afabbf-75pl Ready 3d v1.10.4-gke.0
gke-prod-my-cluster-default-pool-55afabbf-z6nm Ready 3d v1.10.4-gke.0
Connect to EKS Cluster 3
$ export KUBECONFIG=$KUBECONFIG:~/.kube/my-eks-config
$ kubectl get nodes
No resources found // まだワーカーが認識されていない
クラスターのコンフィグを使ってみる
https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html
$ kubectl get svc -n my-space
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-docker-go NodePort 10.59.248.225 80:32337/TCP 10m
$ kubectl get ing -n my-space
NAME HOSTS ADDRESS PORTS AGE
hello-docker-go * 35.xxx.yyy.zzz 80 10m
GKE 確認
なんか作られない・・・
$ kubectl describe svc hello-docker-go -n my-space
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal EnsuringLoadBalancer 6s (x2 over 11s) service-controller Ensuring load balancer
Warning CreatingLoadBalancerFailed 6s (x2 over 11s) service-controller Error creating load balancer (will retry): failed to ensure load
balancer for service my-space/hello-docker-go: could not find any suitable subnets for creating the ELB