Address errors with Elasticsearch and Kibana

This moves Elasticsearch and Kibana to use the latest version
(6.2.2), as the images we were using are no longer supported with
the 6.x release.  There was a change in the doc reference in the
log entries that prevented the previous ES version from indexing
those entries, resulting in a busted gate.  Moving Kibana to 6.2.2
was required to match major/minor versions with Elasticsearch

The Elasticsearch version change also required changing config file
locations, changing the entrypoint used for launching the service,
changing the running user for the elasticsearch service, and
updated the ES tests as some of the API responses changed between
versions

This also required updating the elasticsearch template job as the
mapping definition entries changed between versions

Change-Id: Ia4cd9a66851754a1bb8f225c7e24513c43568e93
This commit is contained in:
Steve Wilkerson 2018-03-06 13:29:44 -06:00
parent d6e9fa2c5a
commit d681396412
11 changed files with 29 additions and 37 deletions

View File

@ -20,7 +20,7 @@ COMMAND="${@:-start}"
function start () { function start () {
ulimit -l unlimited ulimit -l unlimited
exec /docker-entrypoint.sh elasticsearch exec /usr/local/bin/docker-entrypoint.sh
} }
function stop () { function stop () {

View File

@ -46,8 +46,8 @@ function insert_test_data () {
"name" : "Elasticsearch", "name" : "Elasticsearch",
"message" : "Test data text entry" "message" : "Test data text entry"
} }
' | python -c "import sys, json; print json.load(sys.stdin)['created']") ' | python -c "import sys, json; print json.load(sys.stdin)['result']")
if [ "$insert_result" == "True" ]; then if [ "$insert_result" == "created" ]; then
sleep 20 sleep 20
echo "PASS: Test data inserted into test index!"; echo "PASS: Test data inserted into test index!";
else else

View File

@ -207,8 +207,6 @@ spec:
mountPath: /tmp/elasticsearch.sh mountPath: /tmp/elasticsearch.sh
subPath: elasticsearch.sh subPath: elasticsearch.sh
readOnly: true readOnly: true
- name: elasticsearch-config
mountPath: /usr/share/elasticsearch/config
- name: elasticsearch-etc - name: elasticsearch-etc
mountPath: /usr/share/elasticsearch/config/elasticsearch.yml mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
subPath: elasticsearch.yml subPath: elasticsearch.yml
@ -233,8 +231,6 @@ spec:
configMap: configMap:
name: elasticsearch-bin name: elasticsearch-bin
defaultMode: 0555 defaultMode: 0555
- name: elasticsearch-config
emptyDir: {}
- name: elasticsearch-etc - name: elasticsearch-etc
configMap: configMap:
name: elasticsearch-etc name: elasticsearch-etc

View File

@ -121,8 +121,8 @@ spec:
{{ tuple $envAll "elasticsearch" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll "elasticsearch" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.master | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }} {{ tuple $envAll $envAll.Values.pod.resources.master | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
command: command:
- /tmp/elasticsearch.sh - /tmp/elasticsearch.sh
- start - start
lifecycle: lifecycle:
preStop: preStop:
exec: exec:
@ -163,8 +163,6 @@ spec:
mountPath: /tmp/elasticsearch.sh mountPath: /tmp/elasticsearch.sh
subPath: elasticsearch.sh subPath: elasticsearch.sh
readOnly: true readOnly: true
- name: elasticsearch-config
mountPath: /usr/share/elasticsearch/config
- name: elasticsearch-etc - name: elasticsearch-etc
mountPath: /usr/share/elasticsearch/config/elasticsearch.yml mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
subPath: elasticsearch.yml subPath: elasticsearch.yml
@ -187,8 +185,6 @@ spec:
configMap: configMap:
name: elasticsearch-bin name: elasticsearch-bin
defaultMode: 0555 defaultMode: 0555
- name: elasticsearch-config
emptyDir: {}
- name: elasticsearch-etc - name: elasticsearch-etc
configMap: configMap:
name: elasticsearch-etc name: elasticsearch-etc

View File

@ -118,8 +118,8 @@ spec:
{{ tuple $envAll "elasticsearch" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll "elasticsearch" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.data | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }} {{ tuple $envAll $envAll.Values.pod.resources.data | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
command: command:
- /tmp/elasticsearch.sh - /tmp/elasticsearch.sh
- start - start
lifecycle: lifecycle:
preStop: preStop:
exec: exec:
@ -160,8 +160,6 @@ spec:
mountPath: /tmp/elasticsearch.sh mountPath: /tmp/elasticsearch.sh
subPath: elasticsearch.sh subPath: elasticsearch.sh
readOnly: true readOnly: true
- name: elasticsearch-config
mountPath: /usr/share/elasticsearch/config
- name: elasticsearch-etc - name: elasticsearch-etc
mountPath: /usr/share/elasticsearch/config/elasticsearch.yml mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
subPath: elasticsearch.yml subPath: elasticsearch.yml
@ -184,8 +182,6 @@ spec:
configMap: configMap:
name: elasticsearch-bin name: elasticsearch-bin
defaultMode: 0555 defaultMode: 0555
- name: elasticsearch-config
emptyDir: {}
- name: elasticsearch-etc - name: elasticsearch-etc
configMap: configMap:
name: elasticsearch-etc name: elasticsearch-etc

View File

@ -21,7 +21,7 @@ images:
apache_proxy: docker.io/httpd:2.4 apache_proxy: docker.io/httpd:2.4
memory_init: docker.io/kolla/ubuntu-source-heat-engine:3.0.3 memory_init: docker.io/kolla/ubuntu-source-heat-engine:3.0.3
curator: docker.io/bobrik/curator:5.2.0 curator: docker.io/bobrik/curator:5.2.0
elasticsearch: docker.io/elasticsearch:5.6.4 elasticsearch: docker.elastic.co/elasticsearch/elasticsearch:6.2.2
helm_tests: docker.io/kolla/ubuntu-source-heat-engine:3.0.3 helm_tests: docker.io/kolla/ubuntu-source-heat-engine:3.0.3
prometheus_elasticsearch_exporter: docker.io/justwatch/elasticsearch_exporter:1.0.1 prometheus_elasticsearch_exporter: docker.io/justwatch/elasticsearch_exporter:1.0.1
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1 dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1
@ -248,6 +248,9 @@ conf:
blacklist: ['elasticsearch', 'urllib3'] blacklist: ['elasticsearch', 'urllib3']
elasticsearch: elasticsearch:
config: config:
xpack:
security:
enabled: false
bootstrap: bootstrap:
memory_lock: true memory_lock: true
cluster: cluster:

View File

@ -5,7 +5,8 @@ set -ex
sed 's/ ,//' /tmp/template.xml.raw > /tmp/template.xml sed 's/ ,//' /tmp/template.xml.raw > /tmp/template.xml
result=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \ result=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \
-XPUT "${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_template/template_fluent_logging" \ -XPUT "${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_template/template_fluent_logging" \
-H 'Content-Type: application/json' -d @/tmp/template.xml) -H 'Content-Type: application/json' -d @/tmp/template.xml \
| python -c "import sys, json; print json.load(sys.stdin)['acknowledged']")
if [ "$result" == "True" ]; then if [ "$result" == "True" ]; then
echo "template created!" echo "template created!"
else else

View File

@ -22,7 +22,7 @@ set -ex
# the logstash-* index via the fluent-elasticsearch plugin # the logstash-* index via the fluent-elasticsearch plugin
function check_logstash_index () { function check_logstash_index () {
total_hits=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \ total_hits=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \
-XGET "${ELASTICSEARCH_ENDPOINT}/logstash-*/fluentd/_search?pretty" -H 'Content-Type: application/json' \ -XGET "${ELASTICSEARCH_ENDPOINT}/logstash-*/_search?pretty" -H 'Content-Type: application/json' \
| python -c "import sys, json; print json.load(sys.stdin)['hits']['total']") | python -c "import sys, json; print json.load(sys.stdin)['hits']['total']")
if [ "$total_hits" -gt 0 ]; then if [ "$total_hits" -gt 0 ]; then
echo "PASS: Successful hits on logstash-* index, provided by fluentd!" echo "PASS: Successful hits on logstash-* index, provided by fluentd!"
@ -36,7 +36,7 @@ function check_logstash_index () {
# prefix via the fluent-kubernetes plugin # prefix via the fluent-kubernetes plugin
function check_kubernetes_tag () { function check_kubernetes_tag () {
total_hits=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \ total_hits=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \
-XGET "${ELASTICSEARCH_ENDPOINT}/logstash-*/fluentd/_search?q=tag:kube.*" -H 'Content-Type: application/json' \ -XGET "${ELASTICSEARCH_ENDPOINT}/logstash-*/_search?q=tag:kube.*" -H 'Content-Type: application/json' \
| python -c "import sys, json; print json.load(sys.stdin)['hits']['total']") | python -c "import sys, json; print json.load(sys.stdin)['hits']['total']")
if [ "$total_hits" -gt 0 ]; then if [ "$total_hits" -gt 0 ]; then
echo "PASS: Successful hits on logstash-* index, provided by fluentd!" echo "PASS: Successful hits on logstash-* index, provided by fluentd!"

View File

@ -169,42 +169,42 @@ conf:
number_of_shards: 5 number_of_shards: 5
number_of_replicas: 1 number_of_replicas: 1
mappings: mappings:
flb_type: _doc:
properties: properties:
kubernetes: kubernetes:
properties: properties:
container_name: container_name:
type: keyword type: keyword
index: not_analyzed index: false
docker_id: docker_id:
type: keyword type: keyword
index: not_analyzed index: false
host: host:
type: keyword type: keyword
index: not_analyzed index: false
labels: labels:
properties: properties:
app: app:
type: keyword type: keyword
index: not_analyzed index: false
application: application:
type: keyword type: keyword
index: not_analyzed index: false
component: component:
type: keyword type: keyword
index: not_analyzed index: false
release_group: release_group:
type: keyword type: keyword
index: not_analyzed index: false
namespace_name: namespace_name:
type: keyword type: keyword
index: not_analyzed index: false
pod_id: pod_id:
type: keyword type: keyword
index: not_analyzed index: false
pod_name: pod_name:
type: keyword type: keyword
index: not_analyzed index: false
log: log:
type: text type: text

View File

@ -90,6 +90,8 @@ spec:
- name: kibana - name: kibana
{{ tuple $envAll "kibana" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll "kibana" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.kibana | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.kibana | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
securityContext:
runAsUser: 1000
command: command:
- /tmp/kibana.sh - /tmp/kibana.sh
- start - start

View File

@ -20,7 +20,7 @@ labels:
images: images:
tags: tags:
apache_proxy: docker.io/httpd:2.4 apache_proxy: docker.io/httpd:2.4
kibana: docker.io/kibana:5.6.4 kibana: docker.elastic.co/kibana/kibana:6.2.2
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1 dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1
image_repo_sync: docker.io/docker:17.07.0 image_repo_sync: docker.io/docker:17.07.0
pull_policy: IfNotPresent pull_policy: IfNotPresent
@ -101,8 +101,6 @@ conf:
requestTimeout: 30000 requestTimeout: 30000
shardTimeout: 0 shardTimeout: 0
startupTimeout: 5000 startupTimeout: 5000
il8n:
defaultLocale: en
kibana: kibana:
defaultAppId: discover defaultAppId: discover
index: .kibana index: .kibana