In some cases, we have Services that get no response when trying to access them. Eg Chrome shows ERR_EMPTY_RESPONSE, and occasionally we get other errors as well, like 408, which I'm fairly sure is returned from the ELB, not our application itself.
After a long involved investigation, including ssh'ing into the nodes themselves, experimenting with load balancers and more, we are still unsure at which layer the problem actually exists: either in Kubernetes itself, or in the backing services from Amazon EKS (ELB or otherwise)
What else could cause behaviour like this?
The EKS service sets up and manages the Kubernetes control plane for you. Kubernetes is used to automate the deployment, scaling, and management of your container-based applications. EKS maintains resilience for the Kubernetes control plane by replicating it across multiple Availability Zones.
A Kubernetes service is a logical abstraction for a deployed group of pods in a cluster (which all perform the same function). Since pods are ephemeral, a service enables a group of pods, which provide specific functions (web services, image processing, etc.) to be assigned a name and unique IP address (clusterIP).
Provision the EKS cluster This process should take approximately 10 minutes. Upon completion, Terraform will print your configuration's outputs.
After much investigation, we were fighting a number of issues:
* Our application didn't always behave the way we were expecting. Always check that first.
* In our Kubernetes Service manifest, we had set the externalTrafficPolicy: Local
, which probably should work, but was causing us problems. (This was with using Classic Load Balancer) service.beta.kubernetes.io/aws-load-balancer-type: "clb"
. So if you have problems with CLB, either remove the externalTrafficPolicy
or explicitly set it to the default "Cluster" value.
So our manifest is now:
kind: Service
apiVersion: v1
metadata:
name: apollo-service
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: "clb"
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:REDACTED"
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "http"
spec:
externalTrafficPolicy: Cluster
selector:
app: apollo
ports:
- name: http
protocol: TCP
port: 80
targetPort: 80
- name: https
protocol: TCP
port: 443
targetPort: 80
type: LoadBalancer
adding
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "http"
Fixed this for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With