Skip to content

Commit

Permalink
Add ingress support
Browse files Browse the repository at this point in the history
  • Loading branch information
isZumpo committed Aug 13, 2024
1 parent fbf3c66 commit e85b154
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/birdnet-go/templates/configmaps/birdnet.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "birdnet-go.fullname" . }}-config
name: {{ template "birdnet-go.fullname" . }}-birdnet
labels:
app: {{ template "birdnet-go.name" . }}
chart: {{ template "birdnet-go.chart" . }}
Expand Down
2 changes: 1 addition & 1 deletion charts/birdnet-go/templates/deployments/birdnet.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "birdnet-go.fullname" . }}
name: {{ template "birdnet-go.fullname" . }}-birdnet
labels:
app: {{ template "birdnet-go.name" . }}
chart: {{ template "birdnet-go.chart" . }}
Expand Down
37 changes: 37 additions & 0 deletions charts/birdnet-go/templates/ingresses/birdnet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "birdnet-go.fullname" . }}-birdnet
labels:
app: {{ template "birdnet-go.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
http:
paths:
- path: {{ $ingressPath }}
pathType: ImplementationSpecific
backend:
service:
name: {{ template "birdnet-go.name" . }}
port:
name: http
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions charts/birdnet-go/templates/services/birdnet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "birdnet-go.fullname" . }}-birdnet
labels:
app: {{ template "birdnet-go.name" . }}
chart: {{ template "birdnet-go.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: ClusterIP
selector:
app: {{ template "birdnet-go.name" . }}-birdnet
ports:
- name: http
protocol: TCP
port: 80
targetPort: http
2 changes: 1 addition & 1 deletion charts/birdnet-go/templates/services/rtsp-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
spec:
type: ClusterIP
selector:
app: {{ template "birdnet-go.name" . }}
app: {{ template "birdnet-go.name" . }}-rtsp-server
ports:
- name: rtsp
protocol: TCP
Expand Down

0 comments on commit e85b154

Please sign in to comment.