Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PGA helm chart #215

Merged
merged 29 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
68d9bac
PGA helm chart
ashwani-opstree Jul 13, 2024
26f3683
ds for grafana
ashwani-opstree Jul 16, 2024
fb62eff
thanos setup
ashwani-opstree Jul 17, 2024
6256b98
thanos sidecar
ashwani-opstree Jul 17, 2024
2690c71
Add external labels to make the Prometheus cluster distinguishable
ashwani-opstree Jul 17, 2024
6053ba6
Remove dependency chart
ashwani-opstree Jul 19, 2024
4b3c52f
disable thanos in default values yaml
ashwani-opstree Jul 22, 2024
a98b431
Resolve dep
ashwani-opstree Jul 22, 2024
ab6b793
Resolve dep
ashwani-opstree Jul 22, 2024
2bd9699
fix the namespace
ashwani-opstree Jul 22, 2024
7f9e1a1
Hard cord the helm chart version
ashwani-opstree Jul 22, 2024
1da31e0
Hard cord the helm chart version
ashwani-opstree Jul 22, 2024
11a2ceb
Add tempo datasource
ashwani-opstree Jul 23, 2024
bc3bc36
Create Monitoring_Setup_with_Helm.md
ayushh09 Jul 29, 2024
0f91686
Create readme
ashwani-opstree Jul 29, 2024
07cb782
Remove spaces
ashwani-opstree Jul 29, 2024
429b3c5
Create datasources
ashwani-opstree Jul 31, 2024
523f99a
Fix the typo
ashwani-opstree Jul 31, 2024
1068c59
Remove percona files
ashwani-opstree Jul 31, 2024
dbda500
Remove readme file from wrong place
ashwani-opstree Jul 31, 2024
350fbd2
Ignore Chart.lock file
ashwani-opstree Jul 31, 2024
356e19a
Add maintainers
ashwani-opstree Jul 31, 2024
007264c
Change chart path
ashwani-opstree Jul 31, 2024
5d4ba97
Fix no new line character at the end of file
ashwani-opstree Jul 31, 2024
269a50e
Fix indentation of yaml
ashwani-opstree Jul 31, 2024
99a3f12
Fix 141:43 [brackets] too many spaces inside brackets
ashwani-opstree Jul 31, 2024
89c9c57
Ignore community chart to lint validation
ashwani-opstree Jul 31, 2024
f761e13
exclude dependency chart
ashwani-opstree Jul 31, 2024
a17d450
ignore from lint
ashwani-opstree Jul 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.tgz
*.tgz
Chart.lock
56 changes: 56 additions & 0 deletions charts/pga/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: v2
name: pga
description: A Helm chart for prometheus, grafana and alertmanager
type: application
version: 1.0.0
appVersion: 1.0.0
maintainers:
- name: ashwani-opstree

dependencies:
- name: kube-prometheus-stack
version: 61.3.1
repository: https://prometheus-community.github.io/helm-charts/
alias: app
tags:
- monitoring
condition: app.enabled

- name: kube-prometheus-stack
version: 61.3.1
repository: https://prometheus-community.github.io/helm-charts/
alias: kube
tags:
- monitoring

- name: prometheus-adapter
version: 4.10.0
repository: https://prometheus-community.github.io/helm-charts/
tags:
- monitoring
alias: adapter
condition: adapter.enabled

- name: prometheus-pushgateway
version: 2.14.0
repository: https://prometheus-community.github.io/helm-charts/
tags:
- monitoring
alias: pushgateway
condition: pushgateway.enabled

- name: prometheus-blackbox-exporter
version: 8.17.0
repository: https://prometheus-community.github.io/helm-charts/
tags:
- blackbox
alias: blackbox
condition: blackbox.enabled

- name: thanos
version: 15.7.12
repository: https://charts.bitnami.com/bitnami
tags:
- thanos
alias: thanos
condition: thanos.enabled
36 changes: 36 additions & 0 deletions charts/pga/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Prometheus Monitoring Setup with Helm

This document provides detailed instructions for setting up Prometheus monitoring in a Kubernetes cluster using Helm charts. Follow these commands to deploy Prometheus and its associated components.

