forked from develeap/efk-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
43 lines (38 loc) · 1.05 KB
/
install.sh
File metadata and controls
43 lines (38 loc) · 1.05 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
#!/bin/bash
POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do
case $1 in
-n|--namespace)
NAMESPACE="$2"
shift # past argument
shift # past value
;;
-p|--password)
KIBANA_PWD="$2"
shift # past argument
shift # past value
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1") # save positional arg
shift # past argument
;;
esac
done
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
if [[ -n $1 ]]; then
echo "Last line of file specified as non-opt/last argument:"
tail -1 "$1"
fi
if [ -z "${NAMESPACE}"] || [ -z "${KIBANA_PWD}" ]; then
echo "USAGE: ./install.sh -n NAMESPACE -p KIBANA_PWD"
exit 1
fi
/usr/local/bin/helm repo add elastic https://helm.elastic.co
/usr/local/bin/helm repo update
kubectl create ns ${NAMESPACE}
/usr/local/bin/helm upgrade --install elastic-operator elastic/eck-operator -n ${NAMESPACE}
/usr/local/bin/helm upgrade --install eck-stack eck-stack/ -n ${NAMESPACE} --set kibana.secret.pwd=${KIBANA_PWD}