Browse Source

More clear usage of ports depending if nginx is enabled or not

pull/4/head
LecygneNoir 4 years ago
parent
commit
814a62c5e6
5 changed files with 18 additions and 15 deletions
  1. +1
    -1
      templates/NOTES.txt
  2. +2
    -2
      templates/deployment.yaml
  3. +5
    -5
      templates/nginx-proxyconf.yml
  4. +2
    -2
      templates/service.yaml
  5. +8
    -5
      values.yaml

+ 1
- 1
templates/NOTES.txt View File

@ -11,7 +11,7 @@
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ template "peertube.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "peertube.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
echo http://$SERVICE_IP:{{ .Values.ports.peertubePort }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "peertube.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"

+ 2
- 2
templates/deployment.yaml View File

@ -59,7 +59,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.nginxproxy.service.port }}
containerPort: {{ .Values.ports.nginxproxyPort }}
protocol: TCP
livenessProbe:
httpGet:
@ -100,7 +100,7 @@ spec:
{{- else }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
containerPort: {{ .Values.ports.peertubePort }}
protocol: TCP
livenessProbe:
httpGet:

+ 5
- 5
templates/nginx-proxyconf.yml View File

@ -5,8 +5,8 @@ metadata:
data:
peertubesite.conf: |-
server {
listen {{ .Values.nginxproxy.service.port }} default_server;
listen [::]:{{ .Values.nginxproxy.service.port }} default_server;
listen {{ .Values.ports.nginxproxyPort }} default_server;
listen [::]:{{ .Values.ports.nginxproxyPort }} default_server;
server_name _;
error_log /var/log/nginx/error.log warn;
@ -56,7 +56,7 @@ data:
}
location / {
proxy_pass http://127.0.0.1:{{ .Values.service.port }};
proxy_pass http://127.0.0.1:{{ .Values.ports.peertubePort }};
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@ -131,14 +131,14 @@ data:
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:{{ .Values.service.port }};
proxy_pass http://127.0.0.1:{{ .Values.ports.peertubePort }};
}
location /socket.io {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:{{ .Values.service.port }};
proxy_pass http://127.0.0.1:{{ .Values.ports.peertubePort }};
# enable WebSockets
proxy_http_version 1.1;

+ 2
- 2
templates/service.yaml View File

@ -11,12 +11,12 @@ spec:
type: {{ .Values.service.type }}
ports:
{{- if .Values.nginxproxy.enabled }}
- port: {{ .Values.nginxproxy.service.port }}
- port: {{ .Values.ports.nginxproxyPort }}
targetPort: http
protocol: TCP
name: http
{{- else }}
- port: {{ .Values.service.port }}
- port: {{ .Values.ports.peertubePort }}
targetPort: http
protocol: TCP
name: http

+ 8
- 5
values.yaml View File

@ -12,8 +12,14 @@ image:
service:
type: ClusterIP
# Be careful, if nginx-proxy is enabled, the service port for ingress is the nginx service port (see nginxproxy below)
port: 9000
ports:
# peertubePort should be the same than the port in your Peertube production.yml configuration. Default to 9000
# nginxproxyPort is used only when nginx-proxy is enabled, and should be different from the Peertube port.
# peertubePort is exposed outside of the pod, except if nginx-proxy is enabled, in this case it's the nginxproxyPort that is exposed
# The chart uses the correct port for service and ingress according to configuration
peertubePort: 9000
nginxproxyPort: 9001
ingress:
enabled: true
@ -89,9 +95,6 @@ environment:
nginxproxy:
enabled: true
service:
# Be careful if you use the nginx proxy, the port CANNOT BE the same than default Peertube port (9000)
port: 9001
image:
repository: nginx
tag: 1.17.9

Loading…
Cancel
Save