94 lines
3.0 KiB
YAML
94 lines
3.0 KiB
YAML
|
{{- if .Values.networkCosts -}}
|
||
|
{{- if .Values.networkCosts.enabled -}}
|
||
|
apiVersion: {{ include "cost-analyzer.daemonset.apiVersion" . }}
|
||
|
kind: DaemonSet
|
||
|
metadata:
|
||
|
name: {{ template "cost-analyzer.networkCostsName" . }}
|
||
|
labels:
|
||
|
{{- include "cost-analyzer.commonLabels" . | nindent 4 }}
|
||
|
spec:
|
||
|
updateStrategy:
|
||
|
type: RollingUpdate
|
||
|
selector:
|
||
|
matchLabels:
|
||
|
app: {{ template "cost-analyzer.networkCostsName" . }}
|
||
|
template:
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: {{ template "cost-analyzer.networkCostsName" . }}
|
||
|
spec:
|
||
|
hostNetwork: true
|
||
|
serviceAccountName: {{ template "cost-analyzer.serviceAccountName" . }}
|
||
|
containers:
|
||
|
- name: {{ template "cost-analyzer.networkCostsName" . }}
|
||
|
image: {{ .Values.networkCosts.image }}
|
||
|
{{- if .Values.networkCosts.imagePullPolicy }}
|
||
|
imagePullPolicy: {{ .Values.networkCosts.imagePullPolicy }}
|
||
|
{{- else }}
|
||
|
imagePullPolicy: Always
|
||
|
{{- end }}
|
||
|
{{- if .Values.networkCosts.resources }}
|
||
|
resources:
|
||
|
{{ toYaml .Values.networkCosts.resources | indent 10 }}
|
||
|
{{- end }}
|
||
|
env:
|
||
|
{{- if .Values.networkCosts.hostProc }}
|
||
|
- name: HOST_PROC
|
||
|
value: {{ .Values.networkCosts.hostProc.mountPath }}
|
||
|
{{- end }}
|
||
|
- name: NODE_NAME
|
||
|
valueFrom:
|
||
|
fieldRef:
|
||
|
fieldPath: spec.nodeName
|
||
|
- name: HOST_PORT
|
||
|
value: {{ (quote .Values.networkCosts.port) | default (quote 3001) }}
|
||
|
- name: TRAFFIC_LOGGING_ENABLED
|
||
|
value: {{ (quote .Values.networkCosts.trafficLogging) | default (quote true) }}
|
||
|
volumeMounts:
|
||
|
{{- if .Values.networkCosts.hostProc }}
|
||
|
- mountPath: {{ .Values.networkCosts.hostProc.mountPath }}
|
||
|
name: host-proc
|
||
|
{{- else }}
|
||
|
- mountPath: /net
|
||
|
name: nf-conntrack
|
||
|
- mountPath: /netfilter
|
||
|
name: netfilter
|
||
|
{{- end }}
|
||
|
{{- if .Values.networkCosts.config }}
|
||
|
- mountPath: /network-costs/config
|
||
|
name: network-costs-config
|
||
|
{{- end }}
|
||
|
securityContext:
|
||
|
privileged: true
|
||
|
ports:
|
||
|
- name: http-server
|
||
|
containerPort: {{ .Values.networkCosts.port | default 3001 }}
|
||
|
hostPort: {{ .Values.networkCosts.port | default 3001 }}
|
||
|
{{- if .Values.networkCosts.priorityClassName }}
|
||
|
priorityClassName: "{{ .Values.networkCosts.priorityClassName }}"
|
||
|
{{- end }}
|
||
|
{{- if .Values.networkCosts.tolerations }}
|
||
|
tolerations:
|
||
|
{{ toYaml .Values.networkCosts.tolerations | indent 8 }}
|
||
|
{{- end }}
|
||
|
volumes:
|
||
|
{{- if .Values.networkCosts.config }}
|
||
|
- name: network-costs-config
|
||
|
configMap:
|
||
|
name: network-costs-config
|
||
|
{{- end }}
|
||
|
{{- if .Values.networkCosts.hostProc }}
|
||
|
- name: host-proc
|
||
|
hostPath:
|
||
|
path: {{ default "/proc" .Values.networkCosts.hostProc.hostPath }}
|
||
|
{{- else }}
|
||
|
- name: nf-conntrack
|
||
|
hostPath:
|
||
|
path: /proc/net
|
||
|
- name: netfilter
|
||
|
hostPath:
|
||
|
path: /proc/sys/net/netfilter
|
||
|
{{- end }}
|
||
|
{{- end }}
|
||
|
{{- end }}
|