blob: 579e73fcd35848fbfc6521152e8ab8542d187013 [file] [log] [blame]
Mohammed Naserf3f59a72023-01-15 21:02:04 -05001{{/*
2Licensed under the Apache License, Version 2.0 (the "License");
3you may not use this file except in compliance with the License.
4You may obtain a copy of the License at
5
6 http://www.apache.org/licenses/LICENSE-2.0
7
8Unless required by applicable law or agreed to in writing, software
9distributed under the License is distributed on an "AS IS" BASIS,
10WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11See the License for the specific language governing permissions and
12limitations under the License.
13*/}}
14
15{{- if .Values.manifests.service }}
16{{- $envAll := . }}
17---
18apiVersion: v1
19kind: Service
20metadata:
21 name: {{ tuple "dashboard" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
22spec:
23 ports:
24 {{ if .Values.network.node_port.enabled }}
25 - name: web
26 protocol: TCP
27 nodePort: {{ .Values.network.node_port.port }}
28 port: {{ tuple "dashboard" "internal" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
29 targetPort: {{ tuple "dashboard" "internal" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
30 {{ else }}
31 - name: web
32 protocol: TCP
33 port: {{ tuple "dashboard" "internal" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
34 targetPort: {{ tuple "dashboard" "internal" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
35 {{ end }}
36 selector:
37{{ tuple $envAll "horizon" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
38 {{ if .Values.network.node_port.enabled }}
39 type: NodePort
40 {{ if .Values.network.external_policy_local }}
41 externalTrafficPolicy: Local
42 {{ end }}
43 {{ end }}
44{{- end }}