A Beginners Guide To Kubernetes Monitoring
A Beginners Guide To Kubernetes Monitoring
GUIDE TO
KUBERNETES
MONITORING
A BEGINNER’S GUIDE
TO KUBERNETES
MONITORING
SUCH A BIG DEAL? systems in addition to the hypervisor coordinating them all.
That’s a lot of demand on a one machine’s resources, and things
can bog down in a hurry, ultimately limiting how many VMs a
single server can operate.
Containers remedy an all-too-common problem in IT Operations: Containers, on the other hand, abstract at the operating system
getting software to run reliably and uniformly no matter level. A single host operating system runs on the host (this can
where it is deployed. As an app is moved from one computing be a physical server, VM, or cloud host), and the containers —
environment to another — from staging to production, for using a containerization engine like the Docker Engine — share
example — it can run into problems if the operating system, that OS’s kernel with other containers, each with its own isolated
network topology, security policies or other aspects of the user space. There’s much less overhead here than with a virtual
environment are different. Containers isolate the app from its machine, and as a result, containers are far more lightweight and
environment, abstracting away these environmental differences. resource efficient than VMs, allowing for much greater utilization
of server resources.
Prior to containers, virtual machines (VMs) were the primary
method for running many isolated applications on a single
server. Like containers, VMs abstract away a machine’s
underlying infrastructure so that hardware and software
changes won’t affect app performance. But there are significant
differences to how each does this.
A container-based infrastructure offers a host of benefits. Here 4. Increased scalability—Containers tend to be small because
are the five biggest. they don’t require a separate OS the way that VMs do. One
container is typically sized on the order of tens of megabytes,
1. Speed of delivery—Applications installed on a virtual machine
whereas a single VM can be tens of gigabytes — roughly
typically take several minutes to launch. Containers don’t have
1,000 times the size of a container. That efficiency allows
to wait for an operating system boot, so they start up in a
you to run many more containers on a single host operating
fraction of a second. They also run faster since they use fewer
system, increasing scalability.
host OS resources, and they only take a few seconds to create,
clone or destroy. All of this has a dramatic impact on the 5. Consistency—Because containers retain all dependencies
development process, allowing organizations to more quickly and configurations internally, they ensure developers are able
get software to market, fix bugs and add new features. to work in a consistent environment regardless of where the
containers are deployed. That means developers won’t have
2. DevOps first—Containers’ speed, small footprint, and
to waste time troubleshooting environmental differences
resource efficiency make them ideal for a DevOps
and can focus on addressing new app functionality. It also
environment. A container-based infrastructure enables
means you can take the same container from development to
developers to work as quickly and efficiently as possible on
production when it’s time to go live.
their preferred platform without having to waste time on non-
business-critical tasks.
Cluster: A cluster represents a master node and several worker Ingress: Kubernetes isolates pods from the outside world, so you
nodes. Clusters consolidate all of these machines into a single, need to open a communication channel to any service you want
powerful unit. Containerized applications are deployed to a to expose. This is another abstraction layer called Ingress. There
cluster, and the cluster distributes the workload to various are a few ways to add ingress to a cluster, including adding a
nodes, shifting work around as nodes are added or removed. LoadBalancer, NodePort or Ingress controller.
Your cluster will now be visible within the GKE section of the
Google Cloud Console. The VMs you’ve provisioned as your
nodes will appear in the GCE section.
Next, go back to the YAML file you originally created and alter Type kubectl get pods again to see the running pod(s). To verify
as shown below: the deployment information, enter kubectl get deployments.
apiVersion: extensions/v1beta1
One of the advantages of Kubernetes deployments is that if a
kind: Deployment
pod goes down or is deleted, it will automatically be redeployed.
metadata:
To see that in action, delete the pod you just deployed by typing
name: gitea-deployment
kubectl delete pod <podname> and you should see a new one
spec:
added to your cluster.
replicas: 1
selector: For more information on deploying an app, adding ingress so
matchLabels: you can access it through a browser, and more, take a look at
app: gitea Sanche’s complete tutorial.
template:
metadata:
labels:
app: gitea
spec:
containers:
name: gitea-container
image: gitea/gitea:1.4
© 2019 Splunk Inc. All rights reserved. Splunk, Splunk>, Listen to Your Data, The Engine for Machine Data,Splunk Cloud, Splunk
Light and SPL are trademarks and registered trademarks of Splunk Inc. in the United States and other countries.
EB-Splunk-Beginners-Guide-to-Kubernetes-Monitoring-101