Skip to content

Commit

Permalink
Adds possibility to define portRef for extra ingresses
Browse files Browse the repository at this point in the history
  • Loading branch information
hfjn authored May 10, 2024
1 parent a0f0918 commit e2e430e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions charts/generic-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ app:
| `ingress.istio.retries` | `{}` | [Istio retry policy](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRetry) |
| `ingress.extra.*.class` | same as `ingress.class` | Additional ingress controller to use (not applicable if `ingress.istio.enabled`) |
| `ingress.extra.*.port` | same as `ingress.port` | Additional container port ingress traffic is routed to (not applicable if `ingress.istio.enabled`) |
| `ingress.extra.*.portRef` | | Reference to the name of another extra ingress to share its container port |
| `ingress.extra.*.protocol` | `http` | The protocol used for the port (e.g., `http`, `https`, `h2c`, `grpc`, `http2`/`h2` or `grpcs`) |
| `ingress.extra.*.timeoutSeconds` | | Number of seconds after which to timeout waiting for response from service; -1 for infinite |
| `ingress.extra.*.domains` | `[]` | The public domain names under which the port is exposed (leave empty for cluster-internal only) |
Expand Down
7 changes: 7 additions & 0 deletions charts/generic-service/ci/ingress-extra-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ ingress:
nginx.ingress.kubernetes.io/configuration-snippet: other-dummy-config;
protocol: grpc
timeoutSeconds: 5
extra-port:
portRef: other-port
domains: ['custom-port.example.com']
annotations:
nginx.ingress.kubernetes.io/configuration-snippet: other-dummy-config;
protocol: grpc
timeoutSeconds: 5
4 changes: 3 additions & 1 deletion charts/generic-service/templates/ingress-extra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ spec:
service:
name: {{ include "generic-service.fullname" $ }}
port:
{{- if $extra.port }}
{{- if $extra.portRef }}
name: {{ include "generic-service.normalize-protocol" $extra.protocol }}-{{ $extra.portRef }}
{{- else if $extra.port }}
name: {{ include "generic-service.normalize-protocol" $extra.protocol }}-{{ $name }}
{{- else }}
{{- if $extra.protocol }}
Expand Down
4 changes: 4 additions & 0 deletions charts/generic-service/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,10 @@
"type": "integer",
"description": "The container port ingress traffic is routed to; defaults to value of ingress.port if not set"
},
"portRef": {
"type": "string",
"description": "Reference to the name of another extra ingress to share its container port"
},
"protocol": {
"type": "string",
"default": "http",
Expand Down

0 comments on commit e2e430e

Please sign in to comment.