diff --git a/cluster/addons/fluentd-elasticsearch/es-controller.yaml b/cluster/addons/fluentd-elasticsearch/es-controller.yaml index 75ff11205b4..7fc0d231b15 100644 --- a/cluster/addons/fluentd-elasticsearch/es-controller.yaml +++ b/cluster/addons/fluentd-elasticsearch/es-controller.yaml @@ -21,7 +21,7 @@ spec: kubernetes.io/cluster-service: "true" spec: containers: - - image: gcr.io/google_containers/elasticsearch:v2.4.1-1 + - image: gcr.io/google_containers/elasticsearch:v2.4.1-2 name: elasticsearch-logging resources: # need more cpu upon initialization, therefore burstable class diff --git a/cluster/addons/fluentd-elasticsearch/es-image/Dockerfile b/cluster/addons/fluentd-elasticsearch/es-image/Dockerfile index 1e26aa6dfd7..6e8b6ec0f8b 100644 --- a/cluster/addons/fluentd-elasticsearch/es-image/Dockerfile +++ b/cluster/addons/fluentd-elasticsearch/es-image/Dockerfile @@ -23,7 +23,7 @@ ENV DEBIAN_FRONTEND noninteractive ENV ELASTICSEARCH_VERSION 2.4.1 RUN apt-get update \ - && apt-get install -y curl \ + && apt-get install -y curl gosu \ && apt-get clean RUN set -x \ @@ -48,4 +48,4 @@ RUN useradd --no-create-home --user-group elasticsearch \ VOLUME ["/data"] EXPOSE 9200 9300 -CMD /run.sh \ No newline at end of file +CMD ["/run.sh"] diff --git a/cluster/addons/fluentd-elasticsearch/es-image/Makefile b/cluster/addons/fluentd-elasticsearch/es-image/Makefile index f6bba5a25e0..8e11043a5d7 100755 --- a/cluster/addons/fluentd-elasticsearch/es-image/Makefile +++ b/cluster/addons/fluentd-elasticsearch/es-image/Makefile @@ -16,7 +16,7 @@ # The current value of the tag to be used for building and # pushing an image to gcr.io -TAG = v2.4.1-1 +TAG = v2.4.1-2 build: elasticsearch_logging_discovery docker build --pull -t gcr.io/google_containers/elasticsearch:$(TAG) . diff --git a/cluster/addons/fluentd-elasticsearch/es-image/elasticsearch_logging_discovery.go b/cluster/addons/fluentd-elasticsearch/es-image/elasticsearch_logging_discovery.go index 265000be66a..eeccc823726 100644 --- a/cluster/addons/fluentd-elasticsearch/es-image/elasticsearch_logging_discovery.go +++ b/cluster/addons/fluentd-elasticsearch/es-image/elasticsearch_logging_discovery.go @@ -24,7 +24,7 @@ import ( "time" "github.com/golang/glog" - meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" restclient "k8s.io/client-go/rest" "k8s.io/kubernetes/pkg/api" clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" @@ -56,7 +56,7 @@ func main() { namespace := metav1.NamespaceSystem envNamespace := os.Getenv("NAMESPACE") if envNamespace != "" { - if _, err := client.Core().Namespaces().Get(envNamespace, meta_v1.GetOptions{}); err != nil { + if _, err := client.Core().Namespaces().Get(envNamespace, metav1.GetOptions{}); err != nil { glog.Fatalf("%s namespace doesn't exist: %v", envNamespace, err) } namespace = envNamespace @@ -66,7 +66,7 @@ func main() { // Look for endpoints associated with the Elasticsearch loggging service. // First wait for the service to become available. for t := time.Now(); time.Since(t) < 5*time.Minute; time.Sleep(10 * time.Second) { - elasticsearch, err = client.Core().Services(namespace).Get("elasticsearch-logging", meta_v1.GetOptions{}) + elasticsearch, err = client.Core().Services(namespace).Get("elasticsearch-logging", metav1.GetOptions{}) if err == nil { break } @@ -83,7 +83,7 @@ func main() { // Wait for some endpoints. count := 0 for t := time.Now(); time.Since(t) < 5*time.Minute; time.Sleep(10 * time.Second) { - endpoints, err = client.Core().Endpoints(namespace).Get("elasticsearch-logging", meta_v1.GetOptions{}) + endpoints, err = client.Core().Endpoints(namespace).Get("elasticsearch-logging", metav1.GetOptions{}) if err != nil { continue } diff --git a/cluster/addons/fluentd-elasticsearch/es-image/run.sh b/cluster/addons/fluentd-elasticsearch/es-image/run.sh index 6d334f693f1..137557b25d6 100755 --- a/cluster/addons/fluentd-elasticsearch/es-image/run.sh +++ b/cluster/addons/fluentd-elasticsearch/es-image/run.sh @@ -25,4 +25,4 @@ export MINIMUM_MASTER_NODES=${MINIMUM_MASTER_NODES:-2} chown -R elasticsearch:elasticsearch /data -/bin/su -c /elasticsearch/bin/elasticsearch elasticsearch +exec gosu elasticsearch /elasticsearch/bin/elasticsearch