diff --git a/README.md b/README.md index 20ae8bda..813c7dc2 100644 --- a/README.md +++ b/README.md @@ -91,43 +91,7 @@ Run `make` in the top directory. It will: to another registry. ## Start DaemonSet -* Create a file node-problem-detector.yaml with the following yaml. -```yaml -apiVersion: extensions/v1beta1 -kind: DaemonSet -metadata: - name: node-problem-detector -spec: - template: - spec: - containers: - - name: node-problem-detector - image: k8s.gcr.io/node-problem-detector:v0.2 - imagePullPolicy: Always - securityContext: - privileged: true - env: - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - volumeMounts: - - name: log - mountPath: /log - readOnly: true - - name: localtime - mountPath: /etc/localtime - readOnly: true - volumes: - - name: log - # Config `log` to your system log directory - hostPath: - path: /var/log/ - - name: localtime - hostPath: - path: /etc/localtime -``` -* Edit node-problem-detector.yaml to fit your environment: Set `log` volume to your system log directory. (Used by SystemLogMonitor) +* Edit [node-problem-detector.yaml](https://github.com/kubernetes/node-problem-detector/blob/master/deployment/node-problem-detector.yaml) to fit your environment: Set `log` volume to your system log directory. (Used by SystemLogMonitor). For **kubernetes <1.9** use [node-problem-detector-old.yaml](https://github.com/kubernetes/node-problem-detector/blob/master/deployment/node-problem-detector-old.yaml) * Create the DaemonSet with `kubectl create -f node-problem-detector.yaml` * If needed, you can use [ConfigMap](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/) to overwrite the `config/`. diff --git a/node-problem-detector.yaml b/deployment/node-problem-detector-old.yaml similarity index 100% rename from node-problem-detector.yaml rename to deployment/node-problem-detector-old.yaml diff --git a/deployment/node-problem-detector.yaml b/deployment/node-problem-detector.yaml new file mode 100644 index 00000000..95dcadc9 --- /dev/null +++ b/deployment/node-problem-detector.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: node-problem-detector +spec: + selector: + matchLabels: + name: node-problem-detector + template: + metadata: + labels: + app: node-problem-detector + spec: + containers: + - name: node-problem-detector + command: + - /node-problem-detector + - --logtostderr + - --kernel-monitor=/config/kernel-monitor.json + image: k8s.gcr.io/node-problem-detector:v0.2 + imagePullPolicy: Always + securityContext: + privileged: true + env: + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + volumeMounts: + - name: log + mountPath: /var/log + readOnly: true + - name: kmsg + mountPath: /dev/kmsg + readOnly: true + # Make sure node problem detector is in the same timezone + # with the host. + - name: localtime + mountPath: /etc/localtime + readOnly: true + - name: config + mountPath: /config + readOnly: true + volumes: + - name: log + # Config `log` to your system log directory + hostPath: + path: /var/log/ + - name: kmsg + hostPath: + path: /dev/kmsg + - name: localtime + hostPath: + path: /etc/localtime + - name: config + configMap: + name: node-problem-detector-config