-
Notifications
You must be signed in to change notification settings - Fork 3
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
added x-metrics pod monitor #8
base: main
Are you sure you want to change the base?
Changes from 30 commits
e79781a
97c6a6e
ab39fc9
e75584e
80c294a
798f785
91b73ff
96db29f
ec5c873
9c1e7ed
7be5310
aca5877
09c9e68
884713b
aa7502e
dab3b01
86ed1a4
f16fb4e
b68c396
7d199f6
ac0453e
9ba87a6
10b18ff
e980050
8be1e6a
d235260
1a9e312
554b2c6
b692476
8fb5789
658dde8
7cb4f68
a4dc317
f5b61c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -5,6 +5,20 @@ with open source software integrations such as Prometheus and Grafana. | |||||||
Observability is a measure of how well platform performance can be inferred | ||||||||
from knowledge of its metrics, logs and traces outputs. | ||||||||
|
||||||||
**Warning** | ||||||||
## Disclaimer: Management Cluster Resource Use | ||||||||
Prometheus and Grafana may require significant cluster resources in relation | ||||||||
to the amount of metrics scraped, processed and visualized. This may impact | ||||||||
cluster operations. Consult the respective Prometheus Operator and | ||||||||
Grafana documentation for set up guidance prior to using this configuration | ||||||||
on mission critical Crossplane management clusters. | ||||||||
|
||||||||
**Warning** | ||||||||
## Disclaimer: Metric Stability | ||||||||
Crossplane has no concept of metric stability. This implies | ||||||||
that metrics used in this configuration may be absent in future versions | ||||||||
of Crossplane and / or its providers. | ||||||||
|
||||||||
## Purpose | ||||||||
The goal for configuration-observability-oss is to complement | ||||||||
other configurations such as configuration-caas. See the | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is configuration-caas? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. configuration-caas is a plug and play configuration for cluster as a service. |
||||||||
|
@@ -20,37 +34,32 @@ at the conclusion of the tests by default. | |||||||
|
||||||||
Apply the resource claim as follows to re-create | ||||||||
the namespace, Prometheus, Grafana and dependencies for further | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is the claim 're-creating' the ns, Prometheus, and Grafana? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about we offer a make cluster so that the workflow does not duplicate the installation after Uptest cleaned up its test setup? Users who want to run make e2e could do it purposefully as a separate step with or without pre-existing cluster. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a make cluster option. |
||||||||
exploration. | ||||||||
exploration. Note that the xmetrics configuration examples | ||||||||
rely on the CRDs to be installed through the oss composition | ||||||||
first. | ||||||||
``` | ||||||||
kubectl apply -f examples/oss.yaml | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this claim installing x-metrics? If so, change the name. OSS is very generic, I would avoid using it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you recommend to not use oss.yaml for the claim name, even though x-metrics, prometheus and grafana are open source? If so, which name would resonate with you? |
||||||||
``` | ||||||||
Wait until xmetrics CRDs have been installed, then apply | ||||||||
the xmetrics configuration to see metrics flowing. | ||||||||
``` | ||||||||
kubectl apply -f examples/xmetrics.yaml | ||||||||
``` | ||||||||
|
||||||||
To load dashboards that are part of this configuration repository, | ||||||||
please apply the following dashboard resource claims. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated. |
||||||||
``` | ||||||||
kubectl apply -f examples/dashboards/folder-grafana.yaml | ||||||||
kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-health.yaml | ||||||||
kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-mr.yaml | ||||||||
kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-resources-ttr.yaml | ||||||||
kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-sli-metrics.yaml | ||||||||
kubectl apply -f examples/dashboards | ||||||||
``` | ||||||||
|
||||||||
Use the following to forward localhost:9090 to the Prometheus pod. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated. |
||||||||
``` | ||||||||
PROMETHEUS_POD_NAME=$(k -n operators get pods|\ | ||||||||
awk '{print $1}'|\ | ||||||||
tail +2|\ | ||||||||
grep prometheus-0) | ||||||||
kubectl -n operators port-forward ${PROMETHEUS_POD_NAME} 9090 | ||||||||
kubectl -n operators port-forward prometheus-oss-kube-prometheus-stack-prometheus-0 9090 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
``` | ||||||||
|
||||||||
Use the following to forward localhost:3000 to the Grafana pod. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||||||||
``` | ||||||||
GRAFANA_POD_NAME=$(k -n operators get pods|\ | ||||||||
awk '{print $1}'|\ | ||||||||
tail +2|\ | ||||||||
grep grafana) | ||||||||
kubectl -n operators port-forward ${GRAFANA_POD_NAME} 3000 | ||||||||
kubectl -n operators port-forward svc/oss-grafana 3000:80 | ||||||||
``` | ||||||||
|
||||||||
Log in to Grafana at http://localhost:3000 with the credentials | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ spec: | |
apiVersion: kubernetes.crossplane.io/v1alpha1 | ||
kind: Object | ||
metadata: | ||
labels: | ||
labels: | ||
type: podMonitorCrossplaneRbacManager | ||
spec: | ||
forProvider: | ||
|
@@ -31,10 +31,14 @@ spec: | |
kind: PodMonitor | ||
metadata: | ||
name: crossplane-rbac-manager | ||
namespace: upbound-system | ||
namespace: operators | ||
labels: | ||
app: crossplane-rbac-manager | ||
spec: | ||
namespaceSelector: | ||
matchNames: | ||
- crossplane-system | ||
- upbound-system | ||
selector: | ||
matchLabels: | ||
app: crossplane-rbac-manager | ||
|
@@ -49,7 +53,7 @@ spec: | |
apiVersion: kubernetes.crossplane.io/v1alpha1 | ||
kind: Object | ||
metadata: | ||
labels: | ||
labels: | ||
type: podMonitorCrossplane | ||
spec: | ||
forProvider: | ||
|
@@ -58,10 +62,14 @@ spec: | |
kind: PodMonitor | ||
metadata: | ||
name: crossplane | ||
namespace: upbound-system | ||
namespace: operators | ||
labels: | ||
app: crossplane | ||
spec: | ||
namespaceSelector: | ||
matchNames: | ||
- crossplane-system | ||
- upbound-system | ||
selector: | ||
matchLabels: | ||
app: crossplane | ||
|
@@ -76,7 +84,7 @@ spec: | |
apiVersion: kubernetes.crossplane.io/v1alpha1 | ||
kind: Object | ||
metadata: | ||
labels: | ||
labels: | ||
type: podMonitorCrossplaneProviders | ||
spec: | ||
forProvider: | ||
|
@@ -85,10 +93,14 @@ spec: | |
kind: PodMonitor | ||
metadata: | ||
name: crossplane-providers | ||
namespace: upbound-system | ||
namespace: operators | ||
labels: | ||
app: crossplane-providers | ||
spec: | ||
namespaceSelector: | ||
matchNames: | ||
- crossplane-system | ||
- upbound-system | ||
selector: | ||
matchLabels: | ||
app: crossplane-providers | ||
|
@@ -98,6 +110,39 @@ spec: | |
- type: PatchSet | ||
patchSetName: common | ||
|
||
- name: podMonitorXmetrics | ||
base: | ||
apiVersion: kubernetes.crossplane.io/v1alpha1 | ||
kind: Object | ||
metadata: | ||
labels: | ||
type: podMonitorXmetrics | ||
Comment on lines
+113
to
+119
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. X-metrics installs with a service, when a service exists, it is better to use a service monitor for Prometheus. The helm chart already supports service monitor, use helm values to enable it. |
||
spec: | ||
forProvider: | ||
manifest: | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PodMonitor | ||
metadata: | ||
name: x-metrics | ||
namespace: operators | ||
labels: | ||
app: x-metrics | ||
spec: | ||
namespaceSelector: | ||
matchNames: | ||
- crossplane-system | ||
- upbound-system | ||
- x-metrics | ||
selector: | ||
matchLabels: | ||
app: x-metrics | ||
podMetricsEndpoints: | ||
- port: metrics | ||
path: "/x-metrics" | ||
patches: | ||
- type: PatchSet | ||
patchSetName: common | ||
|
||
- name: releasePrometheus | ||
base: | ||
apiVersion: helm.crossplane.io/v1beta1 | ||
|
@@ -122,6 +167,12 @@ spec: | |
patchSetName: common | ||
- fromFieldPath: spec.parameters.id | ||
toFieldPath: metadata.name | ||
- fromFieldPath: metadata.labels | ||
toFieldPath: metadata.labels | ||
- fromFieldPath: metadata.annotations | ||
toFieldPath: metadata.annotations | ||
- fromFieldPath: spec.parameters.operators.prometheus.version | ||
toFieldPath: spec.forProvider.chart.version | ||
- fromFieldPath: spec.parameters.id | ||
toFieldPath: metadata.annotations[crossplane.io/external-name] | ||
transforms: | ||
|
@@ -131,12 +182,24 @@ spec: | |
- type: regexp | ||
regexp: '.*' | ||
result: oss | ||
- fromFieldPath: metadata.labels | ||
toFieldPath: metadata.labels | ||
- fromFieldPath: metadata.annotations | ||
toFieldPath: metadata.annotations | ||
- fromFieldPath: spec.parameters.operators.prometheus.version | ||
toFieldPath: spec.forProvider.chart.version | ||
|
||
- name: usagePrometheusByPodMonitorXmetrics | ||
base: | ||
apiVersion: apiextensions.crossplane.io/v1alpha1 | ||
kind: Usage | ||
spec: | ||
of: | ||
apiVersion: helm.crossplane.io/v1beta1 | ||
kind: Release | ||
resourceSelector: | ||
matchControllerRef: true | ||
by: | ||
apiVersion: kubernetes.crossplane.io/v1alpha1 | ||
kind: Object | ||
resourceSelector: | ||
matchControllerRef: true | ||
matchLabels: | ||
type: podMonitorXmetrics | ||
|
||
- name: usagePrometheusByPodMonitorCrossplaneRbacManager | ||
base: | ||
|
@@ -191,3 +254,19 @@ spec: | |
matchControllerRef: true | ||
matchLabels: | ||
type: podMonitorCrossplaneProviders | ||
|
||
- name: releaseXMetrics | ||
base: | ||
apiVersion: helm.crossplane.io/v1beta1 | ||
kind: Release | ||
spec: | ||
rollbackLimit: 3 | ||
forProvider: | ||
namespace: x-metrics | ||
chart: | ||
name: x-metrics | ||
repository: https://crossplane-contrib.github.io/x-metrics | ||
version: "0.1.3" | ||
patches: | ||
- type: PatchSet | ||
patchSetName: common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These warning messages do not provide much direction and the language has negative connotation. Consider rewriting them. What is the goal of having them here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal is to guide users to keep their mission critical management clusters happily operational through proper Prometheus tuning. I'll come up with more positive wording.