<p>Why is default load balancer port 80 and 443 is considered as TCP ports? I want to test stickiness as shown in the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#sticky-sessions" rel="nofollow noreferrer">aws docs</a> either through yaml file or through aws console.</p>
<p>I was using nginx ingress and moved to default load balancer to test stickiness but I see the error <code>Stickiness options not available for TCP protocols</code></p>
<p><a href="https://i.stack.imgur.com/0mt0A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0mt0A.png" alt="enter image description here" /></a></p>
<p>I even tried specifying protocol <code>https</code> but it doesn't accept. It only allows  <code>&quot;SCTP&quot;, &quot;TCP&quot;, &quot;UDP&quot;</code>.</p>
<pre><code>    apiVersion: v1
    kind: Service
    metadata:
      name: httpd
      labels:
        app: httpd-service
      namespace: test-web-dev
   spec:
     #type: LoadBalancer
      selector:
        app: httpd
      ports:
        - name: port-80
          port: 80
          targetPort: 80
        - name: port-443
          port: 443
          targetPort: 443
        - name: port-1234
          port: 1234
          protocol: TCP
          targetPort: 1234
</code></pre>
<p>When I try ingress, I disable the service type <code>Loadbalancer</code> above</p>
<p><code>nginx-ingress-lb-service.yml</code>:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: tcp-services
  namespace: ingress-nginx
data:
  1234: &quot;test-web-dev/httpd:1234&quot;
---
kind: Service
apiVersion: v1
metadata:
  name: ingress-nginx
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
spec:
  externalTrafficPolicy: Local
  type: LoadBalancer
  selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
  ports:
    - name: http
      port: 80
      protocol: TCP
      targetPort: http
    - name: https
      port: 443
      protocol: TCP
      targetPort: https
    - name: port-1234
      port: 1234
      protocol: TCP
      targetPort: 1234

---
</code></pre>

user630702
<p>Stickiness requires listener which operates in <strong>layer 7</strong> of <a href="https://en.wikipedia.org/wiki/OSI_model" rel="nofollow noreferrer">OSI model</a>, which in case of CLB, is provided by <code>http</code> and <code>https</code> listeners.</p>
<p>Since you are using <code>TCP</code> listener which operates in <strong>layer 3</strong>, stickiness is not supported. Thus, if you want to use sticky sessions, you <strong>must change to</strong> <code>http</code> or <code>https</code> listeners.</p>
<p><code>UDP</code> and <code>SCTP</code> are invalid listeners for CLB. It only supports <code>TCP</code>, <code>HTTP</code>, <code>HTTPS</code> and <code>SSL</code>.</p>
