-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathelasticsearch-stack.yaml
More file actions
52 lines (52 loc) · 2.46 KB
/
Copy pathelasticsearch-stack.yaml
File metadata and controls
52 lines (52 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
apiVersion: v1
kind: kbrew
app:
pre_install:
- apps:
- eck-operator
repository:
name: elastic
url: https://raw.githubusercontent.com/elastic/cloud-on-k8s/1.6/config/recipes/logstash/logstash.yaml
type: raw
namespace: "elastic-system"
sha256:
version: 1.6.0
post_install:
- steps:
- |
# Wait for ElasticSearch to be ready
echo "Waiting for ElasticSearch cluster to be ready"
retry=0
while true;
do
currentState=$(kubectl -n elastic-system get elasticsearches elasticsearch -o jsonpath='{.status.health}')
if [ ! -z "${currentState}" ] && [ "${currentState}" = "green" ]; then break; fi
if [ "${retry}" = 60 ]; then echo "timed out while waiting for Elasticsearch cluster to be ready"; exit 1; fi
sleep 10
retry=$((retry+1))
done
- |
# Wait for Kibana to be ready
echo "Waiting for Kibana cluster to be ready"
retry=0
while true;
do
currentState=$(kubectl -n elastic-system get kibana kibana -o jsonpath='{.status.health}')
if [ ! -z "${currentState}" ] && [ "${currentState}" = "green" ]; then break; fi
if [ "${retry}" = 60 ]; then echo "timed out while waiting for Kibana to be ready"; exit 1; fi
sleep 10
retry=$((retry+1))
done
- |
# Print console info
echo "NOTE:"
echo "Port forward with following command to access elasticsearch console - "
echo "kubectl port-forward service/elasticsearch-es-http 9200 -n elastic-system"
echo "ElasticSearch User: elastic"
echo "ElasticSearch Password: $(kubectl -n elastic-system get secret elasticsearch-es-elastic-user -o go-template='{{.data.elastic | base64decode}}')"
echo "Request localhost - curl -u "elastic:$PASSWORD" -k 'https://localhost:9200'"
echo "Access Kibana UI"
echo "Port forward with following command to access Kibana console - "
echo "kubectl port-forward service/kibana-kb-http 5601 -n elastic-system'"
echo "Open https://localhost:5601 in your browser. Your browser will show a warning because the self-signed certificate configured by default is not verified by a known certificate authority and not trusted by your browser. You can temporarily acknowledge the warning for the purposes of this quick start but it is highly recommended that you configure valid certificates for any production deployments."
echo "Use the Elasticseach credentials printed above to login to the Kibana."