LabHub

Blog

CKA_4_Logging_Monitoring

한국어English日本語

This post is a study note based on the https://www.udemy.com/course/certified-kubernetes-administrator-with-practice-tests course and content from https://kodekloud.com/.

84 Monitor Cluster Components

Kubernetes does not have a built-in monitoring solution. Typically, solutions such as Prometheus, Elastic Stack, DataDog, and Dynatrace are used for metrics collection. Metrics Server is a project that succeeded the deprecated open-source project called Heapster. It aggregates data from Pods and Nodes in-memory, but because it is in-memory, it is difficult to store historical data. Kubelet has something called cAdvisor, also known as Container Advisor. It has an endpoint that exposes Pod metrics externally.

You can use commands like kubectl top by installing the Metrics Server.

For v1.21+, it can be installed with the following command:

$ kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/high-availability-1.21+.yaml

serviceaccount/metrics-server created
clusterrole.rbac.authorization.k8s.io/system:aggregated-metrics-reader created
clusterrole.rbac.authorization.k8s.io/system:metrics-server created
rolebinding.rbac.authorization.k8s.io/metrics-server-auth-reader created
clusterrolebinding.rbac.authorization.k8s.io/metrics-server:system:auth-delegator created
clusterrolebinding.rbac.authorization.k8s.io/system:metrics-server created
service/metrics-server created
deployment.apps/metrics-server created
poddisruptionbudget.policy/metrics-server created
apiservice.apiregistration.k8s.io/v1beta1.metrics.k8s.io created

87 Managing Application Logs

If a container in a Pod is outputting logs to standard out, how can you check them? You can check them using the kubectl logs command.

kubectl logs -f <filename>

If there are multiple containers in a single Pod, how do you distinguish between them? You can specify the container name along with the Pod name after kubectl logs.

logging

Quiz

Q1: What is the main topic covered in "CKA_4_Logging_Monitoring"? CKA_4_Logging_Monitoring

Q2: What are the key takeaways from this article? CKA_4_Logging_Monitoring

Q3: How can the concepts in this article be applied in practice? Consider the practical examples and patterns discussed throughout the post.

Comments

No comments yet.

Sign in to leave a comment