Files
2026-08-04 17:35:55 +01:00

154 lines
4.6 KiB
YAML
Executable File

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: netdata-child
labels:
app: netdata
role: child
spec:
selector:
matchLabels:
app: netdata
role: child
template:
metadata:
annotations:
container.apparmor.security.beta.kubernetes.io/netdata: unconfined
labels:
app: netdata
role: child
spec:
serviceAccountName: netdata
restartPolicy: Always
hostPID: true
hostIPC: true
hostNetwork: true
initContainers:
- name: init-persistence
image: "alpine:latest"
resources:
requests:
cpu: 10m
imagePullPolicy: Always
volumeMounts:
- name: persistencevarlibdir
mountPath: "/persistencevarlibdir"
command: ["/bin/sh"]
args:
- "-c"
- "chmod 777 /persistencevarlibdir;"
containers:
- name: netdata
image: "netdata/netdata:edge"
imagePullPolicy: Always
env:
- name: NETDATA_CLAIM_URL
value: "https://api.netdata.cloud"
- name: NETDATA_CLAIM_TOKEN
value: "CIlCwV6GawNWIfhrqMVmPAJixo_BSaGvwVbHKFOCQCHbYG5J8Ac0FDxKrObJ727F1dndg8J-v6apUhzGho6RIOlkrqJ_F7DKodjLqbsSWb7Ta-GSHkkuHcTXidxKxEo5RK0jiqU"
- name: NETDATA_CLAIM_ROOMS
value: "e15a4f12-89d7-4d5b-b588-6658fa835473"
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: NETDATA_LISTENER_PORT
value: '19999'
ports:
- name: http
containerPort: 19999
protocol: TCP
livenessProbe:
exec:
command: ["/usr/sbin/netdatacli", "ping"]
initialDelaySeconds: 0
failureThreshold: 3
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
exec:
command: ["/usr/sbin/netdatacli", "ping"]
initialDelaySeconds: 0
failureThreshold: 3
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 1
volumeMounts:
- name: proc
readOnly: true
mountPath: /host/proc
- name: sys
mountPath: /host/sys
- name: os-release
mountPath: /host/etc/os-release
- name: varlog
mountPath: /host/var/log
- name: configmap
mountPath: /etc/netdata/go.d.conf
subPath: go.d
- name: configmap
mountPath: /etc/netdata/go.d/k8s_kubelet.conf
subPath: kubelet
- name: configmap
mountPath: /etc/netdata/go.d/k8s_kubeproxy.conf
subPath: kubeproxy
- name: configmap
mountPath: /etc/netdata/go.d/web_log.conf
subPath: web_log
- name: configmap
mountPath: /etc/netdata/netdata.conf
subPath: netdata
- name: configmap
mountPath: /etc/netdata/stream.conf
subPath: stream
- name: persistencevarlibdir
mountPath: /var/lib/netdata
- name: sdconfigmap
mountPath: "/etc/netdata/go.d/sd/k8s.conf"
subPath: config.yml
securityContext:
capabilities:
add:
- SYS_PTRACE
- SYS_ADMIN
resources: {}
tolerations:
- effect: NoSchedule
operator: Exists
terminationGracePeriodSeconds: 30
volumes:
- name: proc
hostPath:
path: /proc
- name: sys
hostPath:
path: /sys
- name: os-release
hostPath:
path: /etc/os-release
- name: varlog
hostPath:
path: /var/log
- name: configmap
configMap:
name: netdata-conf-child
optional: true
- name: persistencevarlibdir
hostPath:
path: /var/lib/netdata-k8s-child/var/lib/netdata
type: DirectoryOrCreate
- name: sdconfigmap
configMap:
name: netdata-child-sd-config-map
optional: true
dnsPolicy: ClusterFirstWithHostNet