# Aws Troubleshooting

## Elastic Load Balancer (ELB) Shows No Active Instances

In AWS, under Load Balancing > Load Balancers, there is an ELB which shows no active instances in service.

### Worker ELB

A worker ELB is automatically provisioned as part of the PMK cluster deployment.

<figure><img src="/files/4bIHHDuMmAZdV16R54wJ" alt=""><figcaption></figcaption></figure>

### Application ELB

A `Service` exposed as type `LoadBalancer` has a provisioned ELB address recoded as the `EXTERNAL-IP` , but, the service is not reachable on the exposed port.

{% tabs %}
{% tab title="Bash" %}

```bash
❯ kubectl expose deployment/nginx-deployment --type LoadBalancer
service/nginx-deployment exposed

❯ kubectl get svc
NAME               TYPE           CLUSTER-IP    EXTERNAL-IP  										 PORT(S)        AGE
nginx-deployment   LoadBalancer   10.21.2.126   01.us-east-1.elb.amazonaws.com   80:30097/TCP   8m52s
```

{% endtab %}
{% endtabs %}

<figure><img src="/files/OUwNcyp2wMbnfvV8V8ZJ" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="Bash" %}

```bash
❯ curl http://ae525eef2197748d481f8ac143c834c7-288527440.us-east-1.elb.amazonaws.com
curl: (52) Empty reply from server
```

{% endtab %}
{% endtabs %}

To resolve this, you must add the `HealthCheckNodePort` along with the `NodePort` allocated for the `Service` as allowed `Inbound` TCP rules to the worker SG from the K8s ELB SG.

<figure><img src="/files/V1j7yYe5bXXuxweGKzVM" alt=""><figcaption></figcaption></figure>

Afterward, you should see 1 or more instances in service (depending on the # of nodes in the cluster).

<figure><img src="/files/SxKutsKcqKVr8a7MRlJX" alt=""><figcaption></figcaption></figure>

## NodePort Service Isn't Externally Reachable

A `Service` type of `NodePort` isn't reachable via the Service FQDN for the cluster, nor the associated worker ELB address.

{% tabs %}
{% tab title="Bash" %}

```bash
❯ curl -v http://wrk-aws-demo-cluster-f11e6c3e-577138328.us-east-1.elb.amazonaws.com
*   Trying 23.20.211.239...
* TCP_NODELAY set
* Connected to wrk-aws-demo-cluster-f11e6c3e-577138328.us-east-1.elb.amazonaws.com (23.20.211.239) port 80 (#0)
> GET / HTTP/1.1
> Host: wrk-aws-demo-cluster-f11e6c3e-577138328.us-east-1.elb.amazonaws.com
> User-Agent: curl/7.64.1
> Accept: */*
>
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.platform9.com/managed-kubernetes/5.7/troubleshooting/aws-troubleshooting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
