Skip to content

Latest commit

 

History

History
54 lines (50 loc) · 1.24 KB

14.Test-Loadbalancer-type.md

File metadata and controls

54 lines (50 loc) · 1.24 KB

Test LoadBalancer

  • Create an nginx deployment
kubectl run nginx --image=nginx --port=80
  • Expose it as LoadBalancer
kubectl expose deployment nginx --type=LoadBalancer
  • Note down service external IP
kubectl get svc
  • Output
NAME         TYPE           CLUSTER-IP        EXTERNAL-IP     PORT(S)        AGE
kubernetes   ClusterIP      172.168.0.1       <none>          443/TCP        14h
nginx        LoadBalancer   172.168.171.249   192.168.78.50   80:32057/TCP   4s
  • Access nginx using loadbalncer external IP
$ curl 192.168.78.50
  • Output
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

Part 15 - Deploy Metric Server