如果直接使用 kubernetes 的线上版本进行调试,需要资源太多了。使用 minikube 有时候又无法启动集群。 因此,开发者可以考虑使用 Kind 来部署测试 Kubernetes。
This article is about using Kind to create a Kubernetes (K8s) cluster and debug it.
By default, Kind does not support load balancers. If you want to test your apps, use NodePort or ClusterIP instead.
Source code: svtter/example-code-for-kind.
Using NodePort to View Service
Get the node’s IP to visit:
| |
View the service IP:
| |
Now, use curl -L http://172.18.0.2:30160 to visit the Nginx service.
Using LoadBalancer
- Install cloud-provider-kind via this loadbalancer.
- Start Kind, unlabel the node, and start
cloud-provider-kindaccording to this link.