diff --git a/collectd/collectd.d/df.conf b/collectd/collectd.d/df.conf new file mode 100644 index 0000000..377a37f --- /dev/null +++ b/collectd/collectd.d/df.conf @@ -0,0 +1,10 @@ +LoadPlugin df + + + ReportByDevice true + + FSType autofs + FSType overlay + FSType efivarfs + IgnoreSelected true + diff --git a/collectd/collectd.d/log.conf b/collectd/collectd.d/log.conf new file mode 100644 index 0000000..aca9138 --- /dev/null +++ b/collectd/collectd.d/log.conf @@ -0,0 +1,8 @@ +LoadPlugin logfile + + + LogLevel info + File stderr + Timestamp false + PrintSeverity true + diff --git a/collectd/collectd.d/plugins.conf b/collectd/collectd.d/plugins.conf new file mode 100644 index 0000000..c961a39 --- /dev/null +++ b/collectd/collectd.d/plugins.conf @@ -0,0 +1,9 @@ +LoadPlugin chrony +LoadPlugin cpufreq +LoadPlugin disk +LoadPlugin entropy +LoadPlugin processes +LoadPlugin swap +LoadPlugin tcpconns +LoadPlugin thermal +LoadPlugin uptime diff --git a/collectd/collectd.d/prometheus.conf b/collectd/collectd.d/prometheus.conf new file mode 100644 index 0000000..8283102 --- /dev/null +++ b/collectd/collectd.d/prometheus.conf @@ -0,0 +1,5 @@ +LoadPlugin write_prometheus + + + Port 9103 + diff --git a/collectd/collectd.yaml b/collectd/collectd.yaml new file mode 100644 index 0000000..1bab01d --- /dev/null +++ b/collectd/collectd.yaml @@ -0,0 +1,74 @@ +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: collectd + labels: + app.kubernetes.io/name: collectd + app.kubernetes.io/component: collectd +spec: + selector: + matchLabels: + app.kubernetes.io/name: collectd + app.kubernetes.io/component: collectd + template: + metadata: + labels: + app.kubernetes.io/name: collectd + app.kubernetes.io/component: collectd + spec: + containers: + - name: collectd + image: git.pyrocufflink.net/containerimages/collectd + ports: + - containerPort: 9103 + name: http + readinessProbe: &probe + httpGet: + port: http + path: /metrics + periodSeconds: 60 + startupProbe: + <<: *probe + periodSeconds: 1 + successThreshold: 1 + failureThreshold: 30 + timeoutSeconds: 1 + securityContext: + capabilities: + add: + - DAC_READ_SEARCH + drop: + - ALL + seLinuxOptions: + type: spc_t + readOnlyRootFilesystem: true + volumeMounts: + - mountPath: /etc/collectd.d + name: config + readOnly: true + - mountPath: /host + name: host + - mountPath: /run + name: host + subPath: run + - mountPath: /tmp + name: tmp + hostNetwork: true + hostPID: true + hostIPC: true + tolerations: + - effect: NoExecute + operator: Exists + - effect: NoSchedule + operator: Exists + volumes: + - name: config + configMap: + name: collectd + - name: host + hostPath: + path: / + - name: tmp + emptyDir: + medium: Memory diff --git a/collectd/kustomization.yaml b/collectd/kustomization.yaml new file mode 100644 index 0000000..4671bc5 --- /dev/null +++ b/collectd/kustomization.yaml @@ -0,0 +1,34 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: collectd + +labels: +- pairs: + app.kubernetes.io/instance: collectd + app.kubernetes.io/part-of: collectd + includeSelectors: false + +resources: +- namespace.yaml +- collectd.yaml + +configMapGenerator: +- name: collectd + files: + - collectd.d/df.conf + - collectd.d/log.conf + - collectd.d/plugins.conf + - collectd.d/prometheus.conf + +patches: +- patch: |- + apiVersion: apps/v1 + kind: DaemonSet + metadata: + name: collectd + spec: + template: + spec: + nodeSelector: + du5t1n.me/collectd: 'true' diff --git a/collectd/namespace.yaml b/collectd/namespace.yaml new file mode 100644 index 0000000..d577ee3 --- /dev/null +++ b/collectd/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: collectd + labels: + app.kubernetes.io/name: collectd