Skip to content

Commit b0b9858

Browse files
sc-14492 added country
1 parent 71aa03a commit b0b9858

2 files changed

Lines changed: 186 additions & 42 deletions

File tree

Lines changed: 103 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# Secret resource for Grafana OAuth client_id and client_secret
2+
# apiVersion: v1
3+
# kind: Secret
4+
# metadata:
5+
# name: grafana-sso
6+
# namespace: monitoring
7+
# data:
8+
# oauth_client_id: <base64_client_id>
9+
# oauth_client_secret: <base64_client_secret>
10+
11+
---
12+
# Prometheus configuration
113
prometheus:
214
extraScrapeConfigs: |
315
- job_name: 'federate'
@@ -10,10 +22,60 @@ prometheus:
1022
- '{__name__=~".+"}'
1123
static_configs:
1224
- targets:
13-
- 'prometheus-sandbox.simple.org'
25+
- 'prometheus-sandbox.simple.org'
26+
- 'prometheus-demo.bd.simple.org'
27+
- 'prometheus.in.simple.org'
28+
- 'prometheus-sandbox.simple.org'
29+
- 'simples13.health.gov.lk/prometheus'
1430
basic_auth:
1531
username: 'db25a3474d90'
1632
password_file: '/etc/secrets/default'
33+
relabel_configs:
34+
- target_label: 'country'
35+
replacement: 'bgd'
36+
source_labels: [__param_target]
37+
regex: 'prometheus.bd.simple.org'
38+
- target_label: 'environment'
39+
replacement: 'prod'
40+
source_labels: [__param_target]
41+
regex: 'prometheus.bd.simple.org'
42+
43+
- target_label: 'country'
44+
replacement: 'lka'
45+
source_labels: [__param_target]
46+
regex: 'simples13.health.gov.lk/prometheus'
47+
- target_label: 'environment'
48+
replacement: 'prod'
49+
source_labels: [__param_target]
50+
regex: 'simples13.health.gov.lk/prometheus'
51+
52+
- target_label: 'country'
53+
replacement: 'ind'
54+
source_labels: [__param_target]
55+
regex: 'prometheus.in.simple.org'
56+
- target_label: 'environment'
57+
replacement: 'prod'
58+
source_labels: [__param_target]
59+
regex: 'prometheus.in.simple.org'
60+
61+
- target_label: 'country'
62+
replacement: 'bgd'
63+
source_labels: [__param_target]
64+
regex: 'prometheus-demo.bd.simple.org'
65+
- target_label: 'environment'
66+
replacement: 'demo'
67+
source_labels: [__param_target]
68+
regex: 'prometheus-demo.bd.simple.org'
69+
70+
- target_label: 'country'
71+
replacement: 'sandbox'
72+
source_labels: [__param_target]
73+
regex: 'prometheus-sandbox.simple.org'
74+
- target_label: 'environment'
75+
replacement: 'sandbox'
76+
source_labels: [__param_target]
77+
regex: 'prometheus-sandbox.simple.org'
78+
1779
server:
1880
persistentVolume:
1981
size: 100Gi
@@ -37,6 +99,7 @@ prometheus:
3799
- secretName: prometheus.simple.org-tls
38100
hosts:
39101
- prometheus.simple.org
102+
40103
alertmanager:
41104
ingress:
42105
className: nginx
@@ -59,42 +122,43 @@ prometheus:
59122
extraArgs:
60123
web.external-url: "https://alertmanager.simple.org"
61124
web.route-prefix: "/"
62-
grafana:
63-
admin:
64-
existingSecret: "grafana-secrets"
65-
ingress:
66-
enabled: true
67-
annotations:
68-
cert-manager.io/cluster-issuer: "letsencrypt-prod"
69-
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
70-
hosts:
71-
- grafana.simple.org
72-
tls:
73-
- secretName: grafana.simple.org-tls
74-
hosts:
75-
- grafana.simple.org
76-
persistence:
77-
enabled: true
78-
size: 50Gi
79-
grafana.ini:
80-
server:
81-
root_url: "https://grafana.simple.org/"
82-
auth.generic_oauth:
125+
126+
grafana:
127+
admin:
128+
existingSecret: "grafana-secrets"
129+
ingress:
83130
enabled: true
84-
name: Keycloak-OAuth
85-
allow_sign_up: true
86-
client_id: $__file{/etc/secrets/oauth_client_id}
87-
client_secret: $__file{/etc/secrets/oauth_client_secret}
88-
scopes: openid email profile offline_access roles
89-
email_attribute_path: email
90-
login_attribute_path: username
91-
name_attribute_path: full_name
92-
auth_url: https://sso.simple.org/realms/master/protocol/openid-connect/auth
93-
token_url: https://sso.simple.org/realms/master/protocol/openid-connect/token
94-
api_url: https://sso.simple.org/realms/master/protocol/openid-connect/userinfo
95-
role_attribute_path: contains(roles[*], 'admin') && 'Admin' || contains(roles[*], 'editor') && 'Editor' || 'Viewer'
96-
extraSecretMounts:
97-
- name: grafana-sso
98-
mountPath: /etc/secrets
99-
secretName: grafana-sso
100-
readOnly: true
131+
annotations:
132+
cert-manager.io/cluster-issuer: "letsencrypt-prod"
133+
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
134+
hosts:
135+
- grafana.simple.org
136+
tls:
137+
- secretName: grafana.simple.org-tls
138+
hosts:
139+
- grafana.simple.org
140+
persistence:
141+
enabled: true
142+
size: 50Gi
143+
grafana.ini:
144+
server:
145+
root_url: "https://grafana.simple.org/"
146+
auth.generic_oauth:
147+
enabled: true
148+
name: Keycloak-OAuth
149+
allow_sign_up: true
150+
client_id: $__file{/etc/secrets/oauth_client_id}
151+
client_secret: $__file{/etc/secrets/oauth_client_secret}
152+
scopes: openid email profile offline_access roles
153+
email_attribute_path: email
154+
login_attribute_path: username
155+
name_attribute_path: full_name
156+
auth_url: https://sso.simple.org/realms/master/protocol/openid-connect/auth
157+
token_url: https://sso.simple.org/realms/master/protocol/openid-connect/token
158+
api_url: https://sso.simple.org/realms/master/protocol/openid-connect/userinfo
159+
role_attribute_path: contains(roles[*], 'admin') && 'Admin' || contains(roles[*], 'editor') && 'Editor' || 'Viewer'
160+
extraSecretMounts:
161+
- name: grafana-sso
162+
mountPath: /etc/secrets
163+
secretName: grafana-sso
164+
readOnly: true

