Kubectl : Add healthcheck using TCP targetting https, do not terminate SSL on ELB for AWS

1/29/2020

I am working on a Kubernetes application in which we are running a nginx server. There are 2 issues we are facing currently,

one is related to healthchecks. I would like to add healthchecks which check for the container on port-443, but with TCP, Kubernetes is somehow doing that on SSL, causing the containers to show out of service by AWS.

Secondly, SSL Traffic is getting terminated on ELB, while still talking with container on port-443. I have added a self-signed certificate on the container inside nginx already. We redirect from http to https internally, so anything on port-80 is of no use to us. What am I doing wrong?

service.yaml :

apiVersion: v1
kind: Service
metadata:
  labels:
    app.kubernetes.io/name: service-name
    app.kubernetes.io/instance: service-name-instance
    app.kubernetes.io/version: "1.0.0"
    app.kubernetes.io/component: backend
    app.kubernetes.io/managed-by: kubectl
  annotations:
      # Note that the backend talks over HTTP.
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: https
       # TODO: Fill in with the ARN of your certificate.
    service.beta.kubernetes.io/aws-load-balancer-ssl-cert: OUR ARN
       # Only run SSL on the port named "https" below.
    service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "TCP"
    service.beta.kubernetes.io/do-loadbalancer-redirect-http-to-https: "true"
    service.beta.kubernetes.io/do-loadbalancer-tls-ports: "443"
  name: service-name

spec:
  selector:
    app: service-name
  type: LoadBalancer
  ports:
  - name: http
    port: 80
    targetPort: 80
  - name: https
    port: 443
    targetPort: 443
-- We are Borg
amazon-web-services
kubernetes
ssl

0 Answers