Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add externalTrafficPolicy support for services (excluding the UI service) #464

Closed
wants to merge 17 commits into from

Conversation

shayfisher
Copy link

No description provided.

--set 'server.service.externalTrafficPolicy=local' \
--set 'server.ha.enabled=true' \
. | tee /dev/stderr |
yq -r '.spec.externalTrafficPolicy | tee /dev/stderr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing a ' and so are the other tests you added here, which is causing failures when running the tests.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just committed the change from my phone :)

externalTrafficPolicy is set to local
and service type is NodePort
otherwise don'tset externalTrafficPolicy
@benashz benashz self-requested a review September 28, 2021 19:29
values.yaml Outdated Show resolved Hide resolved
@@ -15,6 +15,11 @@ metadata:
annotations:
{{ template "vault.service.annotations" .}}
spec:
{{- if and (.Values.server.service.externalTrafficPolicy ) (print .Values.server.service.externalTrafficPolicy | lower | title | eq "Local" )}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be a missing update here.

@@ -157,3 +157,53 @@ load _helpers
yq -r '.spec.ports | map(select(.port==8200)) | .[] .name' | tee /dev/stderr)
[ "${actual}" = "https" ]
}

@test "server/ha-active-Service: vault externalTrafficPolicy set to Local lowercase" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just testing that the value provided is honoured is good enough here. The two cases are:

  • empty string ""
  • non empty value like Cluster

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benashz So you suggest adding a default value of "Cluster" for instance ?
I'm not handling the case where an empty string isn't provided.
This would probably fall back to K8S defaults (Which currently I'm not sure what is).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benashz Just checked - made a new svc with a value not in the correct case - got the following error:
The Service "my-service" is invalid: spec.externalTrafficPolicy: Invalid value: "local": ExternalTrafficPolicy must be empty, Cluster or Local.

So - empty is just fine.
Non empty value would fail if it isn't Local or Cluster.

values.yaml Show resolved Hide resolved
@benashz
Copy link
Contributor

benashz commented Oct 15, 2021

@shayfisher thank for your effort on this PR. I have moved the work to #626

@benashz benashz closed this Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants