Skip to content

Commit

Permalink
Add a charm config to add custom annotations to loadbalancers created…
Browse files Browse the repository at this point in the history
… by traefik (#428)

* add anotations to traefik lb

* fix config name

* mock patch charm._get_loadbalancer_status

* bump KubernetesServicePatch

* Delete LB if annotations are invalid

* move static functions outside main class

* fmt test case

* refactor `self.service_patch`

* fix inclusive warning

* draft: remove k8s_service_patch dep and move needed code into traefik

* fix tests and refactor k8s `_is_patched`

* fix itests

* switch to kubernetes resource manager

* fix tcp tester charm

* increase traefik route test timeout

* trigger _reconcile_lb() on every hook
  • Loading branch information
IbraAoad authored Dec 11, 2024
1 parent 3698ce9 commit 4454a91
Show file tree
Hide file tree
Showing 18 changed files with 422 additions and 567 deletions.
13 changes: 13 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ options:
This feature is experimental and may be unstable.
type: boolean
default: False
loadbalancer_annotations:
description: |
A comma-separated list of annotations to apply to the LoadBalancer service.
The format should be: `key1=value1,key2=value2,key3=value3`.
These annotations are passed directly to the Kubernetes LoadBalancer service,
enabling customization for specific cloud provider settings or integrations.
Example:
"external-dns.alpha.kubernetes.io/hostname=example.com,service.beta.kubernetes.io/aws-load-balancer-type=nlb"
Ensure the annotations are correctly formatted and adhere to Kubernetes' syntax and character set : https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set
Invalid values will result in LoadBalancer being removed and all previously set annotations will be lost.
type: string
basic_auth_user:
description: |
Enables the `basicAuth` middleware for **all** routes on this proxy.
Expand Down
Loading

0 comments on commit 4454a91

Please sign in to comment.