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

E13- SCONE on Kubernetes (2)

The document discusses the architecture and advantages of using Kubernetes (K8s) for building and managing applications, particularly focusing on microservices. It highlights the benefits of velocity, scaling, abstraction of infrastructure, and efficiency in deploying applications within a Kubernetes cluster. Additionally, it touches on the components of K8s, such as master and worker nodes, and provides commands for deploying and managing Kubernetes clusters.

Uploaded by

rohulsibi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

E13- SCONE on Kubernetes (2)

The document discusses the architecture and advantages of using Kubernetes (K8s) for building and managing applications, particularly focusing on microservices. It highlights the benefits of velocity, scaling, abstraction of infrastructure, and efficiency in deploying applications within a Kubernetes cluster. Additionally, it touches on the components of K8s, such as master and worker nodes, and provides commands for deploying and managing Kubernetes clusters.

Uploaded by

rohulsibi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

SCONE on Kubernetes

ADr K.P.N Jayasena


Recap

Virtual Environment Virtual Machines Containers

Pros: lightweight
Pros: remove complexity Pros: isolate OS guest from host
Cons: issues with security,
Cons: does not isolate from OS Cons: intensive use hardware
scalability, and control

microservices

containe
r
How to
Monolithic
manage
microservices?
How do we build it with K8s?
Components & Architecture
Maggie Is going to
develop a cool <Worker Node
application . She 1> <docker>
decided to use K8s
to build the Online
Store (?) Application
<Worker Node
2> <docker>
CLI
<kubectl>
<Master
Node>

<Worker Node
Maggie 3> <docker>
K8s Components & Architecture <cont>
<Master Node>

The master node has:

• API server contains various


methods to directly access the
CLI
API server Kubernetes
<kube-
<kubectl>
apiserver>
• etcd works as backend for service
discovery that stores the cluster’s
Maggie state and its configuration
etcd
K8s Components & Architecture <cont>
<Master Node>

controller
scheduler • Scheduler assigns to each worker
manager node an application

• Controller manager:
CLI
API server • Keeps track of worker nodes
<kube- • Handles node failures and
<kubectl>
apiserver>
replicates if needed
• Provide endpoints to access the
Maggie application from the outside
etcd
world
K8s Components & Architecture <cont>
<Master Node>

cloud- cloud
controller provider
manager API

controller
scheduler
manager • Cloud controller communicates
with cloud provide regarding
resources such as nodes and IP
CLI
API server addresses
<kube-
<kubectl>
apiserver>

Maggie
etcd
K8s Components & Architecture <cont>
<Master Node>

cloud- cloud
controller provider
manager API

<Worker Node x>


controller
scheduler
manager
<docker>

API server pod pod


CLI container
1 container
2
<kube- 1 1
<kubectl> container container
apiserver> 2 2
kubelet container container
n n

Maggie
etcd The worker node consists of:

• Kubelet talks to the API server and


manages containers on its node
K8s Components & Architecture <cont>
<Master Node>

cloud- cloud
controller provider
manager API

<Worker Node x>


controller
scheduler
manager
<docker>
kube-
API server proxy pod pod
CLI container
1 container
2
<kube- 1 1
<kubectl> container container
apiserver> 2 2
kubelet container container
n n

Maggie
etcd
• Kube-proxy load-balances network
traffic between application
components and the outside world
Advantages of using Kubernetes

There are many reasons why people come to use


containers and container APIs like Kubernetes:

1. Velocity
2. Scaling (of both software and teams) k8s
3. Abstracting the infrastructure API
<kube-
4. Efficiency service>

All these aspects relate to each other to


speed up process that can reliably deploy
User
software.
Advantages of using Kubernetes: Velocity
It is the speed with which you can respond to innovations
developed by others (e.g. change in software industry from
shipping CDs to delivering over the network)

Velocity is measured not in terms of the number of things you can


ship while maintaining a highly available service
ML
Application
K8s
K8s <nodes>
API VM
VM VM
<kubectl> <database
<model1> <frontend>
>

VM
<model2
Maggie
>
Velocity <cont>
Velocity is enabled by:

• Immutable system: you can't change running container, but


you create a new one and replace it in case of failure (allows for
keeping track of the history and load older images)
K8s
<nodes>
VM
VM VM
<model_v2.0
<database> <frontend>
>

VM
<model_v1.0
>
Velocity <cont>
Velocity is enabled by:

• Declarative configuration: you can define the desired state of


the system restating the previous declarative state to go back.
Imperative configuration are defined by the execution of a series
of instructions, but not the other way around.

K8s
<nodes>
YAML
<app.yaml> VM
VM VM VM
2 database <model_v1.0
<database> <database> <frontend>
1 model >
1 frontend
Velocity <cont>
Velocity is enabled by:

• Online self-healing systems: k8s takes actions to ensure that


the current state matches the desired state (as opposed to an
operator enacting the repair)
K8s
<nodes>
YAML
<app.yaml> VM
VM VM VM
2 database <model_v2.0
<database> <database> <frontend>
1 model >
1 frontend

VM
< database
>
Advantages of using Kubernetes: Scaling

As your product grows, it’s inevitable that you will need to


scale:

• Software
• Team/s that develop it
Scaling
Kubernetes provides numerous advantages to address scaling:

• Decoupled architectures: each component is separated from


other components by defined APIs and service load balancers.

• Easy scaling for applications and clusters: simply changing a


number in a configuration file, k8s takes care of the rest (part of
declarative).

• Scaling development teams with microservices: small team


is responsible for the design and delivery of a service that is
consumed by other small teams (optimal group size: 2 pizzas
team).
Scaling <cont>
Microservice 1

API
Container 1

Team Maggie
LOAD
BALANCER
Microservice 2

API

Z
Container 2
Team John
Scaling <cont>

Kubernetes provides numerous abstractions and APIs that help


building these decoupled microservice architectures:

• Pods can group together container images developed by


different teams into a single deployable unit (similar to docker-
compose)
• Other services to isolate one microservice from another such
(e.g. load balancing, naming, and discovery)
• Namespaces control the interaction among services
• Ingress combine multiple microservices into a single
externalized API (easy-to-use frontend)

K8s provides full spectrum of solutions between doing it “the hard way” and a fully
managed service
Scaling <cont>
Advantages of using K8s: Abstracting your infrastructure

Kubernetes allows to build, deploy, and manage your application in


a way that is portable across a wide variety of environments. The
move to application-oriented container APIs like Kubernetes has
two concrete benefits:

• separation: developers from specific machines


• portability: simply a matter of sending the declarative config to
a new cluster
Advantages of using K8s: Efficiency

There are concrete economic benefit to the abstraction because


tasks from multiple users can be packed tightly onto fewer
machines:

• Consume less energy (ratio of the useful to the total


amount)
• Limit costs of running a server (power usage, cooling
requirements, datacenter space, and raw compute power)
• Create quickly a developer’s test environment as a set
of containers
• Reduce cost of development instances in your stack,
liberating resources to develop others that were cost-
prohibitive
Deploying a Kubernetes Cluster

You can easily access the Kubernetes Client using the following
command:

• to check your cluster status use:

$ kubectl get componentstatuses

• and should see output below:


Deploying a Kubernetes Cluster

You can easily access the Kubernetes Client using the following
command:

• to list the nodes in your cluster use:

$ kubectl get nodes

• and should see output below:


how to deploy confidential applications with the
help of SCONE in a Kubernetes cluster

https://github.com/scontain/hello-world-scone-on-kubernetes
What is the purpose of a namespace in Kubernetes?

You might also like