-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy path_expose-external-lb.html.md.erb
63 lines (44 loc) · 2.32 KB
/
_expose-external-lb.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
1. Confirm that the Kubernetes service configuration of the workload is set to `type: LoadBalancer`.
1. Confirm that the `type` property of the Kubernetes service for each workload is similarly configured.
<p class='note'><strong>Note</strong>: For an example of a fully configured Kubernetes service, see the <a href="https://github.com/cloudfoundry-incubator/kubo-ci/blob/master/specs/nginx-lb.yml"><code>type: LoadBalancer</code> configuration</a> for the nginx app example in the kubo-ci repository in GitHub.</p>
For more information about configuring the `LoadBalancer` Service type see
[Type LoadBalancer](https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) in the _Service_ section of the Kubernetes documentation.
<br>
### <a id='external-lb-deploy'></a>Deploy and Expose Your Workload
To deploy and expose your workload:
1. To deploy the service configuration for your workload:
```
kubectl apply -f SERVICE-CONFIG
```
Where `SERVICE-CONFIG` is your workload's Kubernetes service configuration.
<br>
For example:
```console
$ kubectl apply -f nginx.yml
```
This command creates three pod replicas, spanning three worker nodes.
1. Deploy your applications, deployments, ConfigMaps, persistent volumes, secrets,
and any other configurations or objects necessary for your applications to run.
1. Wait until your cloud provider has created and connected a dedicated load balancer to the worker nodes on a specific port.
<br>
### <a id='external-lb-access'></a>Access Your Workload
To access a workload:
1. To determine the load balancer IP address and port number of your exposed workload, run the following command:
```
kubectl get svc SERVICE-NAME
```
Where `SERVICE-NAME` is the specified service `name` of your workload configuration.
<br>
For example:
```console
$ kubectl get svc nginx
```
1. Retrieve the external IP address and port of the load balancer from the returned listing.
1. To access the app, run the following command:
```
curl http://EXTERNAL-IP:PORT
```
Where:
* `EXTERNAL-IP` is the IP address of the load balancer.
* `PORT` is the port number.
<p class='note'><strong>Note</strong>: Run this command on a server with network connectivity and visibility to the IP address of the worker node.</p>