Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

[logstash] Add Statefulset Annotations through values.yaml #1791

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions logstash/README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ useful for the [http input plugin][], for instance.

| Parameter | Description | Default |
|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------|
| `annotations` | Configurable [annotations][] applied to the Elasticsearch Statefulset | `{}` |
| `antiAffinityTopologyKey` | The [anti-affinity][] topology key]. By default this will prevent multiple Logstash nodes from running on the same Kubernetes node | `kubernetes.io/hostname` |
| `antiAffinity` | Setting this to hard enforces the [anti-affinity][] rules. If it is set to soft it will be done "best effort". Other values will be ignored | `hard` |
| `envFrom` | Templatable string to be passed to the [environment from variables][] which will be appended to the `envFrom:` definition for the container | `[]` |
Expand Down
4 changes: 4 additions & 0 deletions logstash/templates/statefulset.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ metadata:
{{- range $key, $value := .Values.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
annotations:
{{- range $key, $value := .Values.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
serviceName: {{ template "logstash.fullname" . }}-headless
selector:
Expand Down
14 changes: 14 additions & 0 deletions logstash/tests/logstash_test.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,20 @@ def test_adding_tolerations():
)


def test_adding_annotations():
config = """
annotations:
key: value
"""
r = helm_template(config)
assert (
r["statefulset"][name]["metadata"]["annotations"][
"key"
]
== "value"
)


def test_adding_pod_annotations():
config = """
podAnnotations:
Expand Down
3 changes: 3 additions & 0 deletions logstash/values.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ imageTag: "8.5.1"
imagePullPolicy: "IfNotPresent"
imagePullSecrets: []

# Statefulset annotations
annotations: {}

podAnnotations: {}

# additionals labels
Expand Down