Skip to content

Instantly share code, notes, and snippets.

@amimof
Created April 28, 2020 07:20
Show Gist options
  • Save amimof/47894293ed2a6ad48a8308d294e62792 to your computer and use it in GitHub Desktop.
Save amimof/47894293ed2a6ad48a8308d294e62792 to your computer and use it in GitHub Desktop.
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: node-problem-detector
namespace: node-problem-detector
---
apiVersion: v1
kind: ConfigMap
metadata:
name: node-problem-detector-custom-config
namespace: node-problem-detector
data:
{}
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: node-problem-detector
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- apiGroups:
- ""
resources:
- nodes/status
verbs:
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- update
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: node-problem-detector
subjects:
- kind: ServiceAccount
name: node-problem-detector
namespace: node-problem-detector
roleRef:
kind: ClusterRole
name: node-problem-detector
apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node-problem-detector
namespace: node-problem-detector
spec:
selector:
matchLabels:
app: node-problem-detector
template:
metadata:
labels:
app: node-problem-detector
spec:
serviceAccountName: node-problem-detector
hostNetwork: false
terminationGracePeriodSeconds: 30
containers:
- name: node-problem-detector
image: "k8s.gcr.io/node-problem-detector:v0.8.1"
imagePullPolicy: "IfNotPresent"
command:
- "/bin/sh"
- "-c"
- "exec /node-problem-detector --logtostderr --system-log-monitors=/config/kernel-monitor.json,/config/docker-monitor.json --prometheus-address=0.0.0.0 --prometheus-port=20257 --k8s-exporter-heartbeat-period=5m0s"
securityContext:
privileged: true
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: log
mountPath: /var/log/
- name: localtime
mountPath: /etc/localtime
readOnly: true
- name: custom-config
mountPath: /custom-config
readOnly: true
ports:
- containerPort: 20257
name: exporter
resources:
{}
tolerations:
- effect: NoSchedule
operator: Exists
volumes:
- name: log
hostPath:
path: /var/log/
- name: localtime
hostPath:
path: /etc/localtime
type: "FileOrCreate"
- name: custom-config
configMap:
name: node-problem-detector-custom-config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment