test
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: argocd-metrics-server-configmap
|
||||
data:
|
||||
# Metrics for Deployments
|
||||
extension.metrics.deployments: |
|
||||
- name: "CPU Usage"
|
||||
description: "CPU usage for the deployment"
|
||||
type: "graph"
|
||||
graphType: "area"
|
||||
yAxisLabel: "CPU Cores"
|
||||
query: 'sum(rate(container_cpu_usage_seconds_total{namespace="{{.metadata.namespace}}", pod=~"{{.metadata.name}}-.*"}[5m])) by (pod)'
|
||||
|
||||
- name: "Memory Usage"
|
||||
description: "Memory usage for the deployment"
|
||||
type: "graph"
|
||||
graphType: "area"
|
||||
yAxisLabel: "Memory (MB)"
|
||||
query: 'sum(container_memory_working_set_bytes{namespace="{{.metadata.namespace}}", pod=~"{{.metadata.name}}-.*"}) by (pod) / 1024 / 1024'
|
||||
|
||||
- name: "Network Received"
|
||||
description: "Network bytes received"
|
||||
type: "graph"
|
||||
graphType: "line"
|
||||
yAxisLabel: "Bytes/sec"
|
||||
query: 'sum(rate(container_network_receive_bytes_total{namespace="{{.metadata.namespace}}", pod=~"{{.metadata.name}}-.*"}[5m])) by (pod)'
|
||||
|
||||
# Metrics for Pods
|
||||
extension.metrics.pods: |
|
||||
- name: "CPU Usage"
|
||||
description: "CPU usage for the pod"
|
||||
type: "graph"
|
||||
graphType: "area"
|
||||
yAxisLabel: "CPU Cores"
|
||||
query: 'sum(rate(container_cpu_usage_seconds_total{namespace="{{.metadata.namespace}}", pod="{{.metadata.name}}"}[5m])) by (container)'
|
||||
|
||||
- name: "Memory Usage"
|
||||
description: "Memory usage for the pod"
|
||||
type: "graph"
|
||||
graphType: "area"
|
||||
yAxisLabel: "Memory (MB)"
|
||||
query: 'sum(container_memory_working_set_bytes{namespace="{{.metadata.namespace}}", pod="{{.metadata.name}}"}) by (container) / 1024 / 1024'
|
||||
|
||||
- name: "Container Restarts"
|
||||
description: "Number of container restarts"
|
||||
type: "graph"
|
||||
graphType: "line"
|
||||
yAxisLabel: "Restarts"
|
||||
query: 'kube_pod_container_status_restarts_total{namespace="{{.metadata.namespace}}", pod="{{.metadata.name}}"}'
|
||||
|
||||
# Prometheus connection
|
||||
prometheus.url: "http://prometheus-kube-prometheus-prometheus.monitoring.svc:9090"
|
||||
@@ -0,0 +1,73 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: argocd-metrics-server
|
||||
labels:
|
||||
app: argocd-metrics-server
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 9003
|
||||
protocol: TCP
|
||||
targetPort: 9003
|
||||
selector:
|
||||
app: argocd-metrics-server
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: argocd-metrics-server
|
||||
labels:
|
||||
app: argocd-metrics-server
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: argocd-metrics-server
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: argocd-metrics-server
|
||||
spec:
|
||||
containers:
|
||||
- name: argocd-metrics-server
|
||||
image: quay.io/argoprojlabs/argocd-extension-metrics:v1.0.3
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 9003
|
||||
name: http
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: PROMETHEUS_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: argocd-metrics-server-configmap
|
||||
key: prometheus.url
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /etc/argocd-metrics-server/
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 64Mi
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
readOnlyRootFilesystem: true
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1000
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: argocd-metrics-server-configmap
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1000
|
||||
fsGroup: 1000
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
namespace: argocd
|
||||
|
||||
resources:
|
||||
- configmap.yaml
|
||||
- deployment.yaml
|
||||
|
||||
commonLabels:
|
||||
app: argocd-metrics-server
|
||||
app.kubernetes.io/name: argocd-metrics-server
|
||||
app.kubernetes.io/component: metrics-server
|
||||
Reference in New Issue
Block a user