Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.
Merged
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 elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ support multiple versions with minimal changes.
| `secretMounts` | Allows you easily mount a secret as a file inside the StatefulSet. Useful for mounting certificates and other secrets. See [values.yaml][] for an example | `[]` |
| `securityContext` | Allows you to set the [securityContext][] for the container | see [values.yaml][] |
| `service.annotations` | [LoadBalancer annotations][] that Kubernetes will use for the service. This will configure load balancer if `service.type` is `LoadBalancer` | `{}` |
| `service.enabled` | Enable non-headless service | `true` |
| `service.externalTrafficPolicy` | Some cloud providers allow you to specify the [LoadBalancer externalTrafficPolicy][]. Kubernetes will use this to preserve the client source IP. This will configure load balancer if `service.type` is `LoadBalancer` | `""` |
| `service.httpPortName` | The name of the http port within the service | `http` |
| `service.labelsHeadless` | Labels to be added to headless service | `{}` |
Expand Down
2 changes: 2 additions & 0 deletions elasticsearch/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
{{- if .Values.service.enabled -}}
kind: Service
apiVersion: v1
metadata:
Expand Down Expand Up @@ -43,6 +44,7 @@ spec:
{{- if .Values.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
{{- end }}
{{- end }}
---
kind: Service
apiVersion: v1
Expand Down
17 changes: 17 additions & 0 deletions elasticsearch/tests/elasticsearch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,23 @@ def test_scheduler_name():
)


def test_disabling_non_headless_service():
config = ""

r = helm_template(config)

assert uname in r["service"]

config = """
service:
enabled: false
"""

r = helm_template(config)

assert uname not in r["service"]


def test_adding_a_nodePort():
config = ""

Expand Down
1 change: 1 addition & 0 deletions elasticsearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ httpPort: 9200
transportPort: 9300

service:
enabled: true
labels: {}
labelsHeadless: {}
type: ClusterIP
Expand Down