Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cjcullen
Last active December 8, 2015 23:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjcullen/2aad7d51b76b190e2193 to your computer and use it in GitHub Desktop.
Save cjcullen/2aad7d51b76b190e2193 to your computer and use it in GitHub Desktop.
Workaround for GCE LB Issue
Work around GCE LB issue by setting service session affinity by adding:
"sessionAffinity": "ClientIP"
to the service spec. This will give you sticky sessions, but will get GCE external LB services again.
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "my-service"
},
"spec": {
"selector": {
"app": "MyApp"
},
"ports": [
{
"protocol": "TCP",
"port": 80,
"targetPort": 9376
}
],
"sessionAffinity": "ClientIP"
}
}
@j3ffml
Copy link

j3ffml commented Dec 8, 2015

Or using kubectl expose:

kubectl expose rc myapp --type=LoadBalancer --port=80 --session-affinity=ClientIP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment