-
Notifications
You must be signed in to change notification settings - Fork 332
fix(helm):Allow user to expose extra backend services in ingress #3018
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
base: main
Are you sure you want to change the base?
fix(helm):Allow user to expose extra backend services in ingress #3018
Conversation
|
See #3017 (comment) |
helm/polaris/templates/ingress.yaml
Outdated
| {{- range .paths }} | ||
| - path: {{ .path }} | ||
| pathType: {{ .pathType }} | ||
| backend: | ||
| service: | ||
| name: {{ $fullName }} | ||
| name: {{ default $fullName .backend.service.name }} | ||
| port: | ||
| number: {{ $svcPort }} | ||
| number: {{ default $svcPort .backend.service.port }} | ||
| {{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While at it, shouldn't we just copy the entire .paths here?
| {{- end }} | |
| {{ tpl (toYaml .paths) $ | nindent 10 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! updated
|
@MingzhouLin I think #3017 is quite debatable, but I wouldn't mind repurposing this PR to allow people to enter the whole |
| port: | ||
| number: {{ $svcPort }} | ||
| {{- end }} | ||
| {{ tpl (toYaml .paths) $ | nindent 10 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MingzhouLin I think I didn't really think about the consequences of my suggestion, but looking at the result, it seems to me that it's not fair to ask users to input the whole path object, if they don't need to.
One of the issues is that now users must input the service name (backend.service.name) and port (backend.service.port) – but these fields have good default values.
Would you be OK for you if we do this instead:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
{{- if .backend }}
backend:
{{- tpl (toYaml .backend) $ | nindent 14 }}
{{- else }}
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}In the above example, if you customize backend it will be used, otherwise a default backend is generated.
Sorry for the back and forth 😬
Fixes: #3017
Background: I want to expose extra services(management service for example) through ingress, but there is no way to do so by only editing the configuration.
So, I add this PR to allow user add services through config file.
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)