From 195e2494adf91c255c087b25582385ea7261ee4b Mon Sep 17 00:00:00 2001 From: Random-Liu Date: Fri, 20 May 2016 01:09:18 -0700 Subject: [PATCH] Add node problem detector as an addon pod. --- .../addons/addon-manager/kube-addon-update.sh | 1 + .../node-problem-detector/MAINTAINERS.md | 6 +++ .../addons/node-problem-detector/README.md | 10 +++++ .../node-problem-detector.yaml.in | 44 +++++++++++++++++++ cluster/common.sh | 2 + cluster/gce/config-default.sh | 4 +- cluster/gce/config-test.sh | 3 ++ cluster/gce/configure-vm.sh | 2 + cluster/saltbase/salt/kube-addons/init.sls | 11 +++++ 9 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 cluster/addons/node-problem-detector/MAINTAINERS.md create mode 100644 cluster/addons/node-problem-detector/README.md create mode 100644 cluster/addons/node-problem-detector/node-problem-detector.yaml.in diff --git a/cluster/addons/addon-manager/kube-addon-update.sh b/cluster/addons/addon-manager/kube-addon-update.sh index dcaf3518c6..f4ddc691c2 100755 --- a/cluster/addons/addon-manager/kube-addon-update.sh +++ b/cluster/addons/addon-manager/kube-addon-update.sh @@ -476,6 +476,7 @@ function update-addons() { # be careful, reconcile-objects uses global variables reconcile-objects ${addon_path} ReplicationController "-" & reconcile-objects ${addon_path} Deployment "-" & + reconcile-objects ${addon_path} DaemonSet "-" & # We don't expect names to be versioned for the following kinds, so # we match the entire name, ignoring version suffix. diff --git a/cluster/addons/node-problem-detector/MAINTAINERS.md b/cluster/addons/node-problem-detector/MAINTAINERS.md new file mode 100644 index 0000000000..391fb3140f --- /dev/null +++ b/cluster/addons/node-problem-detector/MAINTAINERS.md @@ -0,0 +1,6 @@ +# Maintainers + +Lantao Liu + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/addons/node-problem-detector/MAINTAINERS.md?pixel)]() diff --git a/cluster/addons/node-problem-detector/README.md b/cluster/addons/node-problem-detector/README.md new file mode 100644 index 0000000000..9d8199a5f1 --- /dev/null +++ b/cluster/addons/node-problem-detector/README.md @@ -0,0 +1,10 @@ +# Node Problem Detector +============== + +Node Problem Detector is a DaemonSet running on each node, detecting node +problems. + +Learn more at: https://github.com/kubernetes/node-problem-detector + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/addons/node-problem-detector/README.md?pixel)]() diff --git a/cluster/addons/node-problem-detector/node-problem-detector.yaml.in b/cluster/addons/node-problem-detector/node-problem-detector.yaml.in new file mode 100644 index 0000000000..343e994ee3 --- /dev/null +++ b/cluster/addons/node-problem-detector/node-problem-detector.yaml.in @@ -0,0 +1,44 @@ +apiVersion: extensions/v1beta1 +kind: DaemonSet +metadata: + name: node-problem-detector-v0.1 + namespace: kube-system + labels: + k8s-app: node-problem-detector + version: v0.1 + kubernetes.io/cluster-service: "true" +spec: + template: + metadata: + labels: + k8s-app: node-problem-detector + version: v0.1 + kubernetes.io/cluster-service: "true" + spec: + hostNetwork: true + containers: + - name: node-problem-detector + image: gcr.io/google_containers/node-problem-detector:v0.1 + env: + # Config the host ip and port of apiserver. + - name: "KUBERNETES_SERVICE_HOST" + value: "{{ pillar['master_node'] }}" + - name: "KUBERNETES_SERVICE_PORT" + value: "443" + securityContext: + privileged: true + resources: + limits: + cpu: "200m" + memory: "100Mi" + requests: + cpu: "50m" + memory: "20Mi" + volumeMounts: + - name: log + mountPath: /log + readOnly: true + volumes: + - name: log + hostPath: + path: /var/log/ diff --git a/cluster/common.sh b/cluster/common.sh index c3ac722526..983b707bab 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -485,6 +485,7 @@ ENABLE_CLUSTER_MONITORING: $(yaml-quote ${ENABLE_CLUSTER_MONITORING:-none}) ENABLE_L7_LOADBALANCING: $(yaml-quote ${ENABLE_L7_LOADBALANCING:-none}) ENABLE_CLUSTER_LOGGING: $(yaml-quote ${ENABLE_CLUSTER_LOGGING:-false}) ENABLE_CLUSTER_UI: $(yaml-quote ${ENABLE_CLUSTER_UI:-false}) +ENABLE_NODE_PROBLEM_DETECTOR: $(yaml-quote ${ENABLE_NODE_PROBLEM_DETECTOR:-false}) ENABLE_NODE_LOGGING: $(yaml-quote ${ENABLE_NODE_LOGGING:-false}) LOGGING_DESTINATION: $(yaml-quote ${LOGGING_DESTINATION:-}) ELASTICSEARCH_LOGGING_REPLICAS: $(yaml-quote ${ELASTICSEARCH_LOGGING_REPLICAS:-}) @@ -578,6 +579,7 @@ ENABLE_MANIFEST_URL: $(yaml-quote ${ENABLE_MANIFEST_URL:-false}) MANIFEST_URL: $(yaml-quote ${MANIFEST_URL:-}) MANIFEST_URL_HEADER: $(yaml-quote ${MANIFEST_URL_HEADER:-}) NUM_NODES: $(yaml-quote ${NUM_NODES}) +MASTER_NAME: $(yaml-quote ${MASTER_NAME}) EOF if [ -n "${APISERVER_TEST_ARGS:-}" ]; then cat >>$file <