introduction to kubernetes
play

Introduction to Kubernetes Containers container vs virtual machine - PowerPoint PPT Presentation

Introduction to Kubernetes Containers container vs virtual machine Virtual machine Container runs its own kernel uses the host kernel user-space user-space vm user-space container user-space vm kernel host kernel host kernel


  1. Introduction to Kubernetes

  2. Containers

  3. container vs virtual machine Virtual machine Container runs its own kernel uses the host kernel user-space user-space vm user-space container user-space vm kernel host kernel host kernel

  4. containers are not secure It is possible to execute code on a host system from a container

  5. containers are weird Container operating system is a hybrid OS: it pairs arbitrary host kernel with arbitrary containerized user-space

  6. takeaways ● Do not let unpriveleged users in ● Do not rely on kernel or even system features But since you will anyway, test containers with the production-like host kernel

  7. Docker

  8. layered images FROM debian:jessie RUN apt-get update \ && apt-get install gradle \ ..with protoc && apt-get clean RUN apt-get update \ ..with gradle && apt-get install \ protobuf-compiler \ debian:jessie && apt-get clean Dockerfjle reference

  9. advanced topics ● Volumes You can mount directories from a host system into container Ownership and permissions on fjles are preserved => Problem with deleting fjles owned by root ● Networking You can connect port on the host system with the port exposed by container There is more, but “It’s complicated”

  10. Continuous Integration with containers

  11. containers for ci At build Runtime ● Take base image ● Update git cache ● Add build tools ● Run build task ● Add dependency cache ● Publish artifact to storage ● Add git cache ● Discard container Git repo is a source, application is an artifact, contaner is a build tool

  12. containers for prod At build Runtime ● Take base image ● Run container with exposed endpoint ● Inject app artifact ● Defjne endpoint Application is a source, container image is an artifact

  13. lifecycle Maven repo GIT Registry Artifactory* Bitbucket Nexus docker code code JAR JAR image gradle build docker build

  14. Kubernetes

  15. There is a registry with Docker images now what?

  16. orchestration Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications

  17. vocabulary ● Image ● Container Applies to group of pods: runs image ● Pod ● Replica Set group of containers replica counter ● Node ● Deployment host machine for pods deployment strategy ● Cluster ● Service set of nodes common interface

  18. structure cluster node pod container

  19. deployment replica set service

  20. kubernetes client tools ● Kubernetes provides full-featured REST API ● kubectl – command-line utility with full access to the API Very verbose with a lot of subcommands and options Resources can be created and managed directly by typing CLI commands Or can be stored in YAML fjles and applied in batches by running $ kubectl create -f <directory> ● kubernetes-dashboard – an optional plugin which provides graphical web-interface with limited functionality

  21. networking ● Every node has external IP address 10.123.15.21 ● Every pod has internal IP address 192.168.42.152 pod-1.local and domain name ● Every service has internal IP address and domain name 10.123.15.48 192.168.42.154 pod-2.local => Pods can talk to pods and services by name or IP

  22. But how do I reach the pod from the outside?

  23. debugging pod Pod with one container, based on “busybox” container image When started, runs shell and waits for input Works as a gate to internal network (laptop)$ kubectl run -i --tty busybox --image=busybox --rm --restart=Never Waiting for pod default/busybox-kz38w to be running, status is Pending, pod ready: false Waiting for pod default/busybox-kz38w to be running, status is Pending, pod ready: false Hit enter for command prompt / # telnet pod-1.local 8080

  24. exposed service NodePort – the same port on 192.168.42.152 every node :9999 service 192.168.42.154 pod-3.local :9999 ● Assigned to the service 10.123.15.3 ● Open for external network pod-1.local 10.123.15.3 10.123.15.2 pod-2.local ● Traffjc is redirected to one of the pods behind the service

  25. Demo

  26. q&a Aleksandra Fedorova alpha@bookwar.info

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend