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

[kibana] Always set server.host to the docker default #168

Merged
merged 1 commit into from
Jun 18, 2019
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 kibana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ helm install --name kibana elastic/kibana --version 7.1.1 --set imageTag=7.1.1
| `imagePullPolicy` | The Kubernetes [imagePullPolicy](https://kubernetes.io/docs/concepts/containers/images/#updating-images) value | `IfNotPresent` |
| `resources` | Allows you to set the [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) for the statefulset | `requests.cpu: 100m`<br>`requests.memory: 2Gi`<br>`limits.cpu: 1000m`<br>`limits.memory: 2Gi` |
| `protocol` | The protocol that will be used for the readinessProbe. Change this to `https` if you have `server.ssl.enabled: true` set | `http` |
| `serverHost` | The [`server.host`](https://www.elastic.co/guide/en/kibana/current/settings.html) Kibana setting. This is set explicitly so that the default always matches what comes with the docker image. | `0.0.0.0` |
| `healthCheckPath` | The path used for the readinessProbe to check that Kibana is ready | `/app/kibana` |
| `kibanaConfig` | Allows you to add any config files in `/usr/share/kibana/config/` such as `kibana.yml`. See [values.yaml](./values.yaml) for an example of the formatting. | `{}` |
| `podSecurityContext` | Allows you to set the [securityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) for the pod | `{}` |
Expand Down
6 changes: 6 additions & 0 deletions kibana/examples/default/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ http:
http://helm-kibana-default-kibana:5601/app/kibana:
status: 200
timeout: 2000

port:
tcp:5601:
listening: true
ip:
- '0.0.0.0'
6 changes: 6 additions & 0 deletions kibana/examples/security/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ secretMounts:
- name: kibana-certificates
secretName: kibana-certificates
path: /usr/share/kibana/config/certs/kibana

port:
tcp:5601:
listening: true
ip:
- '0.0.0.0'
2 changes: 2 additions & 0 deletions kibana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ spec:
- name: ELASTICSEARCH_HOSTS
value: "{{ .Values.elasticsearchHosts }}"
{{- end }}
- name: SERVER_HOST
value: "{{ .Values.serverHost }}"
{{- if .Values.extraEnvs }}
{{ toYaml .Values.extraEnvs | indent 10 }}
{{- end }}
Expand Down
14 changes: 14 additions & 0 deletions kibana/tests/kibana_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ def test_defaults():
assert c['env'][0]['name'] == 'ELASTICSEARCH_HOSTS'
assert c['env'][0]['value'] == elasticsearchHosts

assert c['env'][1]['name'] == 'SERVER_HOST'
assert c['env'][1]['value'] == '0.0.0.0'

assert 'http "/app/kibana"' in c['readinessProbe']['exec']['command'][-1]

# Empty customizable defaults
Expand Down Expand Up @@ -291,3 +294,14 @@ def test_adding_a_nodePort():
r = helm_template(config)

assert r['service'][name]['spec']['ports'][0]['nodePort'] == 30001

def test_override_the_serverHost():
config = '''
serverHost: "localhost"
'''

r = helm_template(config)

c = r['deployment'][name]['spec']['template']['spec']['containers'][0]
assert c['env'][1]['name'] == 'SERVER_HOST'
assert c['env'][1]['value'] == 'localhost'
2 changes: 2 additions & 0 deletions kibana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ resources:

protocol: http

serverHost: "0.0.0.0"

healthCheckPath: "/app/kibana"

# Allows you to add any config files in /usr/share/kibana/config/
Expand Down