Skip to content

Commit

Permalink
create specific headless service for elasticsearch
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnitzel committed Mar 11, 2019
1 parent dc07d6e commit 41164bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions images/elasticsearch/configure-es.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ function join {
local IFS="$1"; shift; echo "$*";
}

HOSTNAME=$(hostname)
# Parse out cluster name, from service name:
CLUSTER_NAME="$(hostname -f | cut -d'.' -f2)"

while read -ra LINE; do
if [[ "${LINE}" == *"${HOSTNAME}"* ]]; then
MY_NAME=$LINE
Expand Down
2 changes: 1 addition & 1 deletion images/elasticsearch/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ else
# Is running in Kubernetes/OpenShift, so find all other pods
# belonging to the namespace
echo "Elasticsearch: Finding peers"
K8S_SVC_NAME=$(hostname -f | cut -d"." -f2)
K8S_SVC_NAME=$SERVICE_NAME-headless
echo "Using service name: ${K8S_SVC_NAME}"
# copy the pristine version to the one that can be edited
/usr/bin/peer-finder -on-start="/lagoon/configure-es.sh" -service=${K8S_SVC_NAME}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ objects:
service: ${SERVICE_NAME}
branch: ${SAFE_BRANCH}
project: ${SAFE_PROJECT}
name: ${SERVICE_NAME}
name: ${SERVICE_NAME}-headless
spec:
clusterIP: None
ports:
Expand All @@ -65,7 +65,7 @@ objects:
service: ${SERVICE_NAME}
branch: ${SAFE_BRANCH}
project: ${SAFE_PROJECT}
name: ${SERVICE_NAME}-service
name: ${SERVICE_NAME}
spec:
ports:
- name: 9200-tcp
Expand Down

0 comments on commit 41164bb

Please sign in to comment.