Skip to content

Commit

Permalink
upd kibana to support LB
Browse files Browse the repository at this point in the history
- based on PR: elastic#539

Signed-off-by: Max Kovgan <max@opsguru.io>
  • Loading branch information
Max Kovgan committed May 15, 2020
1 parent e0cf8c1 commit 2c3d442
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 16 deletions.
35 changes: 19 additions & 16 deletions kibana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@ for supported version.
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [Requirements](#requirements)
- [Installing](#installing)
- [Install released version using Helm repository](#install-released-version-using-helm-repository)
- [Install development version using master branch](#install-development-version-using-master-branch)
- [Upgrading](#upgrading)
- [Compatibility](#compatibility)
- [Usage notes](#usage-notes)
- [Configuration](#configuration)
- [Deprecated](#deprecated)
- [FAQ](#faq)
- [How to deploy this chart on a specific K8S distribution?](#how-to-deploy-this-chart-on-a-specific-k8s-distribution)
- [How to use Kibana with security (authentication and TLS) enabled?](#how-to-use-kibana-with-security-authentication-and-tls-enabled)
- [How to install OSS version of Kibana?](#how-to-install-oss-version-of-kibana)
- [How to install plugins?](#how-to-install-plugins)
- [How to import objects post-deployment?](#how-to-import-objects-post-deployment)
- [Contributing](#contributing)
- [Kibana Helm Chart](#kibana-helm-chart)
- [Requirements](#requirements)
- [Installing](#installing)
- [Install released version using Helm repository](#install-released-version-using-helm-repository)
- [Install development version using master branch](#install-development-version-using-master-branch)
- [Upgrading](#upgrading)
- [Compatibility](#compatibility)
- [Usage notes](#usage-notes)
- [Configuration](#configuration)
- [Deprecated](#deprecated)
- [FAQ](#faq)
- [How to deploy this chart on a specific K8S distribution?](#how-to-deploy-this-chart-on-a-specific-k8s-distribution)
- [How to use Kibana with security (authentication and TLS) enabled?](#how-to-use-kibana-with-security-authentication-and-tls-enabled)
- [How to install OSS version of Kibana?](#how-to-install-oss-version-of-kibana)
- [How to install plugins?](#how-to-install-plugins)
- [How to import objects post-deployment?](#how-to-import-objects-post-deployment)
- [Contributing](#contributing)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- Use this to update TOC: -->
Expand Down Expand Up @@ -112,6 +113,8 @@ as a reference. They are also used in the automated testing of this chart.
| `ingress` | Configurable [ingress][] to expose the Kibana service. | see [values.yaml][] |
| `kibanaConfig` | Allows you to add any config files in `/usr/share/kibana/config/` such as `kibana.yml` See [values.yaml][] for an example of the formatting | `{}` |
| `labels` | Configurable [labels][] applied to all Kibana pods | `{}` |
| `loadBalancerIP` | Some cloud providers allow you to specify the loadBalancerIP. If the loadBalancerIP field is not specified, the IP is dynamically assigned. If you specify a loadBalancerIP but your cloud provider does not support the feature, the `loadbalancerIP` field is ignored. [LoadBalancer options](https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) | `""` |

| `lifecycle` | Allows you to add [lifecycle hooks][]. See [values.yaml][] for an example of the formatting | `{}` |
| `nameOverride` | Overrides the chart name for resources. If not set the name will default to `.Chart.Name` | `""` |
| `nodeSelector` | Configurable [nodeSelector][] so that you can target specific nodes for your Kibana instances | `{}` |
Expand Down
3 changes: 3 additions & 0 deletions kibana/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ metadata:
{{- end }}
spec:
type: {{ .Values.service.type }}
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
{{- with .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml . | indent 4 }}
Expand Down
17 changes: 17 additions & 0 deletions kibana/tests/kibana_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,23 @@ def test_adding_a_nodePort():

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

def test_adding_a_loadBalancerIP():
config = ""

r = helm_template(config)

assert "loadBalancerIP" not in r["service"][name]["spec"]

config = """
service:
loadBalancerIP: 12.4.19.81
"""

r = helm_template(config)

assert r["service"][name]["spec"]["loadBalancerIP"] == "12.4.19.81"



def test_override_the_serverHost():
config = """
Expand Down
1 change: 1 addition & 0 deletions kibana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ service:
# service.beta.kubernetes.io/azure-load-balancer-internal: "true"
# service.beta.kubernetes.io/openstack-internal-load-balancer: "true"
# service.beta.kubernetes.io/cce-load-balancer-internal-vpc: "true"
loadBalancerIP: ""
loadBalancerSourceRanges: []
# 0.0.0.0/0

Expand Down

0 comments on commit 2c3d442

Please sign in to comment.