<p>I've deployed a series of deployments and services to a Kubernetes cluster with a load balancer. When I try to access my app this does not work as my application is exposed on port 80 but the URL is always redirected to port 443 (HTTPS). I suspect this is to do with the fact that the cluster IP is on port 443.</p>

<p>Any ideas on how I can fix this?</p>

<pre><code>db           NodePort       10.245.175.203   &lt;none&gt;           5432:30029/TCP   25m
kubernetes   ClusterIP      10.245.0.1       &lt;none&gt;           443/TCP          8m
redis        NodePort       10.245.197.157   &lt;none&gt;           6379:31277/TCP   25m
web          LoadBalancer   10.245.126.122   123.12.123.123   80:31430/TCP     25m
</code></pre>

Rutnet
<p>This is likely due to your application itself redirecting to port <code>443</code>.  What type of application is it?</p>

<p>This service exposed on port <code>443</code> has nothing to do with your application:</p>

<pre><code>kubernetes   ClusterIP      10.245.0.1       &lt;none&gt;           443/TCP          8m
</code></pre>

<p>It's basically an internal service that allows you to access the kube-apiserver within your cluster.</p>

<p>You could try just setting up the <code>LoadBalancer</code> to listen on port <code>443</code> directly. Only you would have to port <code>80</code> traffic wouldn't work. If you want the port <code>80</code> redirects to work I suggest you use an <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer"><code>Ingress</code></a> controller like <a href="https://github.com/kubernetes/ingress-nginx" rel="nofollow noreferrer">nginx</a>. Something like this:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: your-ingress
  annotations:
     nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
spec:
  tls:
  - hosts:
    - yourhostname.com
    secretName: tls-secret
  rules:
  - host: yourhostname.com
    http:
      paths:
      - path: /
        backend:
          serviceName: web
          servicePort: 443
</code></pre>

<p>You will also have to create a TLS secret holding your cert and key:</p>

<pre><code>$ kubectl create secret tls tls-secret --key /tmp/tls.key --cert /tmp/tls.crt
</code></pre>
