mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-27 18:18:41 +00:00
31 lines
891 B
YAML
31 lines
891 B
YAML
{{- if .Values.external }}
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ include "virtual-machine.fullname" . }}
|
|
labels:
|
|
apps.cozystack.io/user-service: "true"
|
|
{{- include "virtual-machine.labels" . | nindent 4 }}
|
|
annotations:
|
|
networking.cozystack.io/wholeIP: "true"
|
|
spec:
|
|
type: {{ ternary "LoadBalancer" "ClusterIP" .Values.external }}
|
|
externalTrafficPolicy: Local
|
|
{{- if ((include "cozy-lib.network.disableLoadBalancerNodePorts" $) | fromYaml) }}
|
|
allocateLoadBalancerNodePorts: false
|
|
{{- end }}
|
|
selector:
|
|
{{- include "virtual-machine.selectorLabels" . | nindent 4 }}
|
|
ports:
|
|
{{- if and (eq .Values.externalMethod "WholeIP") (not .Values.externalPorts) }}
|
|
- port: 65535
|
|
{{- else }}
|
|
{{- range .Values.externalPorts }}
|
|
- name: port-{{ . }}
|
|
port: {{ . }}
|
|
targetPort: {{ . }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|