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

Commit

Permalink
[kibana] Make health check path configurable
Browse files Browse the repository at this point in the history
Fixes: #103
  • Loading branch information
Crazybus committed Apr 18, 2019
1 parent 83be534 commit 3c029d7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions kibana/README.md
Expand Up @@ -50,6 +50,7 @@ helm install --name kibana elastic/kibana --version 7.0.0-alpha1 --set imageTag=
| `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` |
| `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 | `{}` |
| `serviceAccount` | Allows you to overwrite the "default" [serviceAccount](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/) for the pod | `[]` |
Expand Down
2 changes: 1 addition & 1 deletion kibana/templates/deployment.yaml
Expand Up @@ -91,7 +91,7 @@ spec:
curl -k "$@" "{{ .Values.protocol }}://localhost:{{ .Values.httpPort }}${path}"
}
http "/app/kibana"
http "{{ .Values.healthCheckPath }}"
ports:
- containerPort: {{ .Values.httpPort }}
resources:
Expand Down
11 changes: 11 additions & 0 deletions kibana/tests/kibana_test.py
Expand Up @@ -30,6 +30,8 @@ def test_defaults():
assert c['env'][0]['name'] == 'ELASTICSEARCH_HOSTS'
assert c['env'][0]['value'] == elasticsearchHosts

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

# Empty customizable defaults
assert 'imagePullSecrets' not in r['deployment'][name]['spec']['template']['spec']
assert 'tolerations' not in r['deployment'][name]['spec']['template']['spec']
Expand Down Expand Up @@ -224,3 +226,12 @@ def test_changing_the_protocol():
r = helm_template(config)
c = r['deployment'][name]['spec']['template']['spec']['containers'][0]
assert 'https://' in c['readinessProbe']['exec']['command'][-1]

def test_changing_the_health_check_path():
config = '''
healthCheckPath: "/kibana/app/kibana"
'''
r = helm_template(config)
c = r['deployment'][name]['spec']['template']['spec']['containers'][0]

assert 'http "/kibana/app/kibana"' in c['readinessProbe']['exec']['command'][-1]
2 changes: 2 additions & 0 deletions kibana/values.yaml
Expand Up @@ -34,6 +34,8 @@ resources:

protocol: http

healthCheckPath: "/app/kibana"

# Allows you to add any config files in /usr/share/kibana/config/
# such as kibana.yml
kibanaConfig: {}
Expand Down

0 comments on commit 3c029d7

Please sign in to comment.