<p>First of all request goes to proxy service that i've implemented, service forwards request to pods randomly without using sessionAffinity. I want to send requests to same pod based on custom value that i've set in request parameters using post method. I've used sessionAffinity with my service yml.</p>

<p>Here's service yml with sessionAffinity:</p>

<pre><code>apiVersion: v1
metadata:
  name: abcd-service
  namespace: ab-services
spec:
  ports:
  - name: http
    protocol: TCP
    port: ****
    targetPort: ****
    nodePort: *****
  selector:
    app: abcd-pod
  sessionAffinity: ClientIP
  sessionAffinityConfig:
    clientIP:
      timeoutSeconds: 600
  type: NodePort

</code></pre>

<p>Now problem is that when request are send by multiple client's from same ip address all requests are directed to single pod and not to other replicas, causing uneven load balancing. But I don't want requests to be forwarded randomly either. i want all request's from same client or different client to be forwarded based on custom value that i set in post request and not by clientIP considering clientIP resolves to source ip of each request. </p>

<p>As you can read <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/" rel="nofollow noreferrer">here</a>, it currently supports only <code>ClientIP</code> and <code>None</code> values.</p>

<blockquote>
  <p><strong>sessionAffinity</strong> <em>string</em> Supports "ClientIP" and "None". Used to maintain session affinity. Enable client IP based session affinity.
  Must be ClientIP or None. Defaults to None. More info:
  <a href="https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies</a></p>
</blockquote>

<p>Unfortunatelly there are no other values allowed.</p>
