400 Bad Request The plain HTTP request was sent to HTTPS port when deploying Harbor behind NLB

141 views Asked by At

We are planning to deploy NLB to access Harbor deployed on EKS.. We have deployed AWS load balancer controller on the cluster. Below is my values file

harbor:
  expose:
    type: loadBalancer
    tls:
      enabled: true
      auto:
        commonName: "xxx"
    loadBalancer:
      name: harbor-dev
      annotations:
        "service.beta.kubernetes.io/aws-load-balancer-type": "nlb-ip"
        "service.beta.kubernetes.io/aws-load-balancer-nlb-target-type": "instance"
        "service.beta.kubernetes.io/aws-load-balancer-subnets": "xxx"
        "service.beta.kubernetes.io/aws-load-balancer-healthcheck-port": "traffic-port"
        "service.beta.kubernetes.io/aws-load-balancer-healthcheck-success-codes": "200-399"
        "service.beta.kubernetes.io/aws-load-balancer-target-group-attributes": "preserve_client_ip.enabled=true"
        "service.beta.kubernetes.io/aws-load-balancer-internal": "true"
        "service.beta.kubernetes.io/aws-load-balancer-ssl-cert": "xxx"
        "external-dns.alpha.kubernetes.io/hostname": "https://harbor-dev.xxx"
        "external-dns.alpha.kubernetes.io/ttl": "300"
  externalURL: https://harbor-dev.xxx
  persistence:
    enabled: true
    resourcePolicy: keep
  nginx:
    tls:
      enabled: true

Deployment seems successful but when i am trying to access Harbor, i am getting the below error :

400 Bad Request The plain HTTP request was sent to HTTPS port

Methods tried to resolve the error :

I tried updating the helm chart such that the load balancer service targetport point to 8080 (or) http but no luck

Also i tried updating the HTTPS target group manually point to 8080 but i am getting the error like "Too many redirects"

So i want to know if anyone has used this particular approach to deploy Harbor behind NLB and faced such issues

Working solution :

I have tried deploying Harbor behind ALB using ingress which is working fine, but i want to provide the access for other AWS accounts running for which i want to deploy NLB so that i can have VPC endpoint service to expose.

0

There are 0 answers