Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make NodePort deployment discoverable #120

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/kube-plex/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ spec:
- name: https
containerPort: 32443
env:
{{- if .Values.discovery.enabled }}
- name: ADVERTISE_IP
value: https://{{ .Values.discovery.ip }}:{{ .Values.service.nodePort }}
{{- end }}
- name: TZ
value: "{{ .Values.timezone }}"
# TODO: move this to a secret?
Expand Down
12 changes: 9 additions & 3 deletions charts/kube-plex/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $serviceName := include "fullname" . -}}
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "fullname" . }}
Expand All @@ -14,15 +14,21 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className | quote }}
{{- end }}
rules:
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: /
pathType: Prefix
backend:
serviceName: {{ $serviceName }}
servicePort: pms
service:
name: {{ $serviceName }}
port:
name: pms
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
Expand Down
22 changes: 22 additions & 0 deletions charts/kube-plex/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,28 @@ spec:
- name: https
port: 443
targetPort: 32443
{{- if .Values.discovery.enabled }}
- name: udp1
nodePort: 32410
port: 32410
protocol: UDP
targetPort: 32410
- name: udp2
nodePort: 32412
port: 32412
protocol: UDP
targetPort: 32412
- name: udp3
nodePort: 32413
port: 32413
protocol: UDP
targetPort: 32413
- name: udp4
nodePort: 32414
port: 32414
protocol: UDP
targetPort: 32414
{{- end }}
selector:
app: {{ template "name" . }}
release: {{ .Release.Name }}
Expand Down