Skip to content

Commit

Permalink
feat: add separate ingress for grpc api access
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed Jan 19, 2025
1 parent 3026941 commit 098a446
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/fivenet/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.10.4
version: 0.11.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
40 changes: 40 additions & 0 deletions charts/fivenet/templates/ingress-grpc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- $fullName := include "fivenet.fullname" . -}}
{{- if .Values.ingressGRPC.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "fivenet.labels" . | nindent 4 }}
annotations:
{{- with .Values.ingressGRPC.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingressGRPC.className }}
{{- if .Values.ingressGRPC.tls }}
tls:
{{- range .Values.ingressGRPC.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingressGRPC.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ if .serviceName }}{{ .serviceName }}{{ else }}{{ $fullName }}{{ with .service }}-{{ . }}{{ end }}{{ end }}
port:
name: {{ if .servicePort }}{{ .servicePort }}{{ else }}http{{ end }}
{{- end }}
{{- end }}
{{- end }}
24 changes: 23 additions & 1 deletion charts/fivenet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ ingress:
# -- Ingress class name
className: "nginx"
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
#nginx.ingress.kubernetes.io/ssl-redirect: "true"
#nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
Expand All @@ -61,6 +60,29 @@ ingress:
# hosts:
# - chart-example.local

ingressGRPC:
# -- If an ingress object for GRPC API access should be created. Requires TLS certs for HTTPS.
enabled: true
# -- Ingress class name
className: "nginx"
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/backend-protocol: "GRPC"
nginx.ingress.kubernetes.io/use-regex: "true"
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /api
pathType: Prefix
serviceName: fivenet-server
- path: /
pathType: Prefix
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

fivenet:
# -- FiveNet config, make sure to checkout the [config reference documentation](https://fivenet.app/getting-started/configuration/config-reference)
config:
Expand Down

0 comments on commit 098a446

Please sign in to comment.