Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit 5bbb170

Browse files
author
Bernd Kiefer
authored
Upgrade to elasticstack 6.4.3 (#9)
* merge back (#1) * Replace gas with gosec (#5) * Fix typo in Readme (#3) * bumping dockerfiles, charts and READMEs to 6.4.3
1 parent cc78c0f commit 5bbb170

File tree

8 files changed

+130
-101
lines changed

8 files changed

+130
-101
lines changed

README.md

Lines changed: 63 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,64 @@
66
These [Helm](https://github.com/kubernetes/helm) charts bootstrap a production ready [Elastic Stack](https://www.elastic.co/products) service on a Kubernetes cluster managed by [Azure Container Service (AKS)](https://docs.microsoft.com/en-us/azure/aks/intro-kubernetes) and other Azure services.
77

88
The following features are included:
9+
910
* Deployment for [Elasticsearch](https://www.elastic.co/products/elasticsearch), [Kibana](https://www.elastic.co/products/kibana) and [Logstash](https://www.elastic.co/products/logstash) services
1011
* Deployment script which retrieves the secrets and certificates from [Azure Key Vault](https://azure.microsoft.com/en-us/services/key-vault/) and injects them into the Helm charts
1112
* TLS termination and load balancing for Kibana using [NGINX Ingress Controller](https://github.com/kubernetes/ingress-nginx)
1213
* [Azure Active Directory](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-authentication-scenarios) authentication for Kibana
13-
* Integration with [Azure Redis Cache](https://azure.microsoft.com/en-us/services/cache/) which acts as middleware for log events between the Log Appenders and Logstash
14+
* Integration with [Azure Redis Cache](https://azure.microsoft.com/en-us/services/cache/) acting as middleware for log events between the Log Appenders and Logstash
1415
* TLS connection between Logstash and Redis Cache handled by [stunnel](https://www.stunnel.org/)
15-
* Support for [Multiple Data Pipelines](https://www.elastic.co/blog/logstash-multiple-pipelines) in Logstash which allows multiple Redis Caches as input (e.g one Redis cluster per environment)
16+
* Support for [Multiple Data Pipelines](https://www.elastic.co/blog/logstash-multiple-pipelines) in Logstash allowing multiple Redis Caches as input (e.g one Redis cluster per environment)
1617
* Installation of a [Curator](https://github.com/elastic/curator) cron job that cleans up daily all indexes which are older than 30 days
1718
* Installation of [Elasticsearch Index Templates](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-templates.html) as a pre-deployment step
1819
* Installation of [Elasticsearch Watches](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/watcher-api.html) as a post deployment step. The watches can be used for alerts and notifications over Microsoft Teams/Slack webhook or email
1920
* Installation of [Elasticsearch x-pack license](https://license.elastic.co/download) as a post deployment step
2021

21-
# Architecture
22+
<!-- TOC -->
23+
24+
- [Introduction](#introduction)
25+
- [Architecture](#architecture)
26+
- [Azure Resources](#azure-resources)
27+
- [Azure Key Vault](#azure-key-vault)
28+
- [Public Static IP and DNS Domain](#public-static-ip-and-dns-domain)
29+
- [Redis Cache](#redis-cache)
30+
- [Application for Azure Active Directory](#application-for-azure-active-directory)
31+
- [Microsoft Teams/Slack incoming Webhook](#microsoft-teamsslack-incoming-webhook)
32+
- [Customize Logstash Configuration](#customize-logstash-configuration)
33+
- [Multiple Data Pipelines](#multiple-data-pipelines)
34+
- [Indexes Clean Up](#indexes-clean-up)
35+
- [Index Templates](#index-templates)
36+
- [Index Watches](#index-watches)
37+
- [Elasticsearch License](#elasticsearch-license)
38+
- [Installation](#installation)
39+
- [NGINX Ingress Controller](#nginx-ingress-controller)
40+
- [Elasticsearch Cluster](#elasticsearch-cluster)
41+
- [Kibana and Logstash](#kibana-and-logstash)
42+
- [Rolling Update](#rolling-update)
43+
- [Contributing](#contributing)
44+
45+
<!-- /TOC -->
46+
47+
## Architecture
2248

2349
![architecture](images/architecture.png?row=true)
2450

25-
# Azure Resources
51+
## Azure Resources
2652

2753
A few Azure resources need to be provisioned before proceeding with the Helm charts installation.
2854

29-
## Azure Key Vault
55+
### Azure Key Vault
3056

3157
All secrets and certificates used by the charts are stored in an Azure Key Vault. The deployment script is able to fetch them and to inject them further into the charts.
3258

3359
You can create a new Key Vault with default permissions:
3460

3561
```console
36-
3762
az keyvault create --name <KEYVAULT_NAME> --resource-group <RESOURCE_GROUP>
3863
```
3964

4065
It is recommended that you use two different principals to operate the Key Vault:
66+
4167
* A _Security Operator_ who has read/write access to secrets, keys and certificates. This principal should be only used for setting up the Key Vault or rotate the secrets.
4268
* A _Deployment Operator_ who is only able to read secrets. This principal should be used to perform the deployment.
4369

@@ -49,7 +75,7 @@ az keyvault set-policy --upn <SECURITY_OPERATOR_USER_PRINCIPAL> --name <KEYVAULT
4975
az keyvault set-policy --upn <DEPLOYMENT_OPERATOR_USER_PRINCIPAL> --name <KEYVAULT_NAME> --resource-group <RESOURCE_GROP> --secret-permissions get list
5076
```
5177

52-
## Public Static IP and DNS Domain
78+
### Public Static IP and DNS Domain
5379

5480
You can allocate a public static IP in Azure. This IP will be used to expose Kibana to the world.
5581

@@ -78,9 +104,9 @@ The private key password must be also stored in a different secret, such that it
78104
az keyvault secret set --name kibana-certificate-key-password --vault-name <KEYVAULT_NAME> --value <PASSWORD>
79105
```
80106

81-
## Redis Cache
107+
### Redis Cache
82108

83-
The Azure Redis Cache is used as a middleware between the Log Appenders and Logstash service. This is quite scalable and it also decouples the Log Appenders from Elastic Stack service. You can use any Log Appender which is able to write log events into Redis.
109+
The Azure Redis Cache is used as a middleware between the Log Appenders and Logstash service. This is quite scalable and it also decouples the Log Appenders from Elastic Stack service. You can use any Log Appender which is able to write log events into Redis.
84110

85111
```console
86112
az redis create --name dev-logscache --location <LOCATION> --resrouce-group <RESOURCE_GROUP> --sku Standard --vm-size C1
@@ -93,7 +119,7 @@ You have to store one of the Redis Keys in Key Vault.
93119
az keyvault secret set --vault-name <KEYVAULT_NAME> --name logstash-dev-redis-key --value=<REDIS_KEY>
94120
```
95121

96-
## Application for Azure Active Directory
122+
### Application for Azure Active Directory
97123

98124
An Azure Active Directory application of type _Web app/API_ is required in order to use the AAD as an identity provider for Kibana. The authentication is provided by [oauth2_proxy](https://github.com/bitly/oauth2_proxy) reverse proxy which is deployed in the same POD as Kibana.
99125

@@ -119,8 +145,7 @@ az keyvault secret set --name kibana-oauth-cookie-secret --vault-name <KEYVAULT
119145

120146
You should also update the access list with the emails of the users from your organization which are allowed to access Kibana. The white list is in [oauth2-proxy-config-secret.yaml](charts/kibana-logstash/templates/secrets/oauth2-proxy-config-secret.yaml) file.
121147

122-
## Microsoft Teams/Slack incoming Webhook
123-
148+
### Microsoft Teams/Slack incoming Webhook
124149

125150
The [Elasticsearch Watcher](https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api.html) can post notifications into a webhook. For example, you can use a Microsoft Teams webhook, which can be created following these [instructions](https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/connectors).
126151

@@ -132,9 +157,9 @@ az keyvault secret set --vault-name <KEYVAULT_NAME> -n elasticsearch-watcher-web
132157

133158
If you want instead to use a [Slack Incoming Webhook](https://api.slack.com/incoming-webhooks), you can adjust the configuration in the [post-install-watches-secret.yaml](charts/kibana-logstash/templates/post-install-watches-secret.yaml) file.
134159

135-
# Customize Logstash Configuration
160+
## Customize Logstash Configuration
136161

137-
## Multiple Data Pipelines
162+
### Multiple Data Pipelines
138163

139164
Multiple data pipelines can be defined in the [values.yaml](charts/kibana-logstash/environments/acs/values.yaml) file by creating multiple `stunnel` connections as follows:
140165

@@ -159,77 +184,77 @@ stunnel:
159184
port: 6378
160185
```
161186
162-
## Indexes Clean Up
187+
### Indexes Clean Up
163188
164-
The old indexes are cleaned up by the [Curator](https://github.com/elastic/curator) tool which is executed daily by a cron job. Its configuration is available in [curator-actions.yaml](charts/kibana-logstash/templates/config/curator-actions.yaml) file. You should adjust it according with your needs.
189+
The old indexes are cleaned up by the [Curator](https://github.com/elastic/curator) tool which is executed daily by a cron job. Its configuration is available in [curator-actions.yaml](charts/kibana-logstash/templates/config/curator-actions.yaml) file. You should adjust it according to your needs.
165190
166-
## Index Templates
191+
### Index Templates
167192
168193
The [Elasticsearch Index Templates](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) are installed automatically by a pre-install job. They are defined in the [pre-install-templates-config.yaml](charts/kibana-logstash/templates/pre-install-templates-config.yaml) file.
169194
170-
## Index Watches
171-
The [Elasticsearch Watches](https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api.html) are also installed automatically by a post-install job. They can be used to trigger any alert or notification based on search queries. The watches configuration is available in [post-install-watches-secret.yaml](charts/kibana-logstash/templates/post-install-watches-secret.yaml) file. You should update this configuration according with you needs.
195+
### Index Watches
172196
173-
## Elasticsearch License
197+
The [Elasticsearch Watches](https://www.elastic.co/guide/en/elasticsearch/reference/master/watcher-api.html) are also installed automatically by a post-install job. They can be used to trigger any alert or notification based on search queries. The watches configuration is available in [post-install-watches-secret.yaml](charts/kibana-logstash/templates/post-install-watches-secret.yaml) file. You should update this configuration according to your needs.
174198
199+
### Elasticsearch License
175200
176201
In case you have an [Elasticsearch x-pack license](https://license.elastic.co/download), you can install it when [elasticsearch chart](charts/elasticsearch/README.md) is deployed.
177202
178-
# Installation
203+
## Installation
179204
180-
## NGINX Ingress Controller
205+
### NGINX Ingress Controller
181206
182-
The `nginx-ingress` will act as a frontend load balancer and it will provide TLS termination for Kibana public endpoint. You can get the latest version from [kubernetes/charts/stable/nginx-ingress](https://github.com/kubernetes/charts/tree/master/stable/nginx-ingress). Before starting the installation, you have to update a few Helm values from `values.yaml` file.
207+
The `nginx-ingress` will act as a frontend load balancer and it will provide TLS termination for the Kibana public endpoint. Get the latest version from [kubernetes/charts/stable/nginx-ingress](https://github.com/kubernetes/charts/tree/master/stable/nginx-ingress). Before starting the installation, updating e a few Helm values from `values.yaml` file is necessary.
183208

184-
You should enable the Kubernetes RBAC by setting:
209+
Enable the Kubernetes RBAC by setting:
185210

186211
```console
187212
rbac.create=true
188213
```
189214

190-
And set your static public IP allocated in Azure, as a load balancer frontend IP:
215+
And set the static public IP allocated in Azure, as a load balancer frontend IP:
191216

192217
```console
193218
controller.service.loadBalancerIP: "<YOUR PUBLIC IP>"
194219
```
195220

196-
You can install now the helm package with the following commands:
221+
Install now the helm package with the following commands:
197222

198223
```console
199224
cd charts/stable/nginx-ingress
200225
helm install -f values.yaml -n nginx-ingress .
201226
```
202227

203-
After the installation is done, you should verify that your public IP is properly assigned to the controller.
228+
After the installation is done, verify that the public IP is properly assigned to the controller.
204229

205230
```console
206231
$> kubectl get svc nginx-ingress-nginx-ingress-controller
207232
208233
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
209-
nginx-ingress-nginx-ingress-controller LoadBalancer 10.0.26.141 <YOUR-PUBLIC-IP> 80:32321/TCP,443:31990/TCP 10m
234+
nginx-ingress-nginx-ingress-controller LoadBalancer 10.0.26.141 <YOUR-PUBLIC-IP> 80:32321/TCP,443:31990/TCP 10m
210235
```
211236

212-
## Elaticsearch Cluster
237+
### Elasticsearch Cluster
213238

214-
Kibana requires an Elasticsearch cluster which can be installed using the [elasticsearch chart](charts/elasticsearch/README.md). You can create a deployment using the `deploy.sh` script available in the chart. Check the [README](charts/elasticsearch/README.md) file for more details:
239+
Kibana requires an Elasticsearch cluster which can be installed using the [elasticsearch chart](charts/elasticsearch/README.md). Create a deployment using the `deploy.sh` script available in the chart. Check the [README](charts/elasticsearch/README.md) file for more details:
215240

216241
```console
217242
./deploy.sh -e acs -n elk
218243
```
219244

220245
The command will install an Elasticsearch cluster in the `elk` namespace using the `acs` environment variables.
221246

222-
## Kibana and Logstash
247+
### Kibana and Logstash
223248

224249
You can install now the [kibana-logstash](charts/kibana-logstash) chart using the `deploy.sh` script available in the chart. Check the [README](charts/kibana-logstash/README.md) file for more details.
225250

226251
```console
227252
./deploy.sh -n elk -d <DOMAIN> -v <KEYVAULT_NAME>
228-
229253
```
230-
> Note that you have to replace the `DOMAIN` with your Kibana DNS domain and the `KEYVAULT_NAME` with your Azure Key Vault name.
231254

232-
This command will install Kibana and Logstash in the `elk` namespace using the `acs` environment variables. If everything works well, you should see the following output:
255+
> Note to replace the `DOMAIN` with the Kibana DNS domain and the `KEYVAULT_NAME` with the Azure Key Vault name.
256+
257+
This command installs Kibana and Logstash in the `elk` namespace using the `acs` environment variables. If everything works well, the following output should be shown:
233258

234259
```console
235260
Checking az command
@@ -245,7 +270,7 @@ Installing mse-elk helm chart
245270
Done
246271
```
247272

248-
And your deployment should look like this:
273+
And the deployment should look like this:
249274

250275
```console
251276
$> kubectl get pods --namespace elk
@@ -273,16 +298,15 @@ nginx-ingress-nginx-ingress-controller-7f7488c7c7-wkx42 1/1 Running
273298
nginx-ingress-nginx-ingress-default-backend-7c8bbc9879-cvl79 1/1 Running 0 1h
274299
```
275300

276-
# Rolling Update
301+
### Rolling Update
277302

278303
You can upgrade the charts after the initial installation whenever you have a change, by simply executing again the deployment scripts with the same arguments. Helm will create a new release for you.
279304

280-
281-
# Contributing
305+
## Contributing
282306

283307
This project welcomes contributions and suggestions. Most contributions require you to agree to a
284308
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
285-
the rights to use your contribution. For details, visit https://cla.microsoft.com.
309+
the rights to use your contribution. For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).
286310

287311
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
288312
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions

charts/elasticsearch/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
# Elasticsearch helm chart
2+
13
## Introduction
24

35
This chart bootstraps an [Elasticsearch cluster](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html) on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
46

57
It is based on [clockworksoul/helm-elasticsearch](https://github.com/clockworksoul/helm-elasticsearch) chart.
68

79
## Prerequisites
8-
- Kubernetes 1.8+ e.g. deployed with [Azure Container Service (AKS)](https://docs.microsoft.com/en-us/azure/aks/intro-kubernetes)
10+
11+
- Kubernetes 1.8+ e.g. deployed with [Azure Container Service (AKS)](https://docs.microsoft.com/en-us/azure/aks/intro-kubernetes)
912

1013
## Configuration
1114

@@ -14,7 +17,7 @@ The following table lists some of the configurable parameters of the `elasticsea
1417
| Parameter | Description | Default |
1518
| ---------------------------------------------- | ---------------------------------------- | --------------------------------------------------------- |
1619
| `image.repository` | elasticsearch image with Azure repository | `mseoss/elasticsearch` |
17-
| `image.tag` | specify image tag | `6.2.4` |
20+
| `image.tag` | specify image tag | `6.4.3` |
1821
| `image.pullSecrets` | specify image pull secrets | `nil` (does not add image pull secrets to deployed pods) |
1922
| `image.pullPolicy` | image pull policy | `Always` |
2023
| `license.install` | install x-pack license | `false` |

charts/elasticsearch/environments/acs/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
image:
22
repository: mseoss/elasticsearch
3-
tag: 6.2.4
3+
tag: 6.4.3
44
pullPolicy: Always
55

66
license:

0 commit comments

Comments
 (0)