Giter VIP home page Giter VIP logo

kubernetes-development's Introduction

What is Kubernetes (k8s)

Its a open source container orchestration tool designed to automate, deploying, scaling and operating containerized applications. Its a distributed system. Can use different container runtimes.

Key features:

  1. Declarative configurations
  2. Deploy Containers
  3. Wire up networks
  4. Expose and scale services
  5. Atuomated deployment rollout and roolback
  6. RBAC
  7. Persistent volume management
  8. Seamless horizontal scalling
  9. Supports Linux & Windows Clusters

K8s Terms

  • Clusters
  • Nodes (master & worker)
  • Pods
  • Services
  • Deployments

Other tools and Competitiors

  1. DC/OS
  2. Amazon ECS
  3. Docker Swarm Mode

Deploying Kubernetes

K8s Architecture

  • Its a container orchestration tool
  • Composed of group of Nodes
  • Conatiners run in a Pod
  • Nodes are machine in clustres
  • Control plane run's on master node and schedules containers on thde nodes
  • Pod can have one or more containers
  • K8s service exposes Pods to Cluster and outside them

Imperative Commands

Find all pods in a default namespace

kubectl get pods -n default

Create a pod redis with label name as ninad and using with exposing port 8080

kubectl run redis --image=redis -l name=ninad --port 8080

Create deployment with name nginx-deploy and image nginx with 5 replicas in namespace development

kubectl create deploy nginx-deploy --image=redis --replicas=5 -n development

Config Maps

kubectl get configmaps kubectl create configmap webapp-config-map --from-literal=APP_COLOR=darkblue

Secrets

kubectl get secrets kubectl describe secret kubectl create secret generic some-secret --from-literal=SOME_VAR=SomeTopSecret --from-literal=ANOTHER_VAR=SomeAnotherValue

Get the Pod Definition in yaml format

kubectl get pod pod-name -o yaml > pod-definition.yaml

Get details about pods definition file format and object

kubectl explain pods --recursive kubectl explain pods --recursive | less kubectl explain pods --recursive | grep -A10 envFrom

Get Volumnes

kubectl get pv pvc

Common multi container patterns

  1. Sidecar pattern
  2. Ambassador pattern
  3. Adapter pattern

Tips and tricks for kubectl

kubectl completion --help

Enable: source < (kubectl completion bash) echo "source < (kubectl completion bash)" >> ~/.bash_profile

Press tab or press tab twice

kubectl

kubectl get nodes

pods = po

--sort-by='{.metadata.creationTimestamp}'

kubectl create namespace tricks -o yaml --dry-run

kubectl get pod -n app -o yaml --export | wcl -l


References

kubernetes-development's People

Contributors

ninadgawad avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.