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

@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.1
version: 0.1.2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to

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 }}

View file

@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"required": [],
"properties": {
"service": {
"type": "object",
"required": [],
"properties": {
"create": {
"type": "boolean"
},
"type": {
"type": "string",
"enum": ["ClusterIP", "NodePort"]
}
}
}
}
}

View file

@ -14,6 +14,18 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
service:
create: false # If false, it will create a Daemonset with hostPort. The easiest.
type: ClusterIP # or NodePort
annotations: {}
binding:
ports:
http: 80
https: 443
stats: 1936
additionalPorts: []
serviceAccount:
create: true
annotations: {}
@ -58,8 +70,6 @@ easyhaproxy:
easyhaproxy: DEBUG
haproxy: DEBUG
listen_extra_ports: []
# Make sure to create this
masterNode:
label: easyhaproxy/node