From 523c9d77dfe6ad8a7d3b93875721301c9487f62b Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 21 Nov 2016 13:11:47 +0100 Subject: [PATCH] Add missing liveness probe for apiserver static pod Fix unreliable waiting for the apiserver to become ready. Remove logfile mount to align with the rest of static pods and because containers shall write logs to stdout only. Signed-off-by: Bogdan Dobrelya --- .../templates/manifests/kube-apiserver.manifest.j2 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/roles/kubernetes/master/templates/manifests/kube-apiserver.manifest.j2 b/roles/kubernetes/master/templates/manifests/kube-apiserver.manifest.j2 index a52d2d7ab..77b8dde63 100644 --- a/roles/kubernetes/master/templates/manifests/kube-apiserver.manifest.j2 +++ b/roles/kubernetes/master/templates/manifests/kube-apiserver.manifest.j2 @@ -48,7 +48,13 @@ spec: {% elif cloud_provider is defined and cloud_provider == "aws" %} - --cloud-provider={{ cloud_provider }} {% endif %} - - 2>&1 >> {{ kube_log_dir }}/kube-apiserver.log + livenessProbe: + httpGet: + host: 127.0.0.1 + path: /healthz + port: 8080 + initialDelaySeconds: 30 + timeoutSeconds: 10 volumeMounts: - mountPath: {{ kube_config_dir }} name: kubernetes-config @@ -59,8 +65,6 @@ spec: - mountPath: {{ etcd_cert_dir }} name: etcd-certs readOnly: true - - mountPath: /var/log/ - name: logfile volumes: - hostPath: path: {{ kube_config_dir }} @@ -71,6 +75,3 @@ spec: - hostPath: path: {{ etcd_cert_dir }} name: etcd-certs - - hostPath: - path: /var/log/ - name: logfile