<p><strong>Update #2:</strong>
I have checked the health status of my instances within the auto scaling group - here the instances are titled as &quot;healthy&quot;.  (Screenshot added)</p>
<p>I followed <a href="https://docs.aws.amazon.com/de_de/elasticloadbalancing/latest/classic/ts-elb-healthcheck.html#ts-elb-healthcheck-autoscaling" rel="nofollow noreferrer">this trouble-shooting tutorial</a> from AWS - without success:</p>
<blockquote>
<p><strong>Solution</strong>: Use the ELB health check for your Auto Scaling group. When you use the ELB health check, Auto Scaling determines the health status of your instances by checking the results of both the instance status check and the ELB health check. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-add-elb-healthcheck.html" rel="nofollow noreferrer">Adding health checks to your Auto Scaling group</a> in the <em>Amazon EC2 Auto Scaling User Guide</em>.</p>
</blockquote>
<hr />
<p><strong>Update #1:</strong>
I found out that the two Node-Instances are &quot;OutOfService&quot; (as seen in the screenshots below) because they are failing the Healtcheck from the loadbalancer - could this be the problem? And how do i solve it?</p>
<p>Thanks!</p>
<hr />
<p>I am currently on the home stretch to host my ShinyApp on AWS.</p>
<p>To make the hosting scalable, I decided to use AWS - more precisely an EKS cluster.</p>
<p>For the creation I followed this tutorial: <a href="https://github.com/z0ph/ShinyProxyOnEKS" rel="nofollow noreferrer">https://github.com/z0ph/ShinyProxyOnEKS</a></p>
<p>So far everything worked, except for the last step: &quot;When accessing the load balancer address and port, the login interface of ShinyProxy can be displayed normally.</p>
<p>The load balancer gives me the following error message as soon as I try to call it with the corresponding port: <strong>ERR_EMPTY_RESPONSE.</strong></p>
<p>I have to admit that I am currently a bit lost and lack a starting point where the error could be.</p>
<p>I was already able to host the Shiny sample application in the cluster (step 3.2 in the tutorial), so it must be somehow due to shinyproxy, kubernetes proxy or the loadbalancer itself.</p>
<p>I link you to the following information below:</p>
<ul>
<li>Overview EC2 Instances (Workspace + Cluster Nodes)</li>
<li>Overview Loadbalancer</li>
<li>Overview Repositories</li>
<li>Dockerfile ShinyProxy</li>
<li>Dockerfile Kubernetes Proxy</li>
<li>Dockerfile ShinyApp (sample application)</li>
</ul>
<p>I have painted over some of the information to be on the safe side - if there is anything important, please let me know.</p>
<p>If you need anything else I haven't thought of, just give me a hint!</p>
<p>And please excuse the confusing question and formatting - I just don't know how to word / present it better. sorry!</p>
<p>Many thanks and best regards</p>
<hr />
<p><strong>Overview EC2 Instances (Workspace + Cluster Nodes)</strong></p>
<p><a href="https://i.stack.imgur.com/54Hst.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/54Hst.png" alt="enter image description here" /></a></p>
<p><strong>Overview Loadbalancer</strong></p>
<p><a href="https://i.stack.imgur.com/yd72j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yd72j.png" alt="enter image description here" /></a>
<a href="https://i.stack.imgur.com/IF1Hq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IF1Hq.png" alt="enter image description here" /></a></p>
<p><strong>Overview Repositories</strong></p>
<p><a href="https://i.stack.imgur.com/9nd41.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9nd41.png" alt="enter image description here" /></a></p>
<p><strong>Dockerfile ShinyProxy (source <a href="https://github.com/openanalytics/shinyproxy-config-examples/tree/master/03-containerized-kubernetes" rel="nofollow noreferrer">https://github.com/openanalytics/shinyproxy-config-examples/tree/master/03-containerized-kubernetes</a>)</strong></p>
<p><a href="https://i.stack.imgur.com/lKhG3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lKhG3.png" alt="enter image description here" /></a></p>
<p><strong>Dockerfile Kubernetes Proxy (source <a href="https://github.com/openanalytics/shinyproxy-config-examples/tree/master/03-containerized-kubernetes" rel="nofollow noreferrer">https://github.com/openanalytics/shinyproxy-config-examples/tree/master/03-containerized-kubernetes</a> - Fork)</strong></p>
<p><a href="https://i.stack.imgur.com/q7ZIz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q7ZIz.png" alt="enter image description here" /></a></p>
<p><strong>Dockerfile ShinyApp (sample application)</strong></p>
<p><a href="https://i.stack.imgur.com/yNunz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yNunz.png" alt="enter image description here" /></a>
<a href="https://i.stack.imgur.com/DvC8T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DvC8T.png" alt="enter image description here" /></a></p>
<p><strong>The following files are 1:1 from the tutorial:</strong></p>
<ol>
<li>application.yaml (shinyproxy)</li>
<li>sp-authorization.yaml</li>
<li>sp-deployment.yaml</li>
<li>sp-service.yaml</li>
</ol>
<p><strong>Health-Status in the AutoScaling-Group</strong></p>
<p><a href="https://i.stack.imgur.com/Pca5V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pca5V.png" alt="enter image description here" /></a></p>

<p>Unfortunately, there is a known issue in <code>AWS</code></p>
<p><a href="https://github.com/kubernetes/kubernetes/issues/80579" rel="nofollow noreferrer">externalTrafficPolicy: Local with Type: LoadBalancer AWS NLB health checks failing · Issue #80579 · kubernetes/kubernetes</a></p>
<blockquote>
<p>Closing this for now since it's a known issue</p>
</blockquote>
<p>As per <a href="https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip" rel="nofollow noreferrer"><code>k8s</code> manual</a>:</p>
<blockquote>
<p><code>.spec.externalTrafficPolicy</code> - denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. There are two available options: <code>Cluster</code> (default) and <code>Local</code>. <code>Cluster</code> obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading. <code>Local</code> preserves the client source IP and avoids a second hop for LoadBalancer and NodePort type Services, but risks potentially imbalanced traffic spreading.</p>
</blockquote>
<p>But you may try to fix local protocol like <a href="https://stackoverflow.com/a/58001933/5720818">in this answer</a></p>
<p><a href="https://github.com/kubernetes/kubernetes/issues/80579" rel="nofollow noreferrer">Upd:</a></p>
<p>This is actually a known limitation where the AWS cloud provider does not allow for <code>--hostname-override</code>, see <a href="https://github.com/kubernetes/kubernetes/issues/54482" rel="nofollow noreferrer">#54482</a> for more details.</p>
<p>Upd 2: There is a workaround via patching <code>kube-proxy</code>:</p>
<p>As per <a href="https://aws.amazon.com/premiumsupport/knowledge-center/eks-troubleshoot-unhealthy-targets-nlb/" rel="nofollow noreferrer">AWS KB</a></p>
<blockquote>
<p>A Network Load Balancer with the <a href="https://github.com/kubernetes/kubernetes/issues/61486" rel="nofollow noreferrer">externalTrafficPolicy is set to Local</a> (from the Kubernetes website), with a custom Amazon VPC DNS on the DHCP options set. To resolve this issue, patch kube-proxy with the hostname override flag.</p>
</blockquote>
