73 lines
1.6 KiB
YAML
73 lines
1.6 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: "{{ .Values.name }}-service"
|
|
namespace: {{ .Values.namespace }}
|
|
spec:
|
|
{{- if eq .Values.service.app.type "LoadBalancer" }}
|
|
type: LoadBalancer
|
|
{{- else if eq .Values.service.app.type "NodePort" }}
|
|
type: NodePort
|
|
{{- end }}
|
|
selector:
|
|
app: "{{ .Values.name }}-app"
|
|
ports:
|
|
- targetPort: 3000
|
|
protocol: TCP
|
|
{{- if eq .Values.service.app.type "LoadBalancer" }}
|
|
port: {{ .Values.service.app.port }}
|
|
{{- else if eq .Values.service.app.type "NodePort" }}
|
|
nodePort: {{ .Values.service.app.nodePort }}
|
|
{{- end }}
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: "{{ .Values.name }}-ssh-service"
|
|
namespace: {{ .Values.namespace }}
|
|
spec:
|
|
{{- if eq .Values.service.ssh.type "LoadBalancer" }}
|
|
type: LoadBalancer
|
|
{{- else if eq .Values.service.ssh.type "NodePort" }}
|
|
type: NodePort
|
|
{{- end }}
|
|
selector:
|
|
app: "{{ .Values.name }}-app"
|
|
ports:
|
|
- targetPort: 22
|
|
{{- if eq .Values.service.ssh.type "LoadBalancer" }}
|
|
port: {{ .Values.service.ssh.port }}
|
|
{{- else if eq .Values.service.ssh.type "NodePort" }}
|
|
nodePort: {{ .Values.service.ssh.nodePort }}
|
|
{{- end }}
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: "{{ .Values.name }}-int-service"
|
|
namespace: {{ .Values.namespace }}
|
|
spec:
|
|
selector:
|
|
app: "{{ .Values.name }}-app"
|
|
ports:
|
|
- protocol: TCP
|
|
port: 3000
|
|
targetPort: 3000
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: "{{ .Values.name }}-db-service"
|
|
namespace: {{ .Values.namespace }}
|
|
spec:
|
|
selector:
|
|
app: "{{ .Values.name }}-db"
|
|
ports:
|
|
- protocol: TCP
|
|
port: 5432
|
|
targetPort: 5432
|