
Kubernetes initiates "graceful shutdown" by sending SIGTERM to pid 1. The way the existing startup scripts worked, this signal arrived at the shell wrapper, not elasticsearch, and the shell wrapper exited, killing the container immediately. Before this change: 1 ? Ss 0:00 /bin/sh -c /run.sh 6 ? S 0:00 /bin/bash /run.sh 13 ? S 0:00 \_ /bin/su -c /elasticsearch/bin/elasticsearch elasticsearch 14 ? Ss 0:00 \_ sh -c /elasticsearch/bin/elasticsearch 15 ? Sl 19:18 \_ /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java ... org.elasticsearch.bootstrap.Elasticsearch start After this change: 1 ? Ssl 0:29 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java ... org.elasticsearch.bootstrap.Elasticsearch start
32 lines
1.0 KiB
Makefile
Executable File
32 lines
1.0 KiB
Makefile
Executable File
# Copyright 2016 The Kubernetes Authors.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
.PHONY: elasticsearch_logging_discovery build push
|
|
|
|
# The current value of the tag to be used for building and
|
|
# pushing an image to gcr.io
|
|
TAG = v2.4.1-2
|
|
|
|
build: elasticsearch_logging_discovery
|
|
docker build --pull -t gcr.io/google_containers/elasticsearch:$(TAG) .
|
|
|
|
push:
|
|
gcloud docker -- push gcr.io/google_containers/elasticsearch:$(TAG)
|
|
|
|
elasticsearch_logging_discovery:
|
|
go build -a -ldflags "-w" elasticsearch_logging_discovery.go
|
|
|
|
clean:
|
|
rm elasticsearch_logging_discovery
|