0% found this document useful (0 votes)
18 views

Kubernetes

Kubernetes commands

Uploaded by

gashok13193
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Kubernetes

Kubernetes commands

Uploaded by

gashok13193
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Kubernetes architecture:

------------------------
There are two primary components of Kubernetes Architecture: the master node and
the worker node
Kube-apiserver --- The API server is the front end for the Kubernetes control
plane.
etcd --- key value store
kubescheduler -- Control plane component that watches for newly created Pods with
no assigned node, and selects a node for them to run on.
kube controller manager -- Logically, each controller is a separate process, but to
reduce complexity,
they are all compiled into a single binary and run in a
single process
Node controller, Job controller, replicaset controller

Kubelet -- An agent that runs on each node in the cluster. It makes sure that
containers are running in a Pod.
kube-proxy - kube-proxy is a network proxy that runs on each node in your cluster,
implementing part of the Kubernetes Service concept.
Container runtime -- The container runtime is the software that is responsible for
running containers.

What is Kubernetes?
--------------------

Kubernetes is an open-source container orchestration tool or system that is used to


automate tasks
such as the management, monitoring, scaling, and deployment of containerized
applications.

What is orchestration
----------------------
Orchestration refers to the integration of multiple services that allows them to
automate processes or synchronize information
in a timely fashion. Say, for example, you have six or seven microservices for an
application to run.
If you place them in separate containers, this would inevitably create obstacles
for communication. Orchestration would help in
such a situation by enabling all services in individual containers to work
seamlessly to accomplish a single goal.

How are Kubernetes and Docker related?


----------------------------------------

Docker is an open-source platform used to handle software development. Its main


benefit is that it packages the settings
and dependencies that the software/application needs to run into a container, which
allows for portability and several other advantages.
Kubernetes allows for the manual linking and orchestration of several containers,
running on multiple hosts that have been created
using Docker.

What is ‘Heapster’ in Kubernetes


---------------------------------
A Heapster is a performance monitoring and metrics collection system for data
collected by the Kublet. This aggregator is natively
supported and runs like any other pod within a Kubernetes cluster, which allows it
to discover and query usage data from all nodes
within the cluster.
Types of services in Kubernetes
--------------------------------

Cluster IP service
Node Port service -- It opens a specific port on all Nodes and forwards any traffic
sent to this port to the service.
External Name Creation service and
Load Balancer service - The LoadBalancer service is used to expose services to the
internet.
A Network load balancer, for example, creates a single IP
address that forwards all traffic to your service.

Ingress network
---------------------

This is an API object that provides the routing rules to manage the external users
access to the services in the Kubernetes cluster
through HTTPS/ HTTP. With this, users can easily set up the rules for routing
traffic without creating a bunch of load balancers
or exposing each service to the nodes.

headless service
-----------------

A headless service is used to interface with service discovery mechanisms without


being tied to a ClusterIP,
therefore allowing you to directly reach pods without having to access them through
a proxy. It is useful when neither
load balancing nor a single Service IP is required.

Istio Service mesh


-------------------
A service mesh is a dedicated infrastructure layer that you can add to your
applications. It allows you to
transparently add capabilities like observability, traffic management, and
security, without adding them to your own code.

Istio is an open source service mesh that layers transparently onto existing
distributed applications.
Istio has two components: the data plane and the control plane.
-------------------------

The data plane is the communication between services. Without a service mesh, the
network doesn’t
understand the traffic being sent over, and can’t make any decisions based on what
type of traffic it is, or who it is from or to.

The control plane takes your desired configuration, and its view of the services,
and dynamically
programs the proxy servers, updating them as the rules or the environment changes.

An Envoy proxy is deployed along with each service that you start in your cluster,
or runs alongside services running on VMs.

--------------------
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80

--------------------------

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /testpath
backend:
serviceName: test
servicePort: 80

--------------------------

Docker K8

ENTRYPOINT ["SLEEP"] command: ["sleep"]

CMD ["5"] args: ["10"]

========================
Imperative:
----------

kubectl create configmap <config_name> --from-literal=<key> = <value>

apiVersion: v1
kind: Service
metadata:
labels:
app: frontend
name: frontend-svc
spec:
ports:
- port: 3000
protocol: TCP
targetPort: 3000
selector:
app: frontend
type: ClusterIP

Admission controller -- Kyvermo


- mutate
- validate

You might also like