|
| 1 | +apiVersion: v1 |
| 2 | +kind: kbrew |
| 3 | +app: |
| 4 | + pre_install: |
| 5 | + - apps: |
| 6 | + - eck-operator |
| 7 | + repository: |
| 8 | + name: elastic |
| 9 | + url: https://raw.githubusercontent.com/elastic/cloud-on-k8s/1.6/config/recipes/logstash/logstash.yaml |
| 10 | + type: raw |
| 11 | + namespace: "elastic-system" |
| 12 | + sha256: |
| 13 | + version: 1.6.0 |
| 14 | + post_install: |
| 15 | + - steps: |
| 16 | + - | |
| 17 | + # Wait for ElasticSearch to be ready |
| 18 | + echo "Waiting for ElasticSearch cluster to be ready" |
| 19 | + retry=0 |
| 20 | + while true; |
| 21 | + do |
| 22 | + currentState=$(kubectl -n elastic-system get elasticsearches elasticsearch -o jsonpath='{.status.health}') |
| 23 | + if [ ! -z "${currentState}" ] && [ "${currentState}" = "green" ]; then break; fi |
| 24 | + if [ "${retry}" = 60 ]; then echo "timed out while waiting for Elasticsearch cluster to be ready"; exit 1; fi |
| 25 | + sleep 10 |
| 26 | + retry=$((retry+1)) |
| 27 | + done |
| 28 | + - | |
| 29 | + # Wait for Kibana to be ready |
| 30 | + echo "Waiting for Kibana cluster to be ready" |
| 31 | + retry=0 |
| 32 | + while true; |
| 33 | + do |
| 34 | + currentState=$(kubectl -n elastic-system get kibana kibana -o jsonpath='{.status.health}') |
| 35 | + if [ ! -z "${currentState}" ] && [ "${currentState}" = "green" ]; then break; fi |
| 36 | + if [ "${retry}" = 60 ]; then echo "timed out while waiting for Kibana to be ready"; exit 1; fi |
| 37 | + sleep 10 |
| 38 | + retry=$((retry+1)) |
| 39 | + done |
| 40 | + - | |
| 41 | + # Print console info |
| 42 | + echo "NOTE:" |
| 43 | + echo "Port forward with following command to access elasticsearch console - " |
| 44 | + echo "kubectl port-forward service/elasticsearch-es-http 9200 -n elastic-system" |
| 45 | + echo "ElasticSearch User: elastic" |
| 46 | + echo "ElasticSearch Password: $(kubectl -n elastic-system get secret elasticsearch-es-elastic-user -o go-template='{{.data.elastic | base64decode}}')" |
| 47 | + echo "Request localhost - curl -u "elastic:$PASSWORD" -k 'https://localhost:9200'" |
| 48 | + echo "Access Kibana UI" |
| 49 | + echo "Port forward with following command to access Kibana console - " |
| 50 | + echo "kubectl port-forward service/kibana-kb-http 5601 -n elastic-system'" |
| 51 | + 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." |
| 52 | + echo "Use the Elasticseach credentials printed above to login to the Kibana." |
0 commit comments