A Beginner's Guide To Kubernetes Monitoring

1y ago
5 Views
2 Downloads
1.91 MB
11 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Jewel Payne
Transcription

A BEGINNER’SGUIDE TOKUBERNETESMONITORING

A BEGINNER’S GUIDETO KUBERNETESMONITORINGSince the introduction of the concept in 2013, containershave become the buzz of the IT world. It’s easy to see why:Application container technology is revolutionizing appdevelopment, bringing previously unimagined flexibility andefficiency to the development process.Businesses are embracing containers in droves. According toGartner, more than half of global enterprises will be runningcontainerized applications in production by 2020, up from lessthan 20 percent today. And IDC predicts by 2021, more than 95percent of new microservices will be deployed in containers. Thatmass adoption makes it clear that organizations need to adopt acontainer-based development approach to stay competitive.To that end, let’s look at what’s involved with containerizationand how your organization can leverage it to gain an edge.2A BEGINNER’S GUIDE TO KUBERNETES MONITORING3

WHAT IS ACONTAINER?The easiest way to understand the concept of a container is toconsider its namesake. A physical container is a receptacle usedto hold and transport goods from one location to another.A software container performs a similar function. It allows youto package up an application’s code, configuration files, libraries,system tools, and everything else needed to execute that appinto a self-contained unit so you can move and run it anywhere.Further, containers enable a “microservices” approach thatbreaks applications down into single-function modules that areaccessed only when they’re needed. This allows a developer tomodify and redeploy a particular service rather than the wholeapplication whenever changes are required.4 A BEGINNER’S GUIDE TO KUBERNETES MONITORINGA BEGINNER’S GUIDE TO KUBERNETES MONITORING5

WHY ARECONTAINERSSUCH A BIG DEAL?required to run them, including libraries and system binaries,are contained in the guest machine. Each guest machine alsoincludes a complete operating system of its own. So a serverrunning four VMs, for example, would have four operatingsystems in addition to the hypervisor coordinating them all.That’s a lot of demand on a one machine’s resources, and thingscan bog down in a hurry, ultimately limiting how many VMs asingle server can operate.Containers remedy an all-too-common problem in IT Operations:getting software to run reliably and uniformly no matterwhere it is deployed. As an app is moved from one computingenvironment to another — from staging to production, forexample — it can run into problems if the operating system,network topology, security policies or other aspects of theenvironment are different. Containers isolate the app from itsenvironment, abstracting away these environmental differences.Prior to containers, virtual machines (VMs) were the primaryContainers, on the other hand, abstract at the operating systemlevel. A single host operating system runs on the host (this canbe a physical server, VM, or cloud host), and the containers —using a containerization engine like the Docker Engine — sharethat OS’s kernel with other containers, each with its own isolateduser space. There’s much less overhead here than with a virtualmachine, and as a result, containers are far more lightweight andresource efficient than VMs, allowing for much greater utilizationof server resources.method for running many isolated applications on a singleserver. Like containers, VMs abstract away a machine’sunderlying infrastructure so that hardware and softwarechanges won’t affect app performance. But there are significantdifferences to how each does this.A VM abstracts hardware to turn a physical server into severalvirtual ones. It does so by running on top of a hypervisor, whichitself runs on a physical computer called the “host machine.” Thehypervisor is essentially a coordination system that emulatesthe host machine’s resources —CPU, RAM, etc.— making themavailable to the VM or “guest machine.” The apps and everything6 A BEGINNER’S GUIDE TO KUBERNETES MONITORINGA BEGINNER’S GUIDE TO KUBERNETES MONITORING7

5 BENEFITSOF DEPLOYINGCONTAINERSA container-based infrastructure offers a host of benefits. Hereare the five biggest.1. Speed of delivery—Applications installed on a virtual machinetypically take several minutes to launch. Containers don’t haveto wait for an operating system boot, so they start up in afraction of a second. They also run faster since they use fewerhost OS resources, and they only take a few seconds to create,clone or destroy. All of this has a dramatic impact on the4. Increased scalability—Containers tend to be small becausethey don’t require a separate OS the way that VMs do. Onecontainer is typically sized on the order of tens of megabytes,whereas a single VM can be tens of gigabytes — roughly1,000 times the size of a container. That efficiency allowsyou to run many more containers on a single host operatingsystem, increasing scalability.5. Consistency—Because containers retain all dependenciesdevelopment process, allowing organizations to more quicklyand configurations internally, they ensure developers are ableget software to market, fix bugs and add new features.to work in a consistent environment regardless of where the2. DevOps first—Containers’ speed, small footprint, andresource efficiency make them ideal for a DevOpsenvironment. A container-based infrastructure enablesdevelopers to work as quickly and efficiently as possible ontheir preferred platform without having to waste time on non-containers are deployed. That means developers won’t haveto waste time troubleshooting environmental differencesand can focus on addressing new app functionality. It alsomeans you can take the same container from development toproduction when it’s time to go live.business-critical tasks.3. Accessibility—As mentioned earlier, containers pack uponly the app and its dependencies. That makes it easy tomove and reliably run containers on Windows, Linux or Machardware. Containers can run on bare metal or on virtualservers, and within public or private clouds. This also helpsavoid vendor lock-in should you need to move your appsfrom one public cloud environment to another.8 A BEGINNER’S GUIDE TO KUBERNETES MONITORINGA BEGINNER’S GUIDE TO KUBERNETES MONITORING9

KUBERNETES ANDCONTAINERS 101To get started with container orchestration, you need specializedsoftware to deploy, manage and scale containerized applications.One of the earliest and most popular choices today is Kubernetes,an open-source automation platform developed by Google andnow managed by the Cloud Native Computing Foundation.Pods: A pod represents a collection of containers packagedtogether and deployed to a node. All containers within a podKubernetes can dramatically enhance the development processshare a local network and other resources. They can talk to eachby simplifying container management, automating updates, andother as if they were on the same machine, but they remainminimizing downtime so developers can focus on improving andisolated from one another. At the same time, pods isolateadding new features to applications. To better understand how, let’snetwork and storage away from the underlying container.look at Kubernetes’ basic components and how they work together.A single worker node can contain multiple pods. If a nodeKubernetes uses multiple layers of abstraction defined withingoes down, Kubernetes can deploy a replacement pod to aits own unique language. There are many parts to Kubernetes.functioning node.This list isn’t exhaustive, but it provides a simplified look at howhardware and software is represented in the system.Despite a pod being able to hold many containers, it’srecommended they wrap up only as many as needed: a mainNodes: In Kubernetes lingo, any single “worker machine” is a node. Itprocess and its helper containers, which are called “sidecars.”can be a physical server or virtual machine on a cloud provider suchPods scale as a unit no matter what their individual needs areas AWS or Microsoft Azure. Nodes were originally called “minions,”and overstuffed pods can be a drain on resources.which gives you an idea of their purpose. They receive and performtasks assigned from the Master Node and contain all the servicesrequired to manage and assign resources to containers.Deployments: Instead of directly deploying pods to a cluster,Kubernetes uses an additional abstraction layer called a“deployment.” A deployment enables you to designate how manyMaster Node: This is the machine that orchestrates all thereplicas of a pod you want running simultaneously. Once it deploysworker nodes and is your point of interaction with Kubernetes.that number of pods to a cluster, it will continue to monitor themAll assigned tasks originate here.and automatically recreate and redeploy a pod if it fails.Cluster: A cluster represents a master node and several workerIngress: Kubernetes isolates pods from the outside world, so younodes. Clusters consolidate all of these machines into a single,need to open a communication channel to any service you wantpowerful unit. Containerized applications are deployed to ato expose. This is another abstraction layer called Ingress. Therecluster, and the cluster distributes the workload to variousare a few ways to add ingress to a cluster, including adding anodes, shifting work around as nodes are added or removed.LoadBalancer, NodePort or Ingress controller.10 A BEGINNER’S GUIDE TO KUBERNETES MONITORINGA BEGINNER’S GUIDE TO KUBERNETES MONITORING11

WHAT DOES A TYPICALKUBERNETESDEPLOYMENTLOOK LIKE?Being familiar with the fundamental components of Kubernetesshould give you some idea of how the system approachescontainer orchestration, but a deeper understanding requiresvisualizing each of these components in action. Here we willlook at how to use Kubernetes to deploy an app to a clusteron Google Cloud using an example put together by GoogleEngineer Daniel Sanche.Sanche’s tutorial uses Gitea, an open-source git hostingservice, as the deployed app, but as he notes this walkthroughcould be employed using virtually any app.Create a clusterTwo commands are critical when setting up a Kubernetesenvironment: kubectl and gcloud. kubectl is the primary tool forinteracting with the Kubernetes API and is used to create andmanage software resources such as pods and deployments.However, because Kubernetes is platform-agnostic, the kubectlcommand can’t provision nodes directly from your chosencloud provider, so a third-party tool is needed. If Google Cloudis your provider, for example, you could use Google KubernetesEngine’s gcloud command to provision your nodes.Once you’ve set up your Kubernetes environment, thesecommands are used to create a default cluster of three nodes:gcloud container clusters create my-cluster --zone uswest1-agcloud container clusters get-credentials my-cluster \--zone us-west1-aYour cluster will now be visible within the GKE section of theGoogle Cloud Console. The VMs you’ve provisioned as yournodes will appear in the GCE section.12A BEGINNER’S GUIDE TO KUBERNETES MONITORINGA BEGINNER’S GUIDE TO KUBERNETES MONITORING13

Deploy an appNow you can start assigning resources to your live cluster.Though you can do this interactively with the kubectl addcommand, Sanche recommends doing it by writing all of yourKubernetes resources in YAML files. This allows you to recordthe entire state of your cluster in easily maintainable files withall the instructions required to host your service saved alongsidethe actual code, which makes for simpler management.To add a pod to your cluster using a YAML file, create a filecalled gitea.yaml with the following contents:apiVersion: v1kind: Podmetadata:name: gitea-podspec:containers:- name: gitea-containerimage: gitea/gitea:1.4Kubernetes will read the file and add the pod to the cluster.You can see the new pod by running the kubectl get podscommand. This will return data about the status of the pod,whether it has restarted, and how long it has been running.You can also view the container’s standard output by runningthe command kubectl logs -f gitea-pod, which will returnsomething like this:Generating /data/ssh/ssh host ed25519 key.Feb 13 21:22:00 syslogd started: BusyBox v1.27.2Generating /data/ssh/ssh host rsa key.Generating /data/ssh/ssh host dsa key.Generating /data/ssh/ssh host ecdsa key./etc/ssh/sshd config line 32: Deprecated optionUsePrivilegeSeparationFeb 13 21:22:01 sshd[12]: Server listening on :: port 22.Feb 13 21:22:01 sshd[12]: Server listening on 0.0.0.0 port 22.2018/02/13 21:22:01 [T] AppPath: /app/gitea/gitea2018/02/13 21:22:01 [T] AppWorkPath: /app/gitea2018/02/13 21:22:01 [T] Custom path: /data/giteaThis code declares that you’re creating a pod — named “gitea-2018/02/13 21:22:01 [T] Log path: /data/gitea/logpod” — defined in v1 of the Kubernetes API. It contains one2018/02/13 21:22:01 [I] Gitea v1.4.0 rc1-1-gf61ef28 builtcontainer called “gitea-container.” The final line defines whichwith: bindata, sqlitecontainer image you want to run. Here the image is the one2018/02/13 21:22:01 [I] Log Mode: Console(Info)tagged as 1.4 in the gitea/gitea repository. Kubernetes tells the2018/02/13 21:22:01 [I] XORM Log Mode: Console(Info)built-in container runtime to locate this container image and2018/02/13 21:22:01 [I] Cache Service Enabledadd it to the pod.2018/02/13 21:22:01 [I] Session Service EnabledNext, apply the YAML file to the cluster by executing thiscommand: kubectl apply -f gitea.yaml.2018/02/13 21:22:01 [I] SQLite3 Supported2018/02/13 21:22:01 [I] Run Mode: Development2018/02/13 21:22:01 Serving [::]:3000 with pid 142018/02/13 21:22:01 [I] Listen: http://0.0.0.0:300014A BEGINNER’S GUIDE TO KUBERNETES MONITORINGA BEGINNER’S GUIDE TO KUBERNETES MONITORING15

DeploymentAs discussed earlier, it’s not typical to deploy pods directly inKubernetes but rather to use the Deployment abstraction layerinstead. To do this, you’ll need to take a step back and deletethe pod previously created with the kubectl delete -f gitea.yamlcommand so you can recreate it through the Deployment layer.Next, go back to the YAML file you originally created and alteras shown below:apiVersion: extensions/v1beta1kind: Deploymentmetadata:name: gitea-deploymentspec:replicas: 1selector:matchLabels:app: giteatemplate:The first nine lines of this code define the deployment itself andthe rest define the template of the pod the deployment willmanage. Line 6 (replicas) is the most critical information, as ittells Kubernetes how many pods you want to run.Now you can apply the modified YAML file with the commandkubectl apply -f gitea.yaml.Type kubectl get pods again to see the running pod(s). To verifythe deployment information, enter kubectl get deployments.One of the advantages of Kubernetes deployments is that if apod goes down or is deleted, it will automatically be redeployed.To see that in action, delete the pod you just deployed by typingkubectl delete pod podname and you should see a new oneadded to your cluster.For more information on deploying an app, adding ingress soyou can access it through a browser, and more, take a look atSanche’s complete tutorial.metadata:labels:app: giteaspec:containers:name: gitea-containerimage: gitea/gitea:1.416A BEGINNER’S GUIDE TO KUBERNETES MONITORINGA BEGINNER’S GUIDE TO KUBERNETES MONITORING17

HOW DO YOUMONITOR KUBERNETESEFFECTIVELY?For all the benefits that containers bring to IT organizations,A good container monitoring solution will enable you to stay onthey can also make cloud-based application management moretop of your dynamic container-based environment by unifyingcomplex. Some of the challenges they present include:container data with other infrastructure data to provide better Significant Blind Spots—Containers are designed to bedisposable. Because of this, they introduce several layersof abstraction between the application and the underlyingcontextualization and root cause analysis. Let’s look at how onecould provide several layers of monitoring for Docker, the mostpopular container implementation:hardware to ensure portability and scalability. This allHosts: The physical and virtual machines in your clusters cancontributes to a significant blind spot when it comes tobe monitored for availability and performance. Key metrics toconventional monitoring.track include memory, CPU usage, swap space used and storage Increased Need to Record—The easy portability of so manyinterdependent components creates an increased need toutilization. This should be a core capability of any containermonitoring tool.maintain telemetry data to ensure observability into theContainers: Visibility into your containers in aggregate andperformance and reliability of the application, container andindividually is critical. A monitoring tool can provide informationorchestration platform.on the number of currently running containers, the containers The Importance of Visualizations—The scale and complexityintroduced by containers and container orchestrationrequires the ability to both visualize the environment to gainusing the most memory and the most recently started container.It can also provide insight into each container CPU and memoryutilization and the health of its network I/O.immediate insight into your infrastructure health but alsoApplication endpoints: In a typical container-basedbe able to zoom in and view the health and performance ofenvironment, each application service will be running on onecontainers, node and pods. The right monitoring solutionor more containers. Ideally, application monitoring should beshould provide this workflow.performed at the level of the container, pod and whole system. Don’t Leave DevOps in the Dark—Containers can be scaled andmodified with lightning speed. This accelerated deploymentpace makes it more challenging for DevOps teams to track howapplication performance is impacted across deployments.18A BEGINNER’S GUIDE TO KUBERNETES MONITORINGA BEGINNER’S GUIDE TO KUBERNETES MONITORING19

GETTING STARTED.Containers are a powerful tool in your developmentarsenal, but it’s critical to understand how and how wellyour container environments are working. For moreinformation, visit us online to see how we can help you getstarted with containers, orchestration and monitoring. 2019 Splunk Inc. All rights reserved. Splunk, Splunk , Listen to Your Data, The Engine for Machine Data,Splunk Cloud, SplunkLight and SPL are trademarks and registered trademarks of Splunk Inc. in the United States and other Monitoring-101

A BEGINNER'S GUIDE TO KUBERNETES MONITORING A BEGINNER'S GUIDE TO KUBERNETES MONITORING. 4 5 The easiest way to understand the concept of a container is to . includes a complete operating system of its own. So a server running four VMs, for example, would have four operating

Related Documents:

2 FIVB Sports Development Department Beach Volleyball Drill-book TABLE OF CONTENTS 22 WARM-UP DRILLS LEVEL PAGES DRILL 1.1 VOLESTE (beginner) 10 DRILL 1.2 SINGLE TWO BALL JUGGLE (beginner) 11 DRILL 1.3 TWO BALL JUGGLE IN PAIRS (beginner) 12 DRILL 1.4 THROW PASS AND CATCH (beginner) 13 DRILL 1.5 SKYBALL AND CATCH (beginner) 14 DRILL 1.6 SERVE AND JOG (beginner) 15

Group Piano Course Late Beginner (ages 8 10) Alfred’s Basic Late Beginner (ages 10 11) Chord Approach Adult Piano Course OR All-In-One Adult Piano Course Young Beginner (ages 5 7) Prep Course Beginner (ages 7 9) Alfred’s Basic For the youngest beginner, ages 4–6 Music for Little Mozarts, Books 1–4 lead into Prep Level C. 2

GraceLink Sabbath School Curriculum USA NON-USA Periodical Code Single Copy Single 1 Yr Single 1 Yr Beginner Beginner Student EBQ 10.99 26.48 33.48 Beginner Leader/Teacher EBT 24.59 60.00 67.00 Beginner Memory Verse EBM

Hunter SEAFORD: JJ Boys & Girls 7 - 8 Beginner 51 - 60lb - A: 5 1: Arredondo Hunter: SEAFORD KB: Boys & Girls 7 - 8 Beginner 51 - 60lb - B 13: 4 Arredondo: Mason SEAFORD: JJ Boys 9 - 10 Beginner 61 - 70lb: 15 3: Arredondo Mason: SEAFORD KB: Boys 9 - 10 Beginner 61 - 70lb 5: 6 Ashirmamatov: Shahriyor MIDWOOD: JJ Boys 9 - 10 Intermediate 60lb .

White Christmas Beginner Piano Level 1 Sheet Music Download white christmas beginner piano level 1 sheet music pdf now available in our library. We give you 2 pages partial preview of white christmas beginner piano level 1 sheet music that you can try for free. This music notes has been

Present the characteristics of mentoring and coaching for beginner teachers. b. Describe the needs for training in coaching skills for beginner teacher men-tors based on the Kansas Coaching Model (2007) by Jim Knight and Adult Learning Principles (1994) by Malcolm Knowles. c. Describe the training areas that beginner teacher mentors need in .

Independent Personal Pronouns Personal Pronouns in Hebrew Person, Gender, Number Singular Person, Gender, Number Plural 3ms (he, it) א ִוה 3mp (they) Sֵה ,הַָּ֫ ֵה 3fs (she, it) א O ה 3fp (they) Uֵה , הַָּ֫ ֵה 2ms (you) הָּ תַא2mp (you all) Sֶּ תַא 2fs (you) ְ תַא 2fp (you

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