-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update cnl-quickstart with Prometheus and Grafana
- Loading branch information
Showing
13 changed files
with
590 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ afterInstallationManual: | | |
namespaces: | ||
- kafka | ||
- argocd | ||
- argocd | ||
- prometheus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: v2 | ||
name: cnl-quickstart-monitoring | ||
description: Deploys common used cloud native tools for Cloud Native Lab | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.1.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "0.1.0" |
10 changes: 10 additions & 0 deletions
10
charts/cnl-quickstart/subcharts/monitoring/templates/_helpers.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{/* | ||
Allow the release namespace to be overridden for multi-namespace deployments in combined charts. | ||
*/}} | ||
{{- define "monitoring.namespace" -}} | ||
{{- if .Values.namespaceOverride -}} | ||
{{- .Values.namespaceOverride -}} | ||
{{- else -}} | ||
{{- .Release.Namespace -}} | ||
{{- end -}} | ||
{{- end -}} |
46 changes: 46 additions & 0 deletions
46
charts/cnl-quickstart/subcharts/monitoring/templates/grafana-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: grafana | ||
labels: | ||
app: strimzi | ||
namespace: {{ template "monitoring.namespace" . }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: grafana | ||
template: | ||
metadata: | ||
labels: | ||
name: grafana | ||
spec: | ||
containers: | ||
- name: grafana | ||
image: grafana/grafana:9.5.18 | ||
ports: | ||
- name: grafana | ||
containerPort: 3000 | ||
protocol: TCP | ||
volumeMounts: | ||
- name: grafana-data | ||
mountPath: /var/lib/grafana | ||
- name: grafana-logs | ||
mountPath: /var/log/grafana | ||
readinessProbe: | ||
httpGet: | ||
path: /api/health | ||
port: 3000 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
livenessProbe: | ||
httpGet: | ||
path: /api/health | ||
port: 3000 | ||
initialDelaySeconds: 15 | ||
periodSeconds: 20 | ||
volumes: | ||
- name: grafana-data | ||
emptyDir: {} | ||
- name: grafana-logs | ||
emptyDir: {} |
17 changes: 17 additions & 0 deletions
17
charts/cnl-quickstart/subcharts/monitoring/templates/grafana-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: grafana | ||
labels: | ||
app: strimzi | ||
namespace: {{ template "monitoring.namespace" . }} | ||
spec: | ||
ports: | ||
- name: grafana | ||
port: 3000 | ||
targetPort: 3000 | ||
protocol: TCP | ||
nodePort: 32000 # Port for demo purposes | ||
selector: | ||
name: grafana | ||
type: NodePort |
94 changes: 94 additions & 0 deletions
94
charts/cnl-quickstart/subcharts/monitoring/templates/prometheus-additional.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: additional-scrape-configs | ||
namespace: {{ template "monitoring.namespace" . }} | ||
type: Opaque | ||
stringData: | ||
prometheus-additional.yaml: | | ||
- job_name: kubernetes-cadvisor | ||
honor_labels: true | ||
scrape_interval: 10s | ||
scrape_timeout: 10s | ||
metrics_path: /metrics/cadvisor | ||
scheme: https | ||
kubernetes_sd_configs: | ||
- role: node | ||
namespaces: | ||
names: [] | ||
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token | ||
tls_config: | ||
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | ||
insecure_skip_verify: true | ||
relabel_configs: | ||
- separator: ; | ||
regex: __meta_kubernetes_node_label_(.+) | ||
replacement: $1 | ||
action: labelmap | ||
- separator: ; | ||
regex: (.*) | ||
target_label: __address__ | ||
replacement: kubernetes.default.svc:443 | ||
action: replace | ||
- source_labels: [__meta_kubernetes_node_name] | ||
separator: ; | ||
regex: (.+) | ||
target_label: __metrics_path__ | ||
replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor | ||
action: replace | ||
- source_labels: [__meta_kubernetes_node_name] | ||
separator: ; | ||
regex: (.*) | ||
target_label: node_name | ||
replacement: $1 | ||
action: replace | ||
- source_labels: [__meta_kubernetes_node_address_InternalIP] | ||
separator: ; | ||
regex: (.*) | ||
target_label: node_ip | ||
replacement: $1 | ||
action: replace | ||
metric_relabel_configs: | ||
- source_labels: [container, __name__] | ||
separator: ; | ||
regex: POD;container_(network).* | ||
target_label: container | ||
replacement: $1 | ||
action: replace | ||
- source_labels: [container] | ||
separator: ; | ||
regex: POD | ||
replacement: $1 | ||
action: drop | ||
- source_labels: [container] | ||
separator: ; | ||
regex: ^$ | ||
replacement: $1 | ||
action: drop | ||
- source_labels: [__name__] | ||
separator: ; | ||
regex: container_(network_tcp_usage_total|tasks_state|memory_failures_total|network_udp_usage_total) | ||
replacement: $1 | ||
action: drop | ||
- job_name: kubernetes-nodes-kubelet | ||
scrape_interval: 10s | ||
scrape_timeout: 10s | ||
scheme: https | ||
kubernetes_sd_configs: | ||
- role: node | ||
namespaces: | ||
names: [] | ||
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token | ||
tls_config: | ||
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | ||
insecure_skip_verify: true | ||
relabel_configs: | ||
- action: labelmap | ||
regex: __meta_kubernetes_node_label_(.+) | ||
- target_label: __address__ | ||
replacement: kubernetes.default.svc:443 | ||
- source_labels: [__meta_kubernetes_node_name] | ||
regex: (.+) | ||
target_label: __metrics_path__ | ||
replacement: /api/v1/nodes/${1}/proxy/metrics |
Oops, something went wrong.