Skip to content

Commit a28669e

Browse files
author
ameydev
committed
- Recipe for elasticsearch installation using helm chart
- Recipe for ELC stack with eck-operator
1 parent a3ed9a7 commit a28669e

5 files changed

Lines changed: 98 additions & 0 deletions

File tree

recipes/eck-operator.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: kbrew
3+
app:
4+
repository:
5+
name: elastic
6+
url: https://helm.elastic.co
7+
type: helm
8+
namespace: "elastic-system"
9+
sha256:
10+
version: 1.6.0

recipes/elasticsearch-stack.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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."

recipes/elasticsearch.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: kbrew
3+
app:
4+
args:
5+
replicas: 1
6+
repository:
7+
name: elastic
8+
url: https://helm.elastic.co
9+
type: helm
10+
namespace: ""
11+
sha256:
12+
version: 7.13.0
13+
post_install:
14+
- apps:
15+
- kibana
16+
- logstash

recipes/kibana.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: kbrew
3+
app:
4+
repository:
5+
name: elastic
6+
url: https://helm.elastic.co
7+
type: helm
8+
namespace: ""
9+
sha256:
10+
version: 7.13.0

recipes/logstash.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: kbrew
3+
app:
4+
repository:
5+
name: elastic
6+
url: https://helm.elastic.co
7+
type: helm
8+
namespace: ""
9+
sha256:
10+
version: 7.13.0

0 commit comments

Comments
 (0)