105 lines
3.5 KiB
YAML
105 lines
3.5 KiB
YAML
apiVersion: apps/v1
|
|
kind: DaemonSet
|
|
metadata:
|
|
name: {{ include "node-agent.fullname" . }}
|
|
labels:
|
|
{{- include "node-agent.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- with .Values.updateStrategy }}
|
|
updateStrategy:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "node-agent.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "node-agent.selectorLabels" . | nindent 8 }}
|
|
app: coroot-node-agent
|
|
annotations:
|
|
prometheus.io/scrape: '{{ .Values.scrape | default true}}'
|
|
prometheus.io/port: '{{ .Values.port }}'
|
|
{{- if .Values.podAnnotations }}
|
|
{{- toYaml .Values.podAnnotations | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- include "node-agent.affinity" . | nindent 6 }}
|
|
{{- if .Values.tolerations }}
|
|
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
|
|
{{- end }}
|
|
priorityClassName: {{ .Values.priorityClassName }}
|
|
hostPID: true
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
command: ["coroot-node-agent", "--listen=0.0.0.0:{{ .Values.port }}", "--cgroupfs-root", "/host/sys/fs/cgroup"]
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
env:
|
|
{{- if .Values.collectorEndpoint }}
|
|
- name: COLLECTOR_ENDPOINT
|
|
value: "{{ .Values.collectorEndpoint }}"
|
|
{{- end }}
|
|
{{- if .Values.apiKey }}
|
|
- name: API_KEY
|
|
value: "{{ .Values.apiKey }}"
|
|
{{- end }}
|
|
{{- if .Values.tracesEndpoint }}
|
|
- name: TRACES_ENDPOINT
|
|
value: "{{ .Values.tracesEndpoint }}"
|
|
{{- end }}
|
|
{{- if .Values.logsEndpoint }}
|
|
- name: LOGS_ENDPOINT
|
|
value: "{{ .Values.logsEndpoint }}"
|
|
{{- end }}
|
|
{{- if .Values.profilesEndpoint }}
|
|
- name: PROFILES_ENDPOINT
|
|
value: "{{ .Values.profilesEndpoint }}"
|
|
{{- end }}
|
|
{{- if .Values.metricsEndpoint }}
|
|
- name: METRICS_ENDPOINT
|
|
value: "{{ .Values.metricsEndpoint }}"
|
|
{{- end }}
|
|
{{- if .Values.scrapeInterval }}
|
|
- name: SCRAPE_INTERVAL
|
|
value: "{{ .Values.scrapeInterval }}"
|
|
{{- end }}
|
|
{{- with .Values.env }}
|
|
{{- . | toYaml | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- containerPort: {{ .Values.port }}
|
|
name: http
|
|
securityContext:
|
|
privileged: true
|
|
volumeMounts:
|
|
- mountPath: /host/sys/fs/cgroup
|
|
name: cgroupfs
|
|
readOnly: true
|
|
- mountPath: /sys/kernel/tracing
|
|
name: tracefs
|
|
readOnly: false
|
|
- mountPath: /sys/kernel/debug
|
|
name: debugfs
|
|
readOnly: false
|
|
- mountPath: /tmp
|
|
name: tmp
|
|
readOnly: false
|
|
volumes:
|
|
- hostPath:
|
|
path: /sys/fs/cgroup
|
|
name: cgroupfs
|
|
- hostPath:
|
|
path: /sys/kernel/tracing
|
|
name: tracefs
|
|
- hostPath:
|
|
path: /sys/kernel/debug
|
|
name: debugfs
|
|
- emptyDir: {}
|
|
name: tmp |