‎k8s/manifests/kube-prometheus/config/systems-production.libsonnet‎

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,84 @@
1414
externalUrl: 'https://prometheus.simple.org',
1515
retention: {
1616
enable: true,
17-
retention: '30d',
18-
storage: '10Gi',
17+
retention: '60d', // Retention duration updated to 60 days
18+
storage: '10Gi', // Storage size
1919
},
20+
extraScrapeConfigs: [
21+
{
22+
job_name: 'federate',
23+
scheme: 'https',
24+
scrape_interval: '15s',
25+
metrics_path: '/federate',
26+
params: {
27+
'match[]': ['{__name__=~".+"}'],
28+
},
29+
static_configs: [
30+
{
31+
targets: [
32+
'https://prometheus-sandbox.simple.org',
33+
'https://prometheus-demo.bd.simple.org',
34+
'https://prometheus.in.simple.org',
35+
'https://simples13.health.gov.lk/prometheus',
36+
],
37+
},
38+
],
39+
basic_auth: {
40+
username: 'db25a3474d90',
41+
password_file: '/etc/secrets/default',
42+
},
43+
relabel_configs: [
44+
{
45+
target_label: 'country',
46+
replacement: 'sandbox',
47+
source_labels: ['__param_target'],
48+
regex: 'https://prometheus-sandbox.simple.org',
49+
},
50+
{
51+
target_label: 'environment',
52+
replacement: 'sandbox',
53+
source_labels: ['__param_target'],
54+
regex: 'https://prometheus-sandbox.simple.org',
55+
},
56+
{
57+
target_label: 'country',
58+
replacement: 'bgd',
59+
source_labels: ['__param_target'],
60+
regex: 'https://prometheus-demo.bd.simple.org',
61+
},
62+
{
63+
target_label: 'environment',
64+
replacement: 'demo',
65+
source_labels: ['__param_target'],
66+
regex: 'https://prometheus-demo.bd.simple.org',
67+
},
68+
{
69+
target_label: 'country',
70+
replacement: 'lka',
71+
source_labels: ['__param_target'],
72+
regex: 'https://simples13.health.gov.lk/prometheus',
73+
},
74+
{
75+
target_label: 'environment',
76+
replacement: 'prod',
77+
source_labels: ['__param_target'],
78+
regex: 'https://simples13.health.gov.lk/prometheus',
79+
},
80+
{
81+
target_label: 'country',
82+
replacement: 'ind',
83+
source_labels: ['__param_target'],
84+
regex: 'https://prometheus.in.simple.org',
85+
},
86+
{
87+
target_label: 'environment',
88+
replacement: 'prod',
89+
source_labels: ['__param_target'],
90+
regex: 'https://prometheus.in.simple.org',
91+
},
92+
],
93+
},
94+
],
2095
ingress: {
2196
name: 'prometheus-k8s',
2297
host: 'prometheus.simple.org',
@@ -33,5 +108,10 @@
33108
path: '/',
34109
},
35110
},
36-
postgresNamespaces: [],
111+
postgresNamespaces: [
112+
'simple-v1',
113+
'dhis2-demo-ecuador',
114+
'dhis2-sandbox-01',
115+
'dhis2-sandbox-epidemics'
116+
],
37117
}

0 commit comments

Comments
 (0)