35 lines
1.1 KiB
YAML

apiVersion: v1
kind: Service
metadata:
labels:
{{- include "bookstack.labels" . | nindent 4 }}
app.kubernetes.io/component: bookstack-app
name: {{ include "bookstack.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
ports:
- name: http
port: {{ .Values.service.port | default 8080 }}
protocol: TCP
targetPort: 8080
{{- if and (eq .Values.service.type "NodePort") .Values.service.nodePort }}
nodePort: {{ .Values.service.nodePort | quote }}
{{- end }}
selector:
{{- include "bookstack.labels" . | nindent 4 }}
app.kubernetes.io/component: bookstack-app
{{- if or (eq .Values.service.type "ClusterIP") (eq .Values.service.type "Headless") }}
type: ClusterIP
{{- else if eq .Values.service.type "NodePort" }}
type: NodePort
{{- else if eq .Values.service.type "LoadBalancer" }}
type: LoadBalancer
{{- with .Values.service.loadBalancerIP }}
loadBalancerIP: {{ . | quote }}
{{- end }}
{{- end }}
{{- if or (eq .Values.service.type "Headless") }}
clusterIP: None
{{- else if .Values.service.clusterIP }}
clusterIP: {{ .Values.service.clusterIP | quote }}
{{- end }}