1
0
Fork 0

Add ClusterIP and NodePort deployment

This commit is contained in:
Joao Gilberto Magalhaes 2022-08-29 18:08:15 -05:00
parent 98c1114244
commit fa9a9767c9
10 changed files with 525 additions and 31 deletions

View file

@ -1,6 +1,6 @@
---
apiVersion: apps/v1
kind: DaemonSet
kind: {{ ternary "Deployment" "DaemonSet" .Values.service.create }}
metadata:
name: {{ include "easyhaproxy.fullname" . }}
namespace: {{ .Release.Namespace }}
@ -36,17 +36,17 @@ spec:
ports:
- name: http
containerPort: 80
hostPort: 80
{{ if not .Values.service.create }}hostPort: {{ .Values.binding.ports.http }}{{ end }}
- name: https
containerPort: 443
hostPort: 443
{{ if not .Values.service.create }}hostPort: {{ .Values.binding.ports.https }}{{ end }}
- name: stats
containerPort: 1936
hostPort: 1936
{{ range .Values.listen_extra_ports }}
- name: extra{{ . }}
containerPort: {{ . }}
hostPort: {{ . }}
{{ if not .Values.service.create }}hostPort: {{ .Values.binding.ports.stats }}{{ end }}
{{- range $port := .Values.binding.additionalPorts }}
- name: extra{{ $port }}
containerPort: {{ $port }}
{{ if not $.Values.service.create }}hostPort: {{ $port }}{{ end }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}

View file

@ -0,0 +1,34 @@
{{ if .Values.service.create }}
---
apiVersion: v1
kind: Service
metadata:
metadata:
name: {{ include "easyhaproxy.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "easyhaproxy.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.service.annotations | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- name: http
port: 80
{{ if eq .Values.service.type "NodePort" }}nodePort: {{ .Values.binding.ports.http }}{{ end }}
- name: https
port: 443
{{ if eq .Values.service.type "NodePort" }}nodePort: {{ .Values.binding.ports.https }}{{ end }}
- name: stats
port: 1936
{{ if eq .Values.service.type "NodePort" }}nodePort: {{ .Values.binding.ports.stats }}{{ end }}
{{- range $port := .Values.binding.additionalPorts }}
- name: extra{{ $port }}
port: {{ $port }}
{{ if eq $.Values.service.type "NodePort" }}nodePort: {{ $port }}{{ end }}
{{- end }}
selector:
{{- include "easyhaproxy.selectorLabels" . | nindent 4 }}
{{ end }}