Skip to content

Commit

Permalink
Make the path type configurable in ingress rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
jompu committed Feb 2, 2024
1 parent 8707bd6 commit 71b283d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions charts/apisix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ The command removes all the Kubernetes components associated with the chart and
| ingress-controller | object | `{"config":{"apisix":{"adminAPIVersion":"v3"}},"enabled":false}` | Ingress controller configuration |
| ingress.annotations | object | `{}` | Ingress annotations |
| ingress.servicePort | number | `nil` | Service port to send traffic. Defaults to `service.http.servicePort`. |
| ingress.pathType | string | `"ImplementationSpecific"` | Path type for the Ingress rules. |
| initContainer.image | string | `"busybox"` | Init container image |
| initContainer.tag | float | `1.28` | Init container tag |
| metrics | object | `{"serviceMonitor":{"annotations":{},"enabled":false,"interval":"15s","labels":{},"name":"","namespace":""}}` | Observability configuration. |
Expand Down
3 changes: 2 additions & 1 deletion charts/apisix/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
{{- if (.Values.ingress.enabled) -}}
{{- $fullName := include "apisix.fullname" . -}}
{{- $svcPort := .Values.ingress.servicePort | default .Values.service.http.servicePort -}}
{{- $pathType := .Values.ingress.pathType -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
Expand Down Expand Up @@ -60,7 +61,7 @@ spec:
{{- range .paths }}
- path: {{ . }}
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.Version }}
pathType: ImplementationSpecific
pathType: {{ $pathType }}
backend:
service:
name: {{ $fullName }}-gateway
Expand Down
2 changes: 2 additions & 0 deletions charts/apisix/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ ingress:
- host: apisix.local
paths: []
tls: []
# -- Path type for the Ingress rules.
pathType: ImplementationSpecific

# -- Observability configuration.
metrics:
Expand Down

0 comments on commit 71b283d

Please sign in to comment.