Skip to content

Commit

Permalink
feat: add ingress rule for lb and filter
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Jan 9, 2024
1 parent 8d3143c commit f55617c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
28 changes: 28 additions & 0 deletions charts/vald/templates/gateway/mirror/ing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
# limitations under the License.
#
{{- $gateway := .Values.gateway.mirror -}}
{{- $lb := .Values.gateway.lb -}}
{{- $filter := .Values.gateway.filter -}}
{{- if and $gateway.enabled $gateway.ingress.enabled }}
{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }}
apiVersion: networking.k8s.io/v1
{{- else }}
apiVersion: networking.k8s.io/v1alpha1
{{- end }}
kind: Ingress
metadata:
annotations:
Expand Down Expand Up @@ -44,4 +50,26 @@ spec:
name: {{ $gateway.name }}
{{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }}
pathType: {{ $gateway.ingress.pathType }}
{{- if $lb.enabled }}
- path: "/vald.v1.Search/*"
backend:
service:
name: {{ $lb.name }}
{{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }}
pathType: {{ $gateway.ingress.pathType }}
- path: "/vald.v1.Object/*"
backend:
service:
name: {{ $lb.name }}
{{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }}
pathType: {{ $gateway.ingress.pathType }}
{{- end }}
{{- if $filter.enabled }}
- path: "/vald.v1.Filter/*"
backend:
service:
name: {{ $filter.name }}
{{- include "vald.ingressPort" (dict "Values" $gateway.ingress) | nindent 12 }}
pathType: {{ $gateway.ingress.pathType }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/vald/templates/gateway/mirror/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
#
{{- $gateway := .Values.gateway.mirror -}}
{{- if $gateway.enabled }}
{{- if (.Capabilities.APIVersions.Has "policy/v1") }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ $gateway.name }}
Expand Down

0 comments on commit f55617c

Please sign in to comment.