Skip to content

Commit

Permalink
Add loadBalancer.labels support (#276)
Browse files Browse the repository at this point in the history
* Add loadBalancer.labels support

For example, cilium LB IPAM uses labels to match pool with a service (https://docs.cilium.io/en/latest/network/lb-ipam/)

* bump version of the chart

* make it minor release

* fix trailing slash that break validation

* fix empty annotation object

---------

Co-authored-by: Marco Vito Moscaritolo <[email protected]>
  • Loading branch information
taraszka and mavimo authored Jan 5, 2025
1 parent b97d6c9 commit e165d9f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/caddy-ingress-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ home: https://github.com/caddyserver/ingress
description: A helm chart for the Caddy Kubernetes ingress controller
icon: https://caddyserver.com/resources/images/caddy-circle-lock.svg
type: application
version: 1.2.0
version: 1.3.0
appVersion: "v0.2.1"
keywords:
- ingress-controller
Expand Down
3 changes: 3 additions & 0 deletions charts/caddy-ingress-controller/templates/loadbalancer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ metadata:
{{- end }}
labels:
{{- include "caddy-ingress-controller.labels" . | nindent 4 }}
{{- with .Values.loadBalancer.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: "LoadBalancer"
{{- if (semverCompare "<= 1.24.0" .Capabilities.KubeVersion.Version) }}
Expand Down
27 changes: 27 additions & 0 deletions charts/caddy-ingress-controller/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,33 @@
"$id": "#/properties/fullnameOverride",
"type": "string"
},
"loadBalancer": {
"$id": "#/properties/loadBalancer",
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"$id": "#/properties/loadBalancer/properties/enabled",
"type": "boolean"
},
"annotations": {
"$id": "#/properties/loadBalancer/properties/annotations",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"labels": {
"$id": "#/properties/loadBalancer/properties/labels",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
},
"ingressController": {
"$id": "#/properties/ingressController",
"type": "object",
Expand Down
3 changes: 2 additions & 1 deletion charts/caddy-ingress-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ loadBalancer:
loadBalancerIP:
# Set to 'Local' to maintain the client's IP on inbound connections
externalTrafficPolicy:
annotations:
annotations: {}
# service.beta.kubernetes.io/aws-load-balancer-type:
# service.beta.kubernetes.io/aws-load-balancer-nlb-target-type:
# service.beta.kubernetes.io/aws-load-balancer-scheme:
# service.beta.kubernetes.io/aws-load-balancer-eip-allocations:
# service.beta.kubernetes.io/aws-load-balancer-subnets:
labels: {}

service:
# Set to 'Local' to maintain the client's IP on inbound connections
Expand Down

0 comments on commit e165d9f

Please sign in to comment.