## 1. Apply Custom Resource Definitions (CRDs)

Run the following commands to apply each CRD:

```bash
kubectl apply --server-side=true -f https://raw.githubusercontent.com/prometheus-community/helm-charts/kube-prometheus-stack-61.5.0/charts/kube-prometheus-stack/charts/crds/crds/crd-alertmanagers.yaml
kubectl apply --server-side=true -f https://raw.githubusercontent.com/prometheus-community/helm-charts/kube-prometheus-stack-61.5.0/charts/kube-prometheus-stack/charts/crds/crds/crd-alertmanagerconfigs.yaml
kubectl apply --server-side=true -f https://raw.githubusercontent.com/prometheus-community/helm-charts/kube-prometheus-stack-61.5.0/charts/kube-prometheus-stack/charts/crds/crds/crd-podmonitors.yaml
kubectl apply --server-side=true -f https://raw.githubusercontent.com/prometheus-community/helm-charts/kube-prometheus-stack-61.5.0/charts/kube-prometheus-stack/charts/crds/crds/crd-probes.yaml
kubectl apply --server-side=true -f https://raw.githubusercontent.com/prometheus-community/helm-charts/kube-prometheus-stack-61.5.0/charts/kube-prometheus-stack/charts/crds/crds/crd-prometheusagents.yaml
kubectl apply --server-side=true -f https://raw.githubusercontent.com/prometheus-community/helm-charts/kube-prometheus-stack-61.5.0/charts/kube-prometheus-stack/charts/crds/crds/crd-prometheuses.yaml
kubectl apply --server-side=true -f https://raw.githubusercontent.com/prometheus-community/helm-charts/kube-prometheus-stack-61.5.0/charts/kube-prometheus-stack/charts/crds/crds/crd-prometheusrules.yaml
kubectl apply --server-side=true -f https://raw.githubusercontent.com/prometheus-community/helm-charts/kube-prometheus-stack-61.5.0/charts/kube-prometheus-stack/charts/crds/crds/crd-scrapeconfigs.yaml
kubectl apply --server-side=true -f https://raw.githubusercontent.com/prometheus-community/helm-charts/kube-prometheus-stack-61.5.0/charts/kube-prometheus-stack/charts/crds/crds/crd-servicemonitors.yaml
kubectl apply --server-side=true -f https://raw.githubusercontent.com/prometheus-community/helm-charts/kube-prometheus-stack-61.5.0/charts/kube-prometheus-stack/charts/crds/crds/crd-thanosrulers.yaml
```
## 2. Update Helm Chart Dependencies
```bash
helm dep update
```
Updates Helm chart dependencies.

## 3. Create a Namespace for Monitoring
```bash
kubectl create ns monitoring
```
Creates a Kubernetes namespace named monitoring.

## 4. Render chart templates locally and apply
```bash
helm template --name-template=monitoring . -n monitoring -f values.yaml | kubectl apply -f -
```
19 changes: 19 additions & 0 deletions charts/pga/examples/thanos/pga.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
app:
enabled: false

kube:
enabled: true
grafana:
enabled: true
sidecar:
datasources:
defaultDatasourceEnabled: false

pushgateway:
enabled: false

blackbox:
enabled: false

adapter:
enabled: true
257 changes: 257 additions & 0 deletions charts/pga/examples/thanos/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
app:
enabled: false

kube:
enabled: true
fullnameOverride: kube
commonLabels:
prometheus: kube
defaultRules:
create: false
alertmanager:
enabled: true
alertmanagerSpec:
retention: 240h
resources:
requests:
cpu: 250m
memory: 500Mi
limits:
cpu: 250m
memory: 500Mi
storage:
volumeClaimTemplate:
spec:
# storageClassName: encrypted-gp3
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
grafana:
enabled: true
sidecar:
datasources:
defaultDatasourceEnabled: false
kubeApiServer:
enabled: true
kubelet:
enabled: true
namespace: kube-system
kubeControllerManager:
enabled: false
coreDns:
enabled: true
kubeEtcd:
enabled: false
kubeScheduler:
enabled: false
kubeProxy:
enabled: false
kubeStateMetrics:
enabled: true
kube-state-metrics:
customLabels:
prometheus: kube
enabled: true
podSecurityPolicy:
enabled: false
resources:
requests:
cpu: 250m
memory: 500Mi
limits:
cpu: 250m
memory: 500Mi
nodeExporter:
enabled: true
prometheus-node-exporter:
prometheus:
monitor:
additionalLabels:
prometheus: kube
# rbac:
# pspEnabled: false
# image:
# repository:
# tag: latest
# pullPolicy: Always
prometheusOperator:
enabled: true
admissionWebhooks:
enabled: false
deployment:
enabled: true
tls:
enabled: false
prometheus:
enabled: true
thanosService:
enabled: true
thanosServiceMonitor:
enabled: true
prometheusSpec:
externalLabels:
kkubernetes_cluster: opstree
prometheus_cluster: kube
# get more details https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.ThanosSpec
thanos:
version: 0.35.1
# image: quay.io/thanos/thanos:v0.35.1
blockSize: 5m
objectStorageConfig:
existingSecret:
key: objstore.yml
name: monitoring-thanos-objstore-secret
# nodeSelector:
# appType: monitoring
# tolerations:
# - key: "appType"
# operator: "Equal"
# value: "monitoring"
# effect: "NoSchedule"
# remoteWrite:
# - url: https://app.last9.io/jupiter/prometheus/write
# basicAuth:
# username:
# name: promsecret
# key: username
# password:
# name: promsecret
# key: password
## # Do not add the writeRelabelConfigs section if you want to
## # send all metrics via remote write
## writeRelabelConfigs:
# - sourceLabels: [ __name__ ]
# regex: 'istio*'
# action: keep
# image:
# tag: v2.41.0
retention: 1h
replicas: 2
# externalUrl: "http://kube-opstree.prod.internal/"
resources:
requests:
cpu: "500m"
memory: 500Mi
limits:
cpu: "500m"
memory: 500Mi
storageSpec:
volumeClaimTemplate:
spec:
# storageClassName: encrypted-gp3
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 1Gi
serviceMonitorSelector:
matchExpressions:
- key: prometheus
operator: In
values:
- kube
podMonitorSelector:
matchExpressions:
- key: prometheus
operator: In
values:
- kube
ruleSelector:
matchLabels:
prometheus: kube
service:
name: kube-prometheus


pushgateway:
enabled: false
serviceMonitor:
enabled: true
namespace: monitoring
additionalLabels:
prometheus: app
extraArgs:
- --log.level=debug
- --push.disable-consistency-check
resources:
limits:
cpu: 1
memory: 4096Mi
requests:
cpu: 500m
memory: 4096Mi

blackbox:
enabled: false
serviceMonitor:
enabled: true
defaults:
additionalMetricsRelabels: {}
labels:
prometheus: app
interval: 30s
scrapeTimeout: 30s
module: http_2xx
config:
modules:
http_2xx:
prober: http
timeout: 5s
http:
valid_http_versions: [ "HTTP/1.0", "HTTP/1.1", "HTTP/2.0" ]
no_follow_redirects: false
preferred_ip_protocol: "ip4"
fail_if_ssl: false
fail_if_not_ssl: false

adapter:
enabled: false

thanos:
enabled: true
objstoreConfig: |-
type: s3
config:
bucket: thanos
endpoint: monitoring-minio.monitoring.svc.cluster.local:9000
access_key: minio
secret_key: minio123
insecure: true
query:
dnsDiscovery:
sidecarsService: kube-thanos-discovery
sidecarsNamespace: monitoring
bucketweb:
enabled: true
compactor:
enabled: false
storegateway:
enabled: true
ruler:
enabled: true
serviceMonitor:
namespace: monitoring
alertmanagers:
- http://kube-alertmanager.monitoring.svc.cluster.local:9093
config: |-
groups:
- name: "metamonitoring"
rules:
- alert: "PrometheusDown"
expr: absent(up{prometheus="monitoring/kube-prometheus"})
metrics:
enabled: true
serviceMonitor:
namespace: monitoring
enabled: true
minio:
enabled: true
auth:
rootPassword: minio123
rootUser: minio
monitoringBuckets: thanos
accessKey:
password: minio
secretKey:
password: minio123
Loading
Loading