A Complete Introduction To Monitoring Kubernetes With New .

3y ago
44 Views
2 Downloads
987.33 KB
18 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Karl Gosselin
Transcription

White PaperA Complete Introductionto Monitoring Kuberneteswith New RelicThe fundamentals you need to know to effectively monitorKubernetes deployments

Table of ContentsIntroduction 03Monitoring Kubernetes with New Relic 04Getting started 04Exploring clusters with the Kubernetes cluster explorer 05Benefits of monitoring with the cluster explorer 06Kubernetes Observability Visualizing services 07Monitoring cluster health and capacity 07Correlating Kubernetes events with cluster health 12Integrating with APM data 13Integrating with Prometheus metrics 15Using Prometheus data in New Relic 15Monitoring logs in context 16Investigating end-user experience 17Scaling Kubernetes with Success: A Real-World Example 020718

A Complete Introduction to Monitoring Kubernetes with New RelicIntroductionBefore Kubernetes took over the world, cluster adminis- Automatic scheduling of pods can cause capacitytrators, DevOps engineers, application developers, andissues, especially if you’re not monitoring resourceoperations teams had to perform many manual tasksavailability.in order to schedule, deploy, and manage their containerized applications. The rise of the Kubernetes con-In effect, while Kubernetes solves old problems, it cantainer orchestration platform has altered many of thesealso create new ones. Specifically, adopting containersresponsibilities.and container orchestration requires teams to rethinkKubernetes makes it easy to deploy and operate applications in a microservice architecture. It does so by creatingan abstraction layer on top of a group of hosts, so thatand adapt their monitoring strategies to account for thenew infrastructure layers introduced in a distributedKubernetes environment.development teams can deploy their applications and letWith that in mind, we designed this guide to highlight theKubernetes manage:fundamentals of what you need to know to effectively Controlling resource consumption by applicationor team Evenly spreading application load across a hostinfrastructure Automatically load balancing requests across thedifferent instances of an applicationmonitor Kubernetes deployments with New Relic. Thisguide outlines some best practices for monitoring Kubernetes in general, and provides detailed advice for how todo so with the New Relic platform.Whether you’re a cluster admin, an application developer,an infrastructure engineer, or DevOps practitioner working on the Kubernetes platform, by the end of this guide, Monitoring resource consumption and resource limitsyou should be able to use New Relic to monitor the healthto automatically stop applications from consuming tooand capacity of Kubernetes components and resources,many resources and restarting the applications againcorrelate events in Kubernetes with contextual insights to Moving an application instance from one host toanother if there is a shortage of resources in a host, orif the host dies Automatically leveraging additional resources madeavailable when a new host is added to the cluster Easily performing canary deployments and rollbackBut such capabilities also give teams new things to worryabout. For example: There are a lot more layers to monitor. The ephemeral and dynamic nature of Kubernetesmakes it a lot more complex to troubleshoot.03help you troubleshoot issues, understand how to monitor applications running in your cluster, and know how totrack end-user experience from those apps.

A Complete Introduction to Monitoring Kubernetes with New RelicMonitoring Kubernetes with New RelicIn addition to providing visibility into operational data—such as the number of resources used and namespacesper cluster and per pod—an important part of monitoring Kubernetes is having the ability to see the relationships between objects in a cluster using Kubernetes’built-in labeling system. Amazon Elastic Container Service for Kubernetes(Amazon EKS): Amazon EKS provides Kubernetes asa managed service on AWS. It helps make it easier todeploy, manage, and scale containerized applicationson Kubernetes.environment for deploying, managing, and scalingyour containerized applications using Google-suppliedinfrastructure. Microsoft Azure Kubernetes Service (AKS): AKSyourhostedKubernetesenvironment,making it easier to deploy and manage e. It also eliminates the burden of ading, and scaling resources on demand, withouttaking your applications offline. Red Hat OpenShift: OpenShift provides developerswith an integrated development environment (IDE) forbuilding and deploying Docker-formatted containers,and then managing them with Kubernetes. Pivotal Container Service (PKS): Available as part ofPivotal Cloud Foundry or as a standalone product, PKSprovides the infrastructure and resources to reliablydeploy and run containerized workloads across privateand public clouds.04you’ll need to activate the Kubernetes integration bydeploying the newrelic-infra agent onto your Kubernetescluster. The New Relic Kubernetes integration brings inand alert on the most important parts of your cluster.Use the integration’s out-of-the-box dashboard to inspecta single container, or scale up to see large, multi-clusterdeployments across different Kubernetes entities, including nodes, pods, namespaces, and containers.1. New Relic uses kube-state-metrics—a simple service Google Kubernetes Engine (GKE): GKE provides anapplicationsTo get started monitoring Kubernetes with New Relic,system-level metrics, allowing you to view, troubleshoot,New Relic integrates with Kubernetes in a number of ways:managesGetting startedthat listens to the Kubernetes API server and generatesmetrics—to gather information about the state ofKubernetes objects. Install kube-state-metrics inyour cluster:curl -o 7.2 &&unzip kube-state-metrics-1.7.2.zip && ocapply -f kube-state-metrics-release-1.7.2/kubernetes2. Download the Kubernetes integration config u r ation file:curl 8s-latest.yaml3. In the configuration file, add your New Relic license keyand a cluster name to identify your Kubernetes cluster.Both values are required. Be sure to update YOURLICENSE KEY with your license key and YOURCLUSTER NAME with the name of your cluster.

A Complete Introduction to Monitoring Kubernetes with New Relicenv:ments, nodes, pods, containers, and applications. With- name: NRIA LICENSE KEYthe cluster explorer, you will be able to easily retrieve thevalue: YOUR LICENSE KEY data and metadata of these elements, and understand- name: CLUSTER NAMEvalue: YOUR CLUSTER NAME 4. Add any additional configuration, as documented inthe Kubernetes integration instructions.5. To confirm that kube-state-metrics is installed, runhow they are related.From the Kubernetes cluster explorer, you can:1. Select the cluster you want to explore2. Filter by namespace or deploymentthis command:3. Select specific pods or nodes for status detailskubectl get pods --all-namespaces grepThe cluster explorer has two main parts:kube-state-metrics6. To create the DaemonSet, run this command:1. A visual display of the status of a cluster, up to 24 nodes.Within the visual display, the cluster explorer showskubectl create -f newrelic-infrastructurethe nodes that have the most issues in a series of four-k8s-latest.yamlconcentric rings:7. Confirm that the DaemonSet has been created The outer ring shows the nodes of the cluster, withsuccessfully by looking for newrelic-infra in the resultseach node displaying CPU, memory, and storagegenerated by this command:performance metrics.kubectl get daemonsets8. Go to one.newrelic.com, and select the Kubernetescluster explorer launcher. The next innermost ring displays the distributionand status of the non-alerting pods associated withthat node. The third innermost ring displays the pods on alertExploring clusters with theKubernetes cluster explorerand that may have health issues even if they arestill running. Finally, the innermost ring displays pods that arepending or that Kubernetes is unable to run.2. You can select any pod to see its details, such as itsnamespace, deployment, containers, alert status, CPUusage, memory usage, and more.3. The cluster explorer node table displays all the nodesof the selected cluster/namespace/deployment, andcan be sorted according to node name, node status,pod, pod status, container, CPU% vs. Limit and MEM%vs. Limit.New Relic’s Kubernetes cluster explorer provides amulti-dimensional representation of a Kubernetes clusterfrom which you can explore your namespaces, deploy-05

A Complete Introduction to Monitoring Kubernetes with New RelicBenefits of monitoring withthe cluster explorerThe cluster explorer expands the Kubernetes monitoring capabilities already built into the New Relic platform.Use the cluster explorer’s advanced capabilities to filter,sort, and search for Kubernetes entities, so you can betterunderstand the relationships and dependencies within anenvironment. The default data visualizations of your cluster provides a fast and intuitive path to getting answersand understanding their Kubernetes environments, soyou can contain the complexity associated with runningKubernetes at scale.When your team adopts cluster explorer, you can expectimproved performance and consistency and quickerresolutions when troubleshooting errors. New Relic canhelp ensure that your clusters are running as expectedand quickly detect performance issues within your cluster—even before they have a noticeable impact on yourcustomers.06

A Complete Introduction to Monitoring Kubernetes with New RelicKubernetes ObservabilityWe recommend that Kubernetes observability begins withthese five practices:1. Visualizing services2. Monitoring health and capacity3. Correlating Kubernetes events4. Understanding APM correlation5. Investigating end-user experienceVisualizing servicesSuggested alertingWhen deploying the New Relic Kubernetes integrationfor the first time in an account, a default set of alertconditions is deployed to the account. The alert policyis configured without a notification channel to avoidunwanted alerts.You can customize the alert conditions’ thresholds to yourenvironment and update the alert policy to send notifications. For more, see the New Relic Infrastructure alertsdocumentation.When working in a Kubernetes environment, it can be difficult to untangle the dependencies between applicationsand infrastructure, and navigate all of the entities—containers, pods, nodes, deployments, namespaces, and soon—that may be involved in a troubleshooting effort. Youneed to observe performance and dependencies acrossthe entire Kubernetes environment.You should be able to visualize key parts of your services,including: The structure of your application and its dependencies The interactions between various microservices, eventhose that are intermingled across your machine clusterMonitoring cluster health and capacityKubernetes environments vary from deployment todeployment, but they have all a handful of key components, resources, and potential errors in common. The following sections introduce best practices, including tips forhow to use New Relic and alerts, for monitoring the healthand capacity of any Kubernetes environment: Track cluster resource usage Monitor node resource consumption Monitor for missing pods Find pods that aren’t runningHow New Relic helps Troubleshoot container restartsThe cluster explorer provides a multi-dimensional rep- Track container resource usageresentation of a Kubernetes cluster that allows teams to Monitor storage volumesdrill down into Kubernetes data and metadata in a highfidelity, curated UI that simplifies complex environments.Teams can use cluster explorer to more quickly troubleshoot failures, bottlenecks, and other abnormal behavioracross their Kubernetes environments. Monitor the control plane: etcd, the API server, thescheduler, and the controller managerTrack cluster resource usageWhen you administer clusters, you need enough usableresources in your cluster to avoid running into issues whenscheduling pods or deploying containers. If you don’t have07

A Complete Introduction to Monitoring Kubernetes with New Relicenough capacity to meet the minimum resource requirements of all your containers, scale up your nodes’ capacityor add more nodes to distribute the workload.You should know: What percentage of cluster resources you’re using atany given time If your clusters are over- or under-provisionedHow New Relic helpsNew Relic tracks resource consumption (used cores andmemory) for each Kubernetes node. That lets you trackthe number of network requests sent across containerson different nodes within a distributed service. You canalso track resource metrics for all containers on a specificnode—regardless of which service they belong to. How much demand have you’ve placed on your systemsHow New Relic helpsOur Kubernetes integration monitors and tracks aggregated core and memory usage across all nodes in yourAlways ensure your current deployment has sufficientcluster. This allows you to meet resource requirements forresources to scale. You don’t want new node deploymentsoptimal application performance.blocked by a lack of resources.Suggested alertingSet alerts so you’ll be notified if hosts stop reporting orif a node’s CPU or memory usage drops below a desiredthreshold.Monitor for missing podsFrom time to time, you may find your cluster is missing aSuggested alertingpod. A pod can go missing if the engineers did not providesufficient resources when they scheduled it. The pod maySet alerts on the cores and memory usage of the hosts inhave never started; it’s in a restart loop; or it went missingyour cluster.because of an error in its configuration.Monitor node resource consumptionTo make sure Kubernetes does its job properly, you needto confirm the health and availability of pod deployments.Beyond simply keeping track of nodes in your cluster, youA pod deployment defines the number of instancesneed to monitor the CPU, memory, and disk usage forthat need to be present for each pod, including backupKubernetes nodes (workers and masters) to ensure allinstances. (In Kubernetes, this is referred to as a Replica-nodes in your cluster are healthy.Use this data to ensure: You have enough nodes in your cluster The resource allocations to existing nodes is sufficientfor deployed applications You’re not hitting any resource limits08Set). Sometimes the number of active pods is not specified in the Replicas field on each deployment. Even if theyare specified, Kubernetes may determine if it can runanother instance based on resources the administratorhas defined.forbidden: exceeded quota: compute-resources,requested: pods 1, used: pods 1, limited: pods 1

A Complete Introduction to Monitoring Kubernetes with New RelicHow New Relic helpsNew Relic makes it easier to avoid this issue by knowingthe resource limitations of the cluster.If you don’t have enough resources to schedule a pod,add more container instances to the cluster or exchangea container instance for one with the appropriate amountof resources. In general, you can use the New Relic Kubernetes integration to monitor for missing pods and immediately identify deployments that require attention. Thisoften creates an opportunity to resolve resource or configuration issues before they affect application availabilityor performance.When you see that pods aren’t running, you’ll wantto know: If there are any pods in a restart loop How often are requests failing If there are resource issues or configuration errorsHow New Relic helpsAs noted, if you have resource issues or configurationerrors, Kubernetes may not be able to schedule the pods.In such cases, you want to check the health of your deployments, and identify configuration errors or resource issues.With the New Relic Infrastructure Kubernetes integration,you can use default deployment data to discover and trackpods that may not be running and sort them by clusterand namespace.Additionally, you can analyze further root causes of terminated pods, with the terminated pods metric. For example,if a pod is terminated because its application memory hasSuggested alertingSet an alert for when a deployment’s missing pods valuerises above a certain threshold for a certain period. If thereached the memory limit set on the containers, it will bekilled by the out of memory (OOM) killer. In such cases,New Relic will expose the reason for pod termination.number of available pods for a deployment falls belowthe number of pods you specified when you created thedeployment, the alert will trigger. The alert will be appliedto each deployment that matches the filters you set.Find pods that aren’t runningKubernetes dynamically schedules pods into the cluster,but if you have resource issues or configuration errors,scheduling will likely fail. If a pod isn’t running or evenscheduled, that means there’s an issue with either the podor the cluster, or with your entire Kubernetes deployment.Suggested alertingSet alerts on the status of your pods. Alerts should trigger when a pod has a status of “Failed,” ”Pending,” or“Unknown” for the period of time you specify.09

A Complete Introduction to Monitoring Kubernetes with New RelicTroubleshoot container restartsWhen monitoring container resource usage, you’ll wantIn normal conditions, containers should not restart. Con-to know:tainer restarts are a sign that you’re likely hitting a mem- If your containers are hitting resource limits and af fectingory limit in your containers. Restarts can also indicate anissue with either the container itself or its host. Additionally, because of the way Kubernetes schedules containers, it can be difficult to troubleshoot container resourceissues since Kubernetes will restart—or kill—containerswhen they hit their limits.Monitoring container restarts helps you understand: If any containers are in a restart loop How many container restarts occurred in X amountof time Why containers are restartingHow New Relic helpsA running count of container restarts is part of the defaultcontainer data New Relic gathers with the Kubernetesintegration.Suggested alertingThis an optional alerting scenario. Kubernetes automatically restarts containers, and setting up an alert will giveyou an immediate, useful notification, but don’t let container restarts interrupt your sleep.Track container resource usageMonitoring container resource usage helps you ensurethat their containers and applications remain healthy. Forexample, if a container hits its limit for memory usage, thekubelet agent might kill it.10the performance of their applications If there are spikes in resource consumption If there is a pattern to the distribution of errors percontainerHow New Relic helpsFirst, identify the minimum amount of CPU and memorya container requires to run—which needs to be guaranteed by the cluster—and monitor those resources withNew Relic.Second, monitor container resource limits. These are themaximum amounts of resources that the container will beallowed to consume. In Kubernetes, resource limits areunbounded by default.

A Complete Introduction to Monitoring Kubernetes with New RelicThis type of monitoring can help proactively resolveWith Kubernetes volume monitoring in New Relic, youresource usage issues before they affect your application.can monitor your volumes, and set alerts on them so thatSuggested alertingSet alerts on container CPU and memory usage and onyou get informed as soon as a volume reaches a certainthreshold—a proactive approach to limiting issues withapplication performance or availability.limits for those metrics.Monitor storage volumesOne thing you definitely want to avoid when running a

Kubernetes makes it easy to deploy and operate applica-tions in a microservice architecture. It does so by creating an abstraction layer on top of a group of hosts, so that development teams can deploy their applications and let Kubernetes manage: Controlling resource consumption by application

Related Documents:

telemetry 1.24 Service P threshold_migrator 2.11 Monitoring P tomcat 1.30 Monitoring P trellis 20.30 Service P udm_manager 20.30 Service P url_response 4.52 Monitoring P usage_metering 9.28 Monitoring vCloud 2.04 Monitoring P vmax 1.44 Monitoring P vmware 7.15 Monitoring P vnxe_monitor 1.03 Monitoring vplex 1.01 Monitoring P wasp 20.30 UMP P .

work/products (Beading, Candles, Carving, Food Products, Soap, Weaving, etc.) ⃝I understand that if my work contains Indigenous visual representation that it is a reflection of the Indigenous culture of my native region. ⃝To the best of my knowledge, my work/products fall within Craft Council standards and expectations with respect to

What is Media Monitoring and How Do You Use it Monitoring: a history of tracking media What is monitoring? Getting started with monitoring The Benefits and Uses of Monitoring Using media monitoring to combat information overload Tools to maximize monitoring and measurement efforts Using media monitoring to develop media lists

2.2 Monitoring surveys 7 3 Monitoring habitat 8 3.1 Food supply - direct measurement 9 3.2 Food supply - indirect measurements 9 4 Monitoring protocol summary 10 4.1 Monitoring otters 10 4.2 Monitoring habitat 11 SECTION 2:REVIEW OF ASSESSMENT TECHNIQUES AND PROTOCOL RATIONALE 13 1 Introduction 13 1.1 Monitoring otter populations 13

2012 Honda Civic CNG Complete 3/5 Tests Complete 45% Complete 4 195,000 2013 Volkswagen Jetta TDI Complete NA 53% Complete 4 195,000 2014 Chevrolet Cruze Turbo Diesel Complete NA 15% Complete 4 195,000 2014 Mazda 3 (ultracapacitor) Complete 1/5 Tests Complete 18% Complete 4 195,000 2015 Chevy

SIRIUS monitoring relays: Perfect protection of machines and systems Monitoring relays 3UG451 / 461 / 463 monitoring relays for line and single-phase voltage monitoring – as 3UG481 / 483 also for IO-Link 10 6* 3RR21/22 monitoring relays for direct mounting on contactors for multi-phase current monitoring – as 3RR24 also for IO-Link 12 7 .

akuntansi musyarakah (sak no 106) Ayat tentang Musyarakah (Q.S. 39; 29) لًََّز ãَ åِاَ óِ îَخظَْ ó Þَْ ë Þٍجُزَِ ß ا äًَّ àَط لًَّجُرَ íَ åَ îظُِ Ûاَش

Collectively make tawbah to Allāh S so that you may acquire falāḥ [of this world and the Hereafter]. (24:31) The one who repents also becomes the beloved of Allāh S, Âَْ Èِﺑاﻮَّﺘﻟاَّﺐُّ ßُِ çﻪَّٰﻠﻟانَّاِ Verily, Allāh S loves those who are most repenting. (2:22