Skip to content

Commit

Permalink
fix annotations on unbound service
Browse files Browse the repository at this point in the history
  • Loading branch information
karitham committed Jul 17, 2024
1 parent c14ad22 commit b213868
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 9 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ Readme generated with [readme-generator-for-helm](https://github.com/bitnami/rea

### DNS

| Name | Description | Value |
| --------------------------------- | -------------------------------------- | ---------------------------- |
| `unbound.enabled` | Enable unbound DNS server | `true` |
| `unbound.welcomeImage.name` | Image name for the welcome page | `ctr.0x.pt/wga/welcome-page` |
| `unbound.welcomeImage.tag` | Image tag for the welcome page | `1.0.1` |
| `unbound.welcomeImage.pullPolicy` | Image pull policy for the welcome page | `""` |
| `unbound.ip` | IP address for the unbound DNS server | `nil` |
| Name | Description | Value |
| --------------------------------- | ------------------------------------------------- | ---------------------------- |
| `unbound.enabled` | Enable unbound DNS server | `true` |
| `unbound.welcomeImage.name` | Image name for the welcome page | `ctr.0x.pt/wga/welcome-page` |
| `unbound.welcomeImage.tag` | Image tag for the welcome page | `1.0.1` |
| `unbound.welcomeImage.pullPolicy` | Image pull policy for the welcome page | `""` |
| `unbound.ip` | IP address for the unbound DNS server | `nil` |
| `unbound.service.annotations` | Additional annotations for the unbound DNS server | `{}` |
3 changes: 1 addition & 2 deletions charts/wga/templates/unbound/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ apiVersion: v1
kind: Service
metadata:
name: wga-unbound
annotations:
metallb.universe.tf/loadBalancerIPs: "{{ .Values.unbound.ip }}"
annotations: {{ .Values.unbound.service.annotations | toYaml | nindent 4 }}
spec:
externalTrafficPolicy: Local
type: LoadBalancer
Expand Down
40 changes: 40 additions & 0 deletions charts/wga/tests/unbound_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
suite: unbound
templates:
- unbound/service.yaml
tests:
- it: should set custom annotations for unbound service
set:
endpoint.address: 192.168.1.1
endpoint.privateKeySecretName: wga-key
unbound.ip: 192.168.1.53
unbound.service.annotations:
custom.annotation/test: "test-value"
another.annotation/example: "example-value"
asserts:
- equal:
path: metadata.annotations
value:
custom.annotation/test: "test-value"
another.annotation/example: "example-value"

- it: should not any annotation by default
set:
endpoint.address: 192.168.1.1
endpoint.privateKeySecretName: wga-key
unbound.ip: 192.168.1.53
asserts:
- isNullOrEmpty:
path: metadata.annotations

- it: should set metallb annotation when specified
set:
endpoint.address: 192.168.1.1
endpoint.privateKeySecretName: wga-key
unbound.ip: 192.168.1.53
unbound.service.annotations:
metallb.universe.tf/loadBalancerIPs: "192.168.1.53"
asserts:
- equal:
path: metadata.annotations
value:
metallb.universe.tf/loadBalancerIPs: "192.168.1.53"
5 changes: 5 additions & 0 deletions charts/wga/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,8 @@ unbound:
pullPolicy: ""

ip: null

## @param unbound.service.annotations Additional annotations for the unbound DNS server
service:
annotations: {}
# metallb.universe.tf/loadBalancerIPs: null

0 comments on commit b213868

Please sign in to comment.