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