From 3ee532e0cedc33c0c17bed29151ecb96cf835873 Mon Sep 17 00:00:00 2001 From: portdirect Date: Sun, 4 Mar 2018 17:42:14 -0500 Subject: [PATCH] Horizon: use endpoints section and lookups to set port This PS moves horizon to use the endpoints section and lookups to set the port it serves on. Change-Id: Id413f05c3ab49d592d030916d7cffcdf256519fd --- horizon/templates/deployment.yaml | 5 +++-- horizon/templates/etc/_horizon.conf.tpl | 4 ++-- horizon/templates/service.yaml | 14 +++++++------- horizon/values.yaml | 1 - 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/horizon/templates/deployment.yaml b/horizon/templates/deployment.yaml index ba35b441..3e25ac79 100644 --- a/horizon/templates/deployment.yaml +++ b/horizon/templates/deployment.yaml @@ -64,12 +64,13 @@ spec: - /tmp/horizon.sh - stop ports: - - containerPort: {{ .Values.network.port }} + - name: web + containerPort: {{ tuple "dashboard" "internal" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} readinessProbe: httpGet: scheme: HTTP path: / - port: {{ .Values.network.port }} + port: {{ tuple "dashboard" "internal" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} initialDelaySeconds: 15 periodSeconds: 10 volumeMounts: diff --git a/horizon/templates/etc/_horizon.conf.tpl b/horizon/templates/etc/_horizon.conf.tpl index c6b813bb..184b9235 100644 --- a/horizon/templates/etc/_horizon.conf.tpl +++ b/horizon/templates/etc/_horizon.conf.tpl @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -Listen 0.0.0.0:{{ .Values.network.port}} +Listen 0.0.0.0:{{ tuple "dashboard" "internal" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy @@ -23,7 +23,7 @@ SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded CustomLog /dev/stdout combined env=!forwarded CustomLog /dev/stdout proxy env=forwarded - + WSGIScriptReloading On WSGIDaemonProcess horizon-http processes=5 threads=1 user=horizon group=horizon display-name=%{GROUP} python-path=/var/lib/kolla/venv/lib/python2.7/site-packages WSGIProcessGroup horizon-http diff --git a/horizon/templates/service.yaml b/horizon/templates/service.yaml index 121b3b4c..a28e7be5 100644 --- a/horizon/templates/service.yaml +++ b/horizon/templates/service.yaml @@ -24,16 +24,16 @@ metadata: spec: ports: {{ if .Values.network.node_port.enabled }} - - name: http + - name: web + protocol: TCP nodePort: {{ .Values.network.node_port.port }} - port: {{ .Values.network.port }} - protocol: TCP - targetPort: {{ .Values.network.port }} + port: {{ tuple "dashboard" "internal" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + targetPort: {{ tuple "dashboard" "internal" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{ else }} - - name: http - port: {{ .Values.network.port }} + - name: web protocol: TCP - targetPort: {{ .Values.network.port }} + port: {{ tuple "dashboard" "internal" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + targetPort: {{ tuple "dashboard" "internal" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{ end }} selector: {{ tuple $envAll "horizon" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} diff --git a/horizon/values.yaml b/horizon/values.yaml index 21f252e6..d7cad6ab 100644 --- a/horizon/values.yaml +++ b/horizon/values.yaml @@ -37,7 +37,6 @@ labels: node_selector_value: enabled network: - port: 80 dashboard: ingress: public: true