Git Product home page Git Product logo

docker_k8s's Introduction

Kubernetes tutorial

Docker hub

https://cloud.docker.com/u/nikhil101/repository/docker/nikhil101/django-k8s

checkout each tag

  1. pods-creation
  2. pods-replication

Replicaset

You create a pod and create replicaset

kubectl create -f pods.yml
kubectl create -f pods_replica_run_with_pods.yml

Or you can create a replicaset which will create desired no of pods.

kubectl create -f pods_replica.yml

Service

Via containerPort

See, containerPort & Kubernetes site

Via NodePort

https://kubernetes.io/docs/tasks/access-application-cluster/service-access-application-cluster/ Deploy pods_nodeport.yml

kubectl expose deployment hello-world --type=NodePort --name=example-service

In GKE, Services & Incress (page) -> Port -> Port forwarding

Via Loadbalancer

See this

https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/

BLUE GREEN Deployment

Go to folder

Deploy blue.yml & blue_svc.yml. Connect the service,

kubectl describe svc bg-service

Deploy green.yml. Check the pod list

kubectl get pods -o wide

Connect the service. It is pointing towards blue.

Deploy green_svc.yml. Connect the service. It is pointing towards green.

Ingress Conroller (nginx)

kubectl apply -f pods_node.yml

kubectl expose deployment hello-world --type=NodePort --name=node-svc

kubectl apply -f pods_nodeport_ingress.yml

This will create a ingress controller but we cannot access it.

Create an ingress loadbalancer, https://kubernetes.github.io/ingress-nginx/deploy/#prerequisite-generic-deployment-command

For GCP

Internet is full with example which works perfectly on minikube. But having ingress on minikube is not same as on cloud. Public IP doesnot exist on minikube. Which is big missing part.

Easiest working example with public IP, is at https://cloud.google.com/kubernetes-engine/docs/tutorials/configuring-domain-name-static-ip#config-connector_1

docker_k8s's People

Watchers

 avatar  avatar

Forkers

presitad

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.