Skip to content

Commit

Permalink
pkg/prometheus/manifests: Keep overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
lilic committed Jan 18, 2021
1 parent 33d6cb5 commit 64c57c8
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{$PROMETHEUS_SCRAPE_KUBELETS := DefaultParam .PROMETHEUS_SCRAPE_KUBELETS false}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -26,8 +27,8 @@ spec:
containers:
- args:
- --kubelet-service=kube-system/kubelet
- --prometheus-config-reloader=quay.io/prometheus-operator/prometheus-config-reloader:v0.45.0
image: quay.io/prometheus-operator/prometheus-operator:v0.45.0
- --prometheus-config-reloader=gcr.io/k8s-testimages/quay.io/prometheus-operator/prometheus-config-reloader:v0.45.0
image: gcr.io/k8s-testimages/quay.io/prometheus-operator/prometheus-operator:v0.45.0
name: prometheus-operator
ports:
- containerPort: 8080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
- --no-collector.wifi
- --no-collector.hwmon
- --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/)
image: quay.io/prometheus/node-exporter:v1.0.1
image: gcr.io/k8s-testimages/quay.io/prometheus/node-exporter:v1.0.1
name: node-exporter
resources:
limits:
Expand Down
10 changes: 5 additions & 5 deletions clusterloader2/pkg/prometheus/manifests/grafana-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
spec:
containers:
- env: []
image: grafana/grafana:7.3.5
image: gcr.io/k8s-testimages/grafana/grafana:7.3.5
name: grafana
ports:
- containerPort: 3000
Expand All @@ -31,11 +31,11 @@ spec:
port: http
resources:
limits:
cpu: 200m
memory: 200Mi
cpu: 250m
memory: 250Mi
requests:
cpu: 100m
memory: 100Mi
cpu: 250m
memory: 250Mi
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-storage
Expand Down
39 changes: 37 additions & 2 deletions clusterloader2/pkg/prometheus/manifests/prometheus-prometheus.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{$PROMETHEUS_SCRAPE_KUBELETS := DefaultParam .PROMETHEUS_SCRAPE_KUBELETS false}}
{{$PROMETHEUS_SCRAPE_WINDOWS_NODES := DefaultParam .PROMETHEUS_SCRAPE_WINDOWS_NODES false}}
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
Expand All @@ -15,7 +17,7 @@ spec:
- name: alertmanager-main
namespace: monitoring
port: web
image: quay.io/prometheus/prometheus:v2.24.0
image: gcr.io/k8s-testimages/quay.io/prometheus/prometheus:v2.24.0
nodeSelector:
kubernetes.io/os: linux
podMetadata:
Expand All @@ -31,7 +33,20 @@ spec:
replicas: 2
resources:
requests:
memory: 400Mi
cpu: {{AddInt 200 (MultiplyInt 500 (DivideInt .Nodes 1000))}}m
{{if $PROMETHEUS_SCRAPE_KUBELETS}}
memory: 10Gi
{{else}}
# Start with 2Gi and add 2Gi for each 1K nodes.
memory: {{MultiplyInt 2 (AddInt 1 (DivideInt .Nodes 1000))}}Gi
{{end}}
limits:
{{if $PROMETHEUS_SCRAPE_KUBELETS}}
memory: 10Gi
{{else}}
# Start with 2Gi and add 2Gi for each 1K nodes.
memory: {{MultiplyInt 2 (AddInt 1 (DivideInt .Nodes 1000))}}Gi
{{end}}
ruleSelector:
matchLabels:
prometheus: k8s
Expand All @@ -40,7 +55,27 @@ spec:
fsGroup: 2000
runAsNonRoot: true
runAsUser: 1000
tolerations:
- key: "monitoring"
operator: "Exists"
effect: "NoSchedule"
serviceAccountName: prometheus-k8s
serviceMonitorNamespaceSelector: {}
serviceMonitorSelector: {}
version: 2.24.0
retention: 7d
storage:
volumeClaimTemplate:
spec:
storageClassName: ssd
resources:
requests:
# Start with 10Gi, add 10Gi for each 1K nodes.
storage: {{MultiplyInt 10 (AddInt 1 (DivideInt .Nodes 1000))}}Gi
query:
maxSamples: 100000000
{{if $PROMETHEUS_SCRAPE_WINDOWS_NODES}}
additionalScrapeConfigs:
name: windows-scrape-configs
key: windows-scrape-configs.yaml
{{end}}

0 comments on commit 64c57c8

Please sign in to comment.