diff --git a/helm-chart/zxporter-netmon/templates/daemonset.yaml b/helm-chart/zxporter-netmon/templates/daemonset.yaml index 20bb0677..6ec07f1d 100644 --- a/helm-chart/zxporter-netmon/templates/daemonset.yaml +++ b/helm-chart/zxporter-netmon/templates/daemonset.yaml @@ -35,7 +35,7 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http - containerPort: 8081 + containerPort: {{ .Values.config.containerPort }} protocol: TCP envFrom: - configMapRef: diff --git a/helm-chart/zxporter-netmon/values.yaml b/helm-chart/zxporter-netmon/values.yaml index 39e42987..40d29600 100644 --- a/helm-chart/zxporter-netmon/values.yaml +++ b/helm-chart/zxporter-netmon/values.yaml @@ -54,6 +54,7 @@ dnsPolicy: ClusterFirstWithHostNet # Config for collection config: + containerPort: 8081 logLevel: "info" mainConfigMapName: "devzero-zxporter-env-config" # Default scrape interval 5s diff --git a/helm-chart/zxporter/templates/deployment.yaml b/helm-chart/zxporter/templates/deployment.yaml index 290c4d34..09ed4fef 100644 --- a/helm-chart/zxporter/templates/deployment.yaml +++ b/helm-chart/zxporter/templates/deployment.yaml @@ -86,9 +86,7 @@ spec: initialDelaySeconds: 5 periodSeconds: 10 resources: - requests: - cpu: 200m - memory: 128Mi + {{- toYaml .Values.resources | nindent 12 }} securityContext: allowPrivilegeEscalation: false capabilities: diff --git a/helm-chart/zxporter/templates/node-exporter-daemonset.yaml b/helm-chart/zxporter/templates/node-exporter-daemonset.yaml index 52b94d0c..2a2d7d21 100644 --- a/helm-chart/zxporter/templates/node-exporter-daemonset.yaml +++ b/helm-chart/zxporter/templates/node-exporter-daemonset.yaml @@ -52,14 +52,14 @@ spec: serviceAccountName: dz-prometheus-node-exporter containers: - name: node-exporter - image: quay.io/prometheus/node-exporter:v1.9.1 - imagePullPolicy: IfNotPresent + image: {{ .Values.nodeExporter.image.repository }}:{{ .Values.nodeExporter.image.tag }} + imagePullPolicy: {{ .Values.nodeExporter.image.pullPolicy }} args: - --path.procfs=/host/proc - --path.sysfs=/host/sys - --path.rootfs=/host/root - --path.udev.data=/host/root/run/udev/data - - --web.listen-address=[$(HOST_IP)]:9101 + - --web.listen-address=[$(HOST_IP)]:{{ .Values.nodeExporter.port }} securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true @@ -68,14 +68,14 @@ spec: value: 0.0.0.0 ports: - name: metrics - containerPort: 9101 + containerPort: {{ .Values.nodeExporter.port }} protocol: TCP livenessProbe: failureThreshold: 3 httpGet: httpHeaders: path: / - port: 9101 + port: {{ .Values.nodeExporter.port }} scheme: HTTP initialDelaySeconds: 0 periodSeconds: 10 @@ -86,7 +86,7 @@ spec: httpGet: httpHeaders: path: / - port: 9101 + port: {{ .Values.nodeExporter.port }} scheme: HTTP initialDelaySeconds: 0 periodSeconds: 10 @@ -104,13 +104,9 @@ spec: mountPropagation: HostToContainer readOnly: true resources: - requests: - memory: "500Mi" - cpu: "250m" - limits: - memory: "500Mi" - hostNetwork: true - hostPID: true + {{- toYaml .Values.nodeExporter.resources | nindent 12 }} + hostNetwork: {{ .Values.nodeExporter.hostNetwork }} + hostPID: {{ .Values.nodeExporter.hostPID }} hostIPC: false {{- with .Values.affinity }} affinity: diff --git a/helm-chart/zxporter/templates/prometheus-configmap.yaml b/helm-chart/zxporter/templates/prometheus-configmap.yaml index 9cdde08b..c913924c 100644 --- a/helm-chart/zxporter/templates/prometheus-configmap.yaml +++ b/helm-chart/zxporter/templates/prometheus-configmap.yaml @@ -21,9 +21,9 @@ data: {} prometheus.yml: | global: - evaluation_interval: 1m - scrape_interval: 1m - scrape_timeout: 10s + evaluation_interval: {{ .Values.prometheus.evaluationInterval }} + scrape_interval: {{ .Values.prometheus.scrapeInterval }} + scrape_timeout: {{ .Values.prometheus.scrapeTimeout }} rule_files: - /etc/config/recording_rules.yml - /etc/config/alerting_rules.yml diff --git a/helm-chart/zxporter/templates/prometheus-deployments.yaml b/helm-chart/zxporter/templates/prometheus-deployments.yaml index 08a98b28..a978a5fa 100644 --- a/helm-chart/zxporter/templates/prometheus-deployments.yaml +++ b/helm-chart/zxporter/templates/prometheus-deployments.yaml @@ -19,7 +19,7 @@ spec: matchLabels: app.kubernetes.io/name: kube-state-metrics app.kubernetes.io/instance: prometheus - replicas: 1 + replicas: {{ .Values.kubeStateMetrics.replicas }} strategy: type: RollingUpdate revisionHistoryLimit: 10 @@ -65,8 +65,8 @@ spec: args: - --port=8080 - --resources=nodes - imagePullPolicy: IfNotPresent - image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.15.0 + imagePullPolicy: {{ .Values.kubeStateMetrics.image.pullPolicy }} + image: {{ .Values.kubeStateMetrics.image.repository }}:{{ .Values.kubeStateMetrics.image.tag }} ports: - containerPort: 8080 name: "http" @@ -93,11 +93,7 @@ spec: successThreshold: 1 timeoutSeconds: 5 resources: - requests: - memory: "500Mi" - cpu: "250m" - limits: - memory: "500Mi" + {{- toYaml .Values.kubeStateMetrics.resources | nindent 12 }} securityContext: allowPrivilegeEscalation: false capabilities: @@ -124,7 +120,7 @@ spec: app.kubernetes.io/component: server app.kubernetes.io/name: dz-prometheus app.kubernetes.io/instance: prometheus - replicas: 1 + replicas: {{ .Values.prometheus.replicas }} revisionHistoryLimit: 10 strategy: type: Recreate @@ -158,8 +154,8 @@ spec: {{- end }} containers: - name: dz-prometheus-server-configmap-reload - image: "quay.io/prometheus-operator/prometheus-config-reloader:v0.83.0" - imagePullPolicy: "IfNotPresent" + image: "{{ .Values.prometheus.configReloader.image.repository }}:{{ .Values.prometheus.configReloader.image.tag }}" + imagePullPolicy: "{{ .Values.prometheus.configReloader.image.pullPolicy }}" args: - --watched-dir=/etc/config - --listen-address=0.0.0.0:8080 @@ -185,16 +181,12 @@ spec: mountPath: /etc/config readOnly: true resources: - requests: - memory: "500Mi" - cpu: "250m" - limits: - memory: "500Mi" + {{- toYaml .Values.prometheus.configReloader.resources | nindent 12 }} - name: dz-prometheus-server - image: "quay.io/prometheus/prometheus:v3.4.1" - imagePullPolicy: "IfNotPresent" + image: "{{ .Values.prometheus.image.repository }}:{{ .Values.prometheus.image.tag }}" + imagePullPolicy: "{{ .Values.prometheus.image.pullPolicy }}" args: - - --storage.tsdb.retention.time=2d + - --storage.tsdb.retention.time={{ .Values.prometheus.retention }} - --config.file=/etc/config/prometheus.yml - --storage.tsdb.path=/data - --web.console.libraries=/etc/prometheus/console_libraries @@ -229,11 +221,7 @@ spec: mountPath: /data subPath: "" resources: - requests: - memory: "2Gi" - cpu: "100m" - limits: - memory: "2Gi" + {{- toYaml .Values.prometheus.resources | nindent 12 }} dnsPolicy: ClusterFirst securityContext: fsGroup: 65534 diff --git a/helm-chart/zxporter/templates/prometheus-services.yaml b/helm-chart/zxporter/templates/prometheus-services.yaml index 18eeab16..2ac0f2f4 100644 --- a/helm-chart/zxporter/templates/prometheus-services.yaml +++ b/helm-chart/zxporter/templates/prometheus-services.yaml @@ -72,8 +72,8 @@ metadata: spec: type: ClusterIP ports: - - port: 9101 - targetPort: 9101 + - port: {{ .Values.nodeExporter.port }} + targetPort: {{ .Values.nodeExporter.port }} protocol: TCP name: metrics selector: diff --git a/helm-chart/zxporter/values.yaml b/helm-chart/zxporter/values.yaml index ad1c69ae..dfbe22fa 100644 --- a/helm-chart/zxporter/values.yaml +++ b/helm-chart/zxporter/values.yaml @@ -62,6 +62,72 @@ zxporter: # ConfigMap: Contains configuration and tokens when useSecretForToken=false tokenConfigMapName: "devzero-zxporter-env-config" +# ZXPorter controller resources +resources: + requests: + cpu: 200m + memory: 128Mi + limits: {} + +# Node Exporter configuration +nodeExporter: + image: + repository: quay.io/prometheus/node-exporter + tag: v1.9.1 + pullPolicy: IfNotPresent + resources: + requests: + cpu: 250m + memory: 500Mi + limits: + memory: 500Mi + port: 9101 + hostNetwork: true + hostPID: true + +# Kube State Metrics configuration +kubeStateMetrics: + image: + repository: registry.k8s.io/kube-state-metrics/kube-state-metrics + tag: v2.15.0 + pullPolicy: IfNotPresent + resources: + requests: + cpu: 250m + memory: 500Mi + limits: + memory: 500Mi + replicas: 1 + +# Prometheus Server configuration +prometheus: + image: + repository: quay.io/prometheus/prometheus + tag: v3.4.1 + pullPolicy: IfNotPresent + configReloader: + image: + repository: quay.io/prometheus-operator/prometheus-config-reloader + tag: v0.83.0 + pullPolicy: IfNotPresent + resources: + requests: + cpu: 250m + memory: 500Mi + limits: + memory: 500Mi + resources: + requests: + cpu: 100m + memory: 2Gi + limits: + memory: 2Gi + replicas: 1 + retention: 2d + scrapeInterval: 1m + evaluationInterval: 1m + scrapeTimeout: 10s + # Monitoring components (set to false to use your own Prometheus/Node Exporter) monitoring: enabled: true