Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cloud-Plattformen entmystifiziert: Was können D...

Cloud-Plattformen entmystifiziert: Was können Docker, Kubernetes, Cloud Foundry & Knative?

OOP 2020, München, Germany

Matthias Haeussler

February 05, 2020
Tweet

More Decks by Matthias Haeussler

Other Decks in Technology

Transcript

  1. Agenda 2 • Who am I? • Why this talk?

    • Historical Timeline • What is a platform? • Technologies • Kubernetes • Cloud Foundry • Knative • Demo • Final comparison
  2. LXC Container/Platform history 2018 2017 2014 2013 2011 2008 1979

    …. … … . chroot Cloud Foundry Virtualization and isolation in subsystems. Examples: FreeBSD Jails, Linux VServer cgroups (2007) namespaces (2002) istio knative kubernetes eirini
  3. Deployments Services NetworkPolicies LoadBalancer NodePort ReplicaSet StatefulSet ClusterIP Ingress Pods

    Container IngressControllers HPA ConfigMaps Secrets apply YAML YAML YAML Minimal Concepts Docker Image
  4. App Dev DB Systems Admin “Provider” Platform Admin Secrets/Config Source

    Code Build Artifact Buildpacks / Images Containers Git CI/CD
  5. Day 0 Day 1 Day 2 Day 3 • Architecture

    • Design • Implementation • Code-to-Repo • Build • Package • Containerize • Deploy • Multi-Tenancy • Run • Scale • Recover • Update & Patch • Observe • Version • Delete • Clean Up • End of Life Platform coverage Developer & Operator responsibility
  6. Workload Abstraction Layers Virtual Machines Container Applications Functions Platform Support?

    • Functions • Event-Driven • 12-factor apps • Stateful apps • more “types”?
  7. Kubernetes Intro • Container Runtime/Platform • Founded in 2013, released

    in 2014 • Idea based on Google’s internal platform Borg • Not opinionated, open, extensible & configurable • Major project of the Cloud Native Computing Foundation (CNCF) landscape
  8. runtime app runtime app kubectl create pod replica set runtime

    app runtime app pod v2 replica set v2 deployment service/ingress endpoint Kubernetes Basics - Orchestration
  9. Day 0 Day 1 Day 2 Day 3 • Architecture

    • Design • Implementation • Code-to-Repo • Build • Package • Containerize • Deploy • Multi-Tenancy • Run • Scale • Recover • Update & Patch • Observe • Version • Delete • Clean Up • End of Life Build source Build container Register image Kubernetes responsibility
  10. kubectl apply !!!!!!!"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # kubectl apply -f deployment.yaml !!!-!!!$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1

    # apiVersion: apps/v1 2 # kind: Deployment 3 # metadata: 4 # name: sample-app-nodejs 5 # spec: 6 # selector: 7 # matchLabels: 8 # app: sample-app-nodejs 9 # replicas: 3 10 # template: 11 # metadata: 12 # labels: 13 # app: sample-app-nodejs 14 # spec: 15 # containers: 16 # - name: sample-app-nodejs 17 # image: index.docker.io/starkandwayne/sample-app-nodejs:latest 18 # --- 19 # apiVersion: v1 20 # kind: Service 21 # metadata: 22 # name: sample-app-nodejs 23 # spec: 24 # selector: 25 # app: sample-app-nodejs 26 # type: LoadBalancer 27 # ports: 28 # - protocol: TCP 29 # port: 80 30 # targetPort: 8080 !!!!!!!%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  11. Cloud Foundry Intro • Platform as a Service (PaaS) •

    Founded in 2008, released in 2011 • Fast and easy to build, test, deploy & scale apps • Opinionated, focus on simplicity for dev “Here is my source code, run it on the cloud for me - I do not care how” (Onsi Fakhouri, Pivotal)
  12. Day 0 Day 1 Day 2 Day 3 • Architecture

    • Design • Implementation • Code-to-Repo • Build • Package • Containerize • Deploy • Multi-Tenancy • Run • Scale • Recover • Update & Patch • Observe • Version • Delete • Clean Up • End of Life Provide source or binary Cloud Foundry responsibility
  13. New

  14. New

  15. $ cf push sample-app $ kubectl get pods -n scf-eirini

    NAME READY STATUS sample-app-dev-bb89da1431-0 1/1 Running $ cf scale sample-app-java -i 4 $ kubectl get pods -n scf-eirini NAME READY STATUS sample-app-dev-bb89da1431-0 1/1 Running sample-app-dev-bb89da1431-1 0/1 ContainerCreating sample-app-dev-bb89da1431-2 0/1 ContainerCreating sample-app-dev-bb89da1431-3 1/1 Running $ kubectl exec -ti -n scf-eirini \ sample-app-dev-bb89da1431-0 bash cf push eirini
  16. $ kubectl get pods -n scf NAME READY STATUS cf-operator-894886ff9-5s4zx

    1/1 Running scf-adapter-v1-0 5/5 Running scf-api-v1-0 17/17 Running scf-bits-v1-0 7/7 Running scf-cc-worker-v1-0 5/5 Running scf-database-v1-0 5/5 Running scf-diego-api-v1-0 6/6 Running scf-doppler-v1-0 11/11 Running scf-eirini-v1-0 6/6 Running scf-log-api-v1-0 8/8 Running scf-nats-v1-0 5/5 Running scf-router-v1-0 6/6 Running scf-scheduler-v1-0 10/10 Running scf-singleton-blobstore-v1-0 7/7 Running scf-uaa-v1-0 7/7 Running update-all-cf-buildpacks-8d9lb 0/1 Completed cf push quarks
  17. Knative • Open Sourced and initiated by Google • Support

    by Red Hat, Pivotal, IBM … • Runs on top of Kubernetes and Istio • Focus on symplifying K8s experience and provide serverless capabilities • Auto-scale on request load (down to 0)
  18. Day 0 Day 1 Day 2 Day 3 • Architecture

    • Design • Implementation • Code-to-Repo • Build • Package • Containerize • Deploy • Multi-Tenancy • Run • Scale • Recover • Update & Patch • Observe • Version • Delete • Clean Up • End of Life Build source Build container Register image Knative Serving
  19. Day 0 Day 1 Day 2 Day 3 • Architecture

    • Design • Implementation • Code-to-Repo • Build • Package • Containerize • Deploy • Multi-Tenancy • Run • Scale • Recover • Update & Patch • Observe • Version • Delete • Clean Up • End of Life Knative Serving (Knative) Tekton
  20. kn service create $ kn service create \ springonedemo -n

    test-app \ --image drnic/springonedemo $ bootstrap-system-knative kwt test-app $ curl http://springonedemo.test-app.example.com Hello World! $ kubectl get pods -n test-app NAME READY STATUS kwt-net 1/1 Running springonedemo-1-deployment-nbg2j 2/2 Running … wait… $ kubectl get pods -n test-app NAME READY STATUS kwt-net 1/1 Running springonedemo-1-deployment-nbg2j 2/2 Terminating
  21. istio knative $ kubectl get pods -n istio-system NAME READY

    STATUS cluster-local-gateway-5c566fd544-86wfw 1/1 Running cluster-local-gateway-5c566fd544-tx2p7 1/1 Running istio-ingressgateway-6c6cbf558b-kh6l8 2/2 Running istio-ingressgateway-6c6cbf558b-r6vpb 2/2 Running istio-pilot-7b6d979db8-vtmj9 1/1 Running $ kubectl get pods -n knative-serving NAME READY STATUS activator-68d9f95cd-9z4nz 1/1 Running autoscaler-5655c9fcfd-6x4jp 1/1 Running autoscaler-hpa-8668fc6f68-9vsfr 1/1 Running controller-5b77c5596c-qckcm 1/1 Running networking-istio-6d7d44d879-gz6j6 1/1 Running webhook-75b4fc9999-gwrp9 1/1 Running
  22. provides most container platform technical capabilities + easy devX +

    “containerless” + scale to zero + revisions + percentage routing
  23. Day 0 Day 1 Day 2 Day 3 • Architecture

    • Design • Implementation • Code-to-Repo • Build • Package • Containerize • Deploy • Multi-Tenancy • Run • Scale • Recover • Update & Patch • Observe • Version • Delete • Clean Up • End of Life Knative Serving Build source Build container Register image Knative Serving (Knative) Tekton Knative Serving Provide source or binary Platform coverage Human responsibility Build source Build container Register image Kubernetes responsibility Cloud Foundry responsibility