Skip to content

Commit 8c78e71

Browse files
brdelphusclaude
andcommitted
feat(helm): support Deployment workload type for LoadBalancer mode
Add workloadType: DaemonSet | Deployment and replicaCount values. DaemonSet is default (bare-metal k3s + hostPorts). Deployment is recommended with service.type: LoadBalancer (MetalLB / cloud LBs) — set hostPorts.enabled: false in that case to avoid port conflicts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5528747 commit 8c78e71

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: caddy
33
description: Caddy ingress with WAF, TCP/UDP, cert-manager CSI, CrowdSec, GeoIP, rate limiting and caching
44
type: application
5-
version: 0.2.0
5+
version: 0.3.0
66
appVersion: "2.11.2"
77
keywords:
88
- caddy

helm/templates/daemonset.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
{{- $isDaemonSet := ne .Values.workloadType "Deployment" -}}
12
apiVersion: apps/v1
2-
kind: DaemonSet
3+
kind: {{ if $isDaemonSet }}DaemonSet{{ else }}Deployment{{ end }}
34
metadata:
45
name: {{ include "caddy.fullname" . }}
56
namespace: {{ .Release.Namespace }}
@@ -14,8 +15,14 @@ spec:
1415
selector:
1516
matchLabels:
1617
{{- include "caddy.selectorLabels" . | nindent 6 }}
18+
{{- if $isDaemonSet }}
1719
updateStrategy:
1820
type: RollingUpdate
21+
{{- else }}
22+
replicas: {{ .Values.replicaCount }}
23+
strategy:
24+
type: RollingUpdate
25+
{{- end }}
1926
template:
2027
metadata:
2128
labels:

helm/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,15 @@ service:
233233
# GCE internal LB:
234234
# cloud.google.com/load-balancer-type: Internal
235235

236+
# ── Workload type ─────────────────────────────────────────────────────────────
237+
# DaemonSet — runs on every node; use with hostPorts for bare-metal k3s.
238+
# Deployment — fixed replica count; use with service.type: LoadBalancer (MetalLB,
239+
# cloud LBs). Set hostPorts.enabled: false when using a LoadBalancer
240+
# so pods don't compete for node ports.
241+
242+
workloadType: DaemonSet # DaemonSet | Deployment
243+
replicaCount: 2 # only used when workloadType: Deployment
244+
236245
# ── DaemonSet / pod settings ───────────────────────────────────────────────────
237246
# hostPorts bind directly on each node's network interface.
238247
# Can coexist with the LoadBalancer service — disable if your LB provider

0 commit comments

Comments
 (0)