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

Kubernetes, It's Automation Not Automagic

Avatar for Cody Moss Cody Moss
October 23, 2018

Kubernetes, It's Automation Not Automagic

A talk on Kubernetes. What it is. How to use it. Discusses the building blocks of Kubernetes such as services, deployments, pods, and the cluster it self. Good for beginners. Does not go in depth with every work load. Just enough to get you started.

Avatar for Cody Moss

Cody Moss

October 23, 2018
Tweet

More Decks by Cody Moss

Other Decks in Programming

Transcript

  1. • Clustering platform • Self healing • Makes deploying docker

    images easier • Get more out of hardware with containers
  2. • Kubernetes uses docker images • Other container technology can

    be used instead • Docker is the most common • Use Docker for developing • Docker Hub is used to pull images • You can also swap out for other image repositories
  3. The Cluster • A kubernetes cluster is made up of

    two node types • Recommended to have at least 3 worker nodes for production • Master node manages the worker nodes • Worker nodes are what run the applications • Master node is where deployments and services are managed
  4. Pods • The smallest deployed object • Contains one or

    more containerized applications • Contains volumes that are shared to the containers ◦ Can be persistent • Very rarely created alone • They are mortal • Do not replicate on their own • If more than one container is in a pod they can see each other as localhost
  5. Deployments • Represents the deployment of the application(s) • Deployment

    objects create pods on the cluster • Manages the pods and uses other controllers to replicate the pods • Does not expose the pods • It will resurrect pods that die • Controls rolling updates when deployment is updated • Uses labels/selectors to know which pods to watch and replicate • Contains the pod specification • Most common way to deploy an application(s)
  6. Services • Exposes the pods • Uses labels/selectors to select

    the pods to expose to outside the cluster • Has a few types to choose from for exposing • Deployments without a service are not exposed outside the cluster • This is where load balancer info is passed in if that type is used • Order matters when specifying applications rely on other services • When pods are created after services they get ENV variables that say what ip and port are exposed
  7. Volumes • Have the same life as a pod •

    Will persist through container restarts in the pod • Work like docker volumes • Many ways to get information into the volume • Can be made persistent so that they last longer than pods • Persistent is for applications to save to disk kind: Pod apiVersion: v1 metadata: name: task-pv-pod spec: volumes: - name: task-pv-storage persistentVolumeClaim: claimName: task-pv-claim containers: - name: task-pv-container image: nginx ports: - containerPort: 80 name: "http-server" volumeMounts: - mountPath: "/usr/share/nginx/html" name: task-pv-storage
  8. Secrets • Secret objects can be injected into pods in

    two ways (file, env) • Data attributes are base64 encoded • Don't have to be in the repo with the application • Hides the secrets from the dev team while build masters have it • Only as secure as your cluster and pipeline to move it • Can also be accessible via the kubernetes api
  9. Helm • Kubernetes package manager • Makes deploying common applications

    a flash • Calls packages charts • Takes on a sea style theme when describing packages • Has decent documentation • When deploying something multiple times think about making a chart for the community • As easy as composer • Has an already extensive and growing list of charts • Easy to install • Best software to come out with Kube