-
Notifications
You must be signed in to change notification settings - Fork 27
Draft: kaas logging monitoring tracing #656
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
Draft
tonifinger
wants to merge
6
commits into
main
Choose a base branch
from
issue/418-kaas-logging-monitoring-tracing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
116bd82
Inital development of decision record on "KubernetesLogging/Monitorin…
tonifinger 838f32a
Added more detail regarding "KubernetesLogging/Monitoring/Tracing"
tonifinger 7cde0eb
Add proposal to standardize the use of the Kubernetes metrics server
tonifinger eb64ae2
Adding additional information
tonifinger cd53e9d
Update Standards/scs-0219-v1-k8s-monitoring-logging-tracing.md
tonifinger 25d4a36
Update "scs-0219-v1-k8s-monitoring-logging-tracing.md"
tonifinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,97 @@ | ||||||
--- | ||||||
title: Kubernetes Logging/Monitoring/Tracing | ||||||
type: Decision Record | ||||||
status: Draft | ||||||
track: KaaS | ||||||
--- | ||||||
|
||||||
|
||||||
## Motivation | ||||||
|
||||||
Either as an operators or as an end users of a Kubernetes cluster, at some point you will need to debug useful information. | ||||||
In order to obtain this information, mechanisms SHOULD be available to retrieve this information. | ||||||
These mechanisms consist of: | ||||||
* Logging | ||||||
* Monitoring | ||||||
* Tracing | ||||||
|
||||||
The aim of this decision record is to examine how Kubernetes handles those mechanisms. | ||||||
Derived from this, this decision record provides a suggestion on how a Kubernetes cluster SHOULD be configured in order to provide meaningful and comprehensible information via logging, monitoring and tracing. | ||||||
|
||||||
|
||||||
## Decision | ||||||
|
||||||
A Kubernetes cluster MUST provide both monitoring and logging. | ||||||
In addition, a Kubernetes cluster MAY provide traceability mechanisms, as this is important for time-based troubleshooting. | ||||||
Therefore, a standardized concept for the setup of the overall mechanisms as well as the resources to be consumed MUST be defined. | ||||||
|
||||||
This concept SHALL define monitoring and logging in a federated structure. | ||||||
Therefore, a monitoring and logging stack MUST be deployed on each k8s cluster. | ||||||
A central monitoring system can then fetch data from the individual clusters' monitoring stacks to Grafana to visualize the collected metrics. | ||||||
|
||||||
### Monitoring | ||||||
|
||||||
> see: [Metrics For Kubernetes System Components][system-metrics] | ||||||
> see: [Metrics for Kubernetes Object States][kube-state-metrics] | ||||||
|
||||||
|
||||||
SCS KaaS infrastructure monitoring SHOULD be used as a diagnostic tool to alert operators and end users to system-related issues by analyzing metrics. | ||||||
Therefore, it includes the collection and visualization of the corresponding metrics. | ||||||
|
||||||
Alongside, an alerting mechanism MUST also be standardized. | ||||||
This MUST contain a minimal set of important metrics that signal problematic conditions of a cluster in any case. | ||||||
|
||||||
> TODO: Describe one examples here in more detail | ||||||
|
||||||
|
||||||
#### Kubernetes Metric Server | ||||||
|
||||||
Kubernetes provides a source for container resource metrics. | ||||||
The main purpose of this source is to be used for Kubernetes' built-in auto-scaling [kubernetes-metrics-server][kubernetes-metrics-server-repo]. | ||||||
However, it could also be used as a source of metrics for monitoring. | ||||||
Therefore, this metrics server MUST also be readily accessible for the monitoring setup. | ||||||
|
||||||
Furthermore, end users rely on certain metrics to debug their applications. | ||||||
More specifically, an end user wants to have access to all metrics defined by Kubernetes itself. | ||||||
The content of the metrics to be provided by the [kubernetes-metrics-server][kubernetes-metrics-server-repo] are bound to a Kubernetes version and are organized according to the [kubernetes metrics lifecycle][system-metrics_metric-lifecycle]). | ||||||
|
||||||
In order for an end user to be sure that these metrics are accessible, a cluster MUST provide the metrics in the respective version. | ||||||
|
||||||
|
||||||
#### Prometheus Operator | ||||||
|
||||||
One of the most commonly used monitoring tools in connection with Kubernetes is Prometheus | ||||||
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
|
||||||
Therefore, every k8s cluster COULD have a [prometheus-operator][prometheus-operator] deployed to all control plane nodes per default. | ||||||
The operator SHOULD at least be rolled out to all control plane nodes. | ||||||
|
||||||
|
||||||
#### Security | ||||||
|
||||||
Communication between the Prometheus services (expoter, database, federation, etc.) SHOULD be accomplished using "[mutual][mutual-auth] TLS" (mTLS). | ||||||
|
||||||
### Logging | ||||||
|
||||||
In Kubernetes clusters, log data is not persistent and is discarded after a container is stopped or destroyed. | ||||||
This makes it difficult to debug crashed pods of a deployment after they have been destroyed. | ||||||
Therefore, the SCS stack SHOULD also optionally provide a logging stack that solves this problem by storing the log file in a self-managed database beyond the lifetime of a container. | ||||||
|
||||||
> see: [Logging Architecture][k8s-logging] | ||||||
|
||||||
### Tracing | ||||||
|
||||||
|
||||||
[k8s-debug]: https://kubernetes.io/docs/tasks/debug/ | ||||||
[prometheus-operator]: https://github.com/prometheus-operator/prometheus-operator | ||||||
[k8s-metrics]: https://github.com/kubernetes/metrics | ||||||
[system-metrics]: https://kubernetes.io/docs/concepts/cluster-administration/system-metrics/ | ||||||
[system-metrics_metric-lifecycle]: https://kubernetes.io/docs/concepts/cluster-administration/system-metrics/#metric-lifecycle | ||||||
[kube-state-metrics]: https://kubernetes.io/docs/concepts/cluster-administration/kube-state-metrics/ | ||||||
[k8s-deprecating-a-metric]: https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecating-a-metric | ||||||
[k8s-show-hidden-metrics]: https://kubernetes.io/docs/concepts/cluster-administration/system-metrics/#show-hidden-metrics | ||||||
[system-traces]: https://kubernetes.io/docs/concepts/cluster-administration/system-traces/ | ||||||
[system-logs]: https://kubernetes.io/docs/concepts/cluster-administration/system-logs/ | ||||||
[monitor-node-health]: https://kubernetes.io/docs/tasks/debug/debug-cluster/monitor-node-health/ | ||||||
[k8s-logging]: https://kubernetes.io/docs/concepts/cluster-administration/logging/ | ||||||
[mutual-auth]: https://en.wikipedia.org/wiki/Mutual_authentication | ||||||
[kubernetes-metrics-server-repo]: https://github.com/kubernetes-sigs/metrics-server?tab=readme-ov-file#kubernetes-metrics-server | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.