Merge pull request #1 from CloudMOA/CLOUD-19283

[fea] 데몬셋 에이전트 결합
This commit is contained in:
Dev2Back-김동우
2023-07-25 17:53:57 +09:00
committed by GitHub
3 changed files with 39 additions and 97 deletions

View File

@@ -1,96 +0,0 @@
apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/scrape: 'true'
labels:
app: node-exporter
name: node-exporter
name: node-exporter
namespace: imxc
spec:
clusterIP: None
ports:
- name: scrape
port: 9100
protocol: TCP
selector:
app: node-exporter
type: ClusterIP
---
{{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: apps/v1
{{- else }}
apiVersion: extensions/v1beta1
{{- end }}
kind: DaemonSet
metadata:
name: node-exporter
namespace: imxc
spec:
{{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }}
selector:
matchLabels:
app: node-exporter
{{- end }}
template:
metadata:
labels:
app: node-exporter
name: node-exporter
spec:
tolerations:
- effect: NoSchedule
operator: Exists
- effect: NoExecute
operator: Exists
containers:
- image: {{ .Values.global.IMXC_IN_REGISTRY }}/node-exporter
name: node-exporter
resources:
limits:
cpu: 250m
memory: 180Mi
requests:
cpu: 125m
memory: 90Mi
ports:
- containerPort: 9100
hostPort: 9100
name: scrape
args:
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
- --path.rootfs=/host/root
- --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|run|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/)
- --collector.tcpstat
# --log.level=debug
env:
- name: GOMAXPROCS
value: "1"
volumeMounts:
- mountPath: /host/proc
name: proc
readOnly: false
- mountPath: /host/sys
name: sys
readOnly: false
- mountPath: /host/root
mountPropagation: HostToContainer
name: root
readOnly: true
hostNetwork: true
hostPID: true
securityContext:
runAsNonRoot: true
runAsUser: 65534
volumes:
- hostPath:
path: /proc
name: proc
- hostPath:
path: /sys
name: sys
- hostPath:
path: /
name: root

View File

@@ -110,7 +110,7 @@ data:
action: keep action: keep
- job_name: 'kubernetes-node-exporter' - job_name: 'kubernetes-node-agent'
tls_config: tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token

View File

@@ -35,6 +35,7 @@ spec:
app: topology-agent app: topology-agent
spec: spec:
hostNetwork: true hostNetwork: true
hostPID: true
dnsPolicy: ClusterFirstWithHostNet dnsPolicy: ClusterFirstWithHostNet
# below appended # below appended
hostPID: true hostPID: true
@@ -44,6 +45,40 @@ spec:
- effect: NoExecute - effect: NoExecute
operator: Exists operator: Exists
containers: containers:
- image: {{ .Values.global.IMXC_IN_REGISTRY }}/node-exporter
name: node-agent
resources:
limits:
cpu: 250m
memory: 180Mi
requests:
cpu: 125m
memory: 90Mi
ports:
- containerPort: 9100
hostPort: 9100
name: scrape
args:
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
- --path.rootfs=/host/root
- --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|run|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/)
- --collector.tcpstat
# --log.level=debug
env:
- name: GOMAXPROCS
value: "1"
volumeMounts:
- mountPath: /host/proc
name: proc-volume
readOnly: false
- mountPath: /host/sys
name: sys-volume
readOnly: false
- mountPath: /host/root
mountPropagation: HostToContainer
name: root-volume
readOnly: true
- name: topology-agent - name: topology-agent
image: {{ .Values.global.IMXC_IN_REGISTRY }}/topology-agent:{{ .Values.global.TOPOLOGY_AGENT_VERSION }} image: {{ .Values.global.IMXC_IN_REGISTRY }}/topology-agent:{{ .Values.global.TOPOLOGY_AGENT_VERSION }}
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
@@ -105,3 +140,6 @@ spec:
- name: root-volume - name: root-volume
hostPath: hostPath:
path: / path: /
- hostPath:
path: /sys
name: sys-volume