Skip to content

Commit c02ad8f

Browse files
committed
chore(prometheus): add namespace containers base metrics
1 parent a422d34 commit c02ad8f

32 files changed

Lines changed: 126 additions & 88 deletions

addons/prometheus/2/chart/prometheus/templates/networkpolicy.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ spec:
2020
podSelector:
2121
matchLabels:
2222
{{- include "common.labels.matchLabels" . | nindent 6 }}
23+
{{- if eq .Values.server.service.type "ClusterIP" }}
2324
ingress:
2425
# Allow inbound connections
2526
- ports:
@@ -44,4 +45,9 @@ spec:
4445
{{- end }}
4546
{{- end }}
4647
{{- end }}
48+
{{- end }}
49+
{{- if eq .Values.server.service.type "LoadBalancer" }}
50+
ingress:
51+
- {}
52+
{{- end}}
4753
{{- end }}

addons/prometheus/2/chart/prometheus/templates/server/configmap.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ data:
2222
{{- include "common.tplvalues.render" (dict "value" .Values.server.webconfig "context" $) | toYaml | nindent 4 }}
2323
rules.yaml:
2424
{{- include "common.tplvalues.render" (dict "value" .Values.server.rules "context" $) | toYaml | nindent 4 }}
25-
2625
{{- end }}

addons/prometheus/2/chart/prometheus/templates/server/deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ spec:
149149
args:
150150
- "--config.file=/opt/drycc/prometheus/conf/{{ include "prometheus.server.configmapKey" . }}"
151151
- "--storage.tsdb.path={{ .Values.server.persistence.mountPath }}"
152-
- "--storage.tsdb.retention.time={{ .Values.server.retentionDays }}"
153152
- "--storage.tsdb.retention.size={{ .Values.server.retentionSize }}"
154153
- "--log.level={{ .Values.server.logLevel }}"
155154
- "--log.format={{ .Values.server.logFormat }}"

addons/prometheus/2/chart/prometheus/values.yaml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,10 @@ alertmanager:
564564
## app: my-app
565565
##
566566
selector: {}
567-
567+
drycc:
568+
token: xxxxx
569+
url: xxxx
570+
scheme: https
568571
## @section Prometheus server Parameters
569572
##
570573
## Drycc Prometheus image
@@ -577,8 +580,8 @@ alertmanager:
577580
## @param server.image.pullSecrets Prometheus image pull secrets
578581
##
579582
server:
580-
username: admin
581-
password: Sx3EIELCA
583+
username: xxxx
584+
password: xxxx
582585
image:
583586
registry: registry.drycc.cc
584587
repository: drycc-addons/prometheus
@@ -658,26 +661,20 @@ server:
658661
## @param server.alertingRules Prometheus alerting rules. This content will be stored in the the rules.yaml file and the content can be a template.
659662
## ref: <https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/>
660663
##
661-
rules: |
662-
{{`
663-
groups:
664-
- name: PG数据库-监控告警
665-
rules:
666-
- alert: PostgresqlDown
667-
expr: pg_up == 0
668-
for: 0m
669-
labels:
670-
severity: critical
671-
annotations:
672-
summary: Postgresql down (instance {{ $labels.instance }})
673-
description: "Postgresql instance is down\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
674-
675-
`}}
664+
rules: ""
676665

677666
## @param server.extraScrapeConfigs Promethus configuration, useful to declare new scrape_configs. This content will be merged with the 'server.configuration' value and stored in the the prometheus.yaml file.
678667
## ref: <https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config>
679668
##
680-
extraScrapeConfigs: []
669+
extraScrapeConfigs:
670+
- job_name: 'containers'
671+
scheme: '{{ .Values.drycc.scheme }}'
672+
metrics_path: /v2/apps/{{ include "common.names.namespace" . }}/metrics
673+
authorization:
674+
type: Token
675+
credentials: '{{ .Values.drycc.token }}'
676+
static_configs:
677+
- targets: [ '{{ .Values.drycc.url }}' ]
681678

682679
## @param server.replicaCount Number of Prometheus replicas to deploy
683680
##
@@ -1503,8 +1500,7 @@ networkPolicy:
15031500
## (with the correct destination port).
15041501
##
15051502
allowCurrentNamespace: true
1506-
allowNamespaces:
1507-
- traefik
1503+
allowNamespaces: []
15081504
## @section Init Container Parameters
15091505
##
15101506

@@ -1557,10 +1553,6 @@ volumePermissions:
15571553
scrapeAddons:
15581554
enabled: true
15591555

1560-
scrapeNamespaces:
1561-
- xx1
1562-
- xx2
1563-
15641556
configmapReload:
15651557
prometheus:
15661558
## If false, the configmap-reload container will not be deployed

addons/prometheus/2/meta.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,22 @@ allow_parameters:
2424
- name: "alertmanager.enabled"
2525
required: false
2626
description: "alertmanager config for values.yaml"
27-
- name: "server.retentionDays"
27+
- name: "server.username"
2828
required: false
29-
description: "retentionDays config for values.yaml default 15d"
30-
- name: "server.retentionSize"
29+
description: "prometheus administor username"
30+
- name: "server.password"
3131
required: false
32-
description: "retentionSize config for values.yaml default 0, unit MB, GB, TB"
32+
description: "prometheus administor password"
33+
- name: "drycc.token"
34+
required: false
35+
description: "drycc user token"
36+
- name: "drycc.url"
37+
required: false
38+
description: "drycc url"
39+
- name: "drycc.scheme"
40+
required: false
41+
description: "drycc scheme"
3342
- name: "server.rules"
3443
required: false
3544
description: "rules config for values.yaml"
36-
- name: "scrapeNamespaces"
37-
required: false
3845
archive: false

addons/prometheus/2/plans/standard-10/meta.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

addons/prometheus/2/plans/standard-10/values.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

addons/prometheus/2/plans/standard-100/meta.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

addons/prometheus/2/plans/standard-100/values.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)