Kubernetes

CLOUD COMPUTING

De Docker
a
Kubernetes

CLOUD COMPUTING

CLOUD COMPUTING

Developers Survy Results 2019

https://insights.stackoverflow.com/survey/2019

 

  • 90.000 developers
     
  • Python, the fastest-growing major programming language
     
  • First code writing at 16 years
     
  • DevOps specialist and site reliability engineers are among the highest paid.
     
  • StackOverflow saves 30-90 minutes of time por week to developers

CLOUD COMPUTING

CLOUD COMPUTING

CLOUD COMPUTING

CLOUD COMPUTING

CLOUD COMPUTING

CLOUD COMPUTING

CLOUD COMPUTING

Container orchestrators

Kubernetes

CLOUD COMPUTING

CLOUD COMPUTING

Kubernetes

cluster

master

node

node

worker
(minion)

worker
(minion)

CLOUD COMPUTING

Kubernetes architecture

node

master

kubectl
(cli)

dashboard
(ui)

REST client
(code)

kubelet

API
server

Scheduller

etcd

Controller
Manager

kube-proxy

Pod

Pod

Pod

CLOUD COMPUTING

Historia de Kubernetes

Junio
2014

Julio
2014

Julio
2015

Marzo
2018

Commit inicial en GitHub (Google) k8s - Go

Microsoft, RedHat, IBM y Docker

Kubernetes v1.0

Nov
2015

Primer KubeCon

Feb
2016

Helm Package Manager

CNCF Certified

CLOUD COMPUTING

Kubernetes ecosytem

Local

  • Minikube
  • Docker Desktop (Windows y Mac)
  • MicroK8S
  • k3s

Nube pública

  • Google Cloud (GKE)
  • Amazon (EKS)
  • Azure (AKS)
  • DigitalOcean

CLOUD COMPUTING

Raspberry Pi

Private
datacenter

Instalación de kubernetes

CLOUD COMPUTING

Kubernetes en la nube

  • Administración del Master
  • Nodos pueden ser VM
  • Gestión de actualizaciones
  • Precio

CLOUD COMPUTING

Curva de aprendizaje de Kubernetes

Conceptos
de
Kubernetes

CLOUD COMPUTING

CLOUD COMPUTING

Pod

Pod

Pod

Pod

  • Encapsula 1 o más contenedores
  • Comparte storage
  • Comparte network
    • IP address
    • Rango de puretos
# kubectl apply -f hostname-pod.yaml

apiVersion: v1
kind: Pod
metadata:
  name: hostname-pod-example
spec:
  containers:
    - name: hostname
      image: adongy/hostname-docker

CLOUD COMPUTING

ReplicaSet

  • Escalabilidad
  • Alta-disponibilidad
  • Dispersa pods entre nodos worker
# kubectl apply -f hostname-replicaset.yml
apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: hostname-rs-example
  labels:
    name: hostname
spec:
  replicas: 3
  selector:
    matchLabels:
      name: hostname
  template:
      metadata:
        name: hostname-pod-example
        labels:
          name: hostname
          language: golang
      spec:
        containers:
          - name: hostname
            image: adongy/hostname-docker

Pod

Pod

Pod

3

CLOUD COMPUTING

Deployment

  • Actualiza ReplicaSet
  • Manejo de versiones
  • Roll-back
# kubectl apply -f hostname-deploy.yml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: deploy-example-1
  labels:
    name: example-1
spec:
  replicas: 5
  selector:
    matchLabels:
      name: hostname
  strategy:
    type: RollingUpdate
  template:
      metadata:
        name: hostname-pod-example
        labels:
          name: hostname
          language: golang
      spec:
        containers:
          - name: hostname
            image: adongy/hostname-docker

Pod

Pod

Pod

3

CLOUD COMPUTING

Service

  • IP -> Pods
  • Expone EndPoints
  • Multiples Types
# kubectl apply -f hostname-service.yml
apiVersion: v1
kind: Service
metadata:
  name: hostname-svc
  labels:
    app: hostname
spec:
  type: ClusterIP
  selector:
    app: server
  ports:
  - port: 9999
    protocol: TCP
    targetPort: 3000

Pod

Pod

Pod

3

ClusterIP9999

kube-proxy

PodIP
3000

PodIP
3000

PodIP
3000

PodIP
3000

Sobre esta presentación

CLOUD COMPUTING

Atribución 4.0 Internacional
(CC BY 4.0)

The ultimate introduction to Kubernetes - Pascal Naber

Érase una vez Kubernetes - Manuel Morejón

Basada principalmente en: