diff --git a/helm/easyhaproxy/README.md b/helm/easyhaproxy/README.md index 112106c..e6cd94e 100644 --- a/helm/easyhaproxy/README.md +++ b/helm/easyhaproxy/README.md @@ -14,9 +14,18 @@ helm repo update byjg helm upgrade --install --create-namespace -n easyhaproxy easyhaproxy byjg/easyhaproxy ``` +## Deployment Types + +EasyHAProxy can be deployed in two ways: + +1. **DaemonSet (default)**: When `service.create: false`, EasyHAProxy is deployed as a DaemonSet with hostPort, and will only be scheduled on nodes with the masterNode label. +2. **Deployment**: When `service.create: true`, EasyHAProxy is deployed as a Deployment with a Service (ClusterIP or NodePort), and the `replicaCount` value determines the number of replicas (defaults to 1 if not specified). + ## Parameters ```yaml +replicaCount: 1 # Only applies when service.create is true (defaults to 1 if not specified) + image: repository: byjg/easy-haproxy pullPolicy: Always # IfNotPresent @@ -53,7 +62,8 @@ easyhaproxy: certbot: email: "" -# Make sure to create this +# Master node configuration - only used when service.create is false (DaemonSet mode) +# When service.create is true (Deployment with ClusterIP/NodePort), this is ignored masterNode: label: easyhaproxy/node values: diff --git a/helm/easyhaproxy/templates/deployment.yaml b/helm/easyhaproxy/templates/deployment.yaml index 07cae85..75e14e5 100644 --- a/helm/easyhaproxy/templates/deployment.yaml +++ b/helm/easyhaproxy/templates/deployment.yaml @@ -7,6 +7,9 @@ metadata: labels: {{- include "easyhaproxy.labels" . | nindent 4 }} spec: +{{- if .Values.service.create }} + replicas: {{ .Values.replicaCount | default 1 }} +{{- end }} selector: matchLabels: {{- include "easyhaproxy.selectorLabels" . | nindent 6 }} @@ -15,6 +18,7 @@ spec: labels: {{- include "easyhaproxy.selectorLabels" . | nindent 8 }} spec: +{{- if not .Values.service.create }} affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: @@ -24,6 +28,7 @@ spec: operator: In values: {{- toYaml .Values.masterNode.values | nindent 18 }} +{{- end }} serviceAccountName: {{ include "easyhaproxy.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} diff --git a/helm/easyhaproxy/values.yaml b/helm/easyhaproxy/values.yaml index 2ed4dfd..835151d 100644 --- a/helm/easyhaproxy/values.yaml +++ b/helm/easyhaproxy/values.yaml @@ -72,7 +72,8 @@ easyhaproxy: certbot: email: "" -# Make sure to create this +# Master node configuration - only used when service.create is false (DaemonSet mode) +# When service.create is true (Deployment with ClusterIP/NodePort), this is ignored masterNode: label: easyhaproxy/node values: