Code Monkey home page Code Monkey logo

kubernetes-deployment-exercise2's Introduction

Learn about Kubernetes

- Kubernetes does not build image , instead it pulls already built image and start it as container(inside object called Pod)
- Kubernetes contains
    - kubernetes cluster contains VM, VM runs node
    - Kubernetes node runs container based on the instructions received from kube-server-api
    - kubeProxy through which connection to the kubernestes cluster is established from outside world
    - kube-server-api manages the node. 
        - it takes config file, create a container specified as image in cofig file, 
        - number of replicas of created containers will be mainted by kube-server-api.
        - return current status of running containers
    - kubectl
        through which interactio happend from outside world to the kubernetes master
        kubectl apply -f [ filename ]
            apply means perform change , -f to point specific file
             one can perform change in the .yml file (example change image) and execute above command, this will update existing pod by matching the name and Kind when found.
        kubectl get all
            see all object status
        kubectl get [ object ] (pods|service|deployment)
            see status of specific object
        kubectl describer [object type](pods|services) [object name](client-pod)
        kubectl delete -f [ filename ] - to delete an object
        kubectl set(change sepcific property) image(specify the property name) [ type of object ](pod|service|deployment)/[object name] [name of the container]=[new value to the property] (image in this case)

        example: kubectl set image deployment/client-deployment client=stephengrider/multi-client:v5

        To seee list of docker images inside k8s:
            - eval $(minikube docker-env)
            - minikube -p minikube docker-env --shell powershell | Invoke-Expression -- in windows powershell

what happens when kubectl command executed

kubectl command -> Master(kuber-master) -> VM
inside VM
    - docker server -> docker client -> image cache

Deployment object

- we can update only image name of the running Pod. ideally pod is suitable for dev not for PROD
- to update port, replicas or images of pod we can make use of Deployment object.

why we need Service object? why not connect to pod directly through kube proxy?

- for some reason already created pod is killed and started newly means, ip address generated for new pod witll be different than existing pod.
- when we connect through service, through selector it matches the pod with label and connect through targetPort with all replicas. so, customer will not see any difference when pod get killed , newly generated or replicated.

kubernetes-deployment-exercise2's People

Contributors

uiyuvi avatar

Watchers

 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.