Giter VIP home page Giter VIP logo

docker-and-kubernetes-the-complete-guide's Introduction

[Stephen Grider] Docker and Kubernetes: The Complete Guide [ENG, 2018]

Original src:
https://github.com/StephenGrider/DockerCasts

[Offtopic]:
Deploy application from video course [Stephen Grider] Docker and Kubernetes: The Complete Guide [2018, ENG] on local kubernetes cluster
https://github.com/webmakaka/Docker-and-Kubernetes-The-Complete-Guide-Deploy-on-Local-Kubernetes-Cluster-Only


09 Dockerizing Multiple Services


Application


Application


Application


Application


Application


Application


Stephen forgot to add in docker-compose.yml


  worker:
    environment:
      - REDIS_HOST=redis
      - REDIS_PORT=6379

$ cd 09_Dockerizing_Multiple_Services
$ docker-compose up --build
$ ctrl^C
$ docker-compose up

Application

http://localhost:8080/api/values/current


$ docker-compose ps
                   Name                                  Command               State          Ports
-----------------------------------------------------------------------------------------------------------
09_dockerizing_multiple_services_api_1        npm run dev                      Up
09_dockerizing_multiple_services_client_1     npm run start                    Up
09_dockerizing_multiple_services_nginx_1      nginx -g daemon off;             Up      0.0.0.0:8080->80/tcp
09_dockerizing_multiple_services_postgres_1   docker-entrypoint.sh postgres    Up      5432/tcp
09_dockerizing_multiple_services_redis_1      docker-entrypoint.sh redis ...   Up      6379/tcp


10 A Continuous Integration Workflow for Multiple Images


Application

Travis-ci.org --> OUR Project --> More options --> Settings --> Environment Variables

Application

DOCKER_ID marley
DOCKER_PASSWORD mypassword

Application

Application


11 Multi-Container Deployments to AWS

I do not want to pay money for testing AWS.

Application

Application

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html


Travis-ci.org --> OUR Project --> More options --> Settings --> Environment Variables

AWS_ACCESS_KEY
AWS_SECRET_KEY

12 Onwards to Kubernetes

$ minikube start

$ cd 12_Onwards_to_Kubernetes/

$ kubectl apply -f client-pod.yaml
$ kubectl apply -f client-node-pod.yaml

$ kubectl get pods
NAME         READY   STATUS    RESTARTS   AGE
client-pod   1/1     Running   0          14s

$ kubectl get services
NAME               TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
client-node-port   NodePort    10.97.14.234   <none>        8080:31515/TCP   33s
kubernetes         ClusterIP   10.96.0.1      <none>        443/TCP          32m

$ echo $(minikube service client-node-port --url)
http://192.168.99.117:31515

$ kubectl delete -f client-pod.yaml
$ kubectl delete -f client-node-pod.yaml

13 Maintaining Sets of Containers with Deployments

$ kubectl apply -f client-node-pod.yaml
$ kubectl apply -f client-deployment.yaml
$ kubectl get pods
$ kubectl get deployments
NAME                DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
client-deployment   1         1         1            1           1m

$ echo $(minikube service client-node-port --url)
http://192.168.99.117:31515

$ kubectl get pods -o wide
NAME                                 READY   STATUS    RESTARTS   AGE   IP           NODE
client-deployment-588947887b-lkqsc   1/1     Running   0          8m    172.17.0.7   minikube

$ vi client-deployment.yaml

set replicas: 5

$ kubectl apply -f client-deployment.yaml

$ kubectl get deployments
NAME                READY   UP-TO-DATE   AVAILABLE   AGE
client-deployment   5/5     5            5           16m

set replicas back to: 1


Update container:

$ kubectl set image deployment/client-deployment client=marley/multi-client:v5

Reconfiguring Docker CLI

$ minikube docker-env
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.117:2376"
export DOCKER_CERT_PATH="/home/marley/.minikube/certs"
export DOCKER_API_VERSION="1.35"
# Run this command to configure your shell:
# eval $(minikube docker-env)

$ eval $(minikube docker-env)
$ docker ps

14 A Multi-Container App with Kubernetes


$ minikube stop
$ minikube delete
$ minikube start

Application


Application


Persitence Volume && Persitence Volume Claims


Application

Application


Application


Application


Application


Application


// we will use default minikube storageclass
$ kubectl get storageclass
$ kubectl describe storageclass

$ cd 14_A_Multi_Container_App_with_Kubernetes

$ kubectl apply -f .
$ kubectl get pv
$ kubectl get pvc

Environment Variables


Application


Application


Secrets

$ kubectl create secret generic pgpassword --from-literal PGPASSWORD=12345asdf
$ kubectl get secrets

Final

$ kubectl apply -f .

15 Handling Traffic with Ingress Controllers


$ minikube addons enable ingress

Application


Application


Application


Application

https://github.com/kubernetes/ingress-nginx

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

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml

https://kubernetes.github.io/ingress-nginx/deploy/#minikube


$ cd 15_Handling_Traffic_with_Ingress_Controllers/

$ kubectl apply -f ingress-service.yaml

$ minikube ip
192.168.99.100

https://192.168.99.100/


Application


$ minikube stop
$ minikube delete

16 Kubernetes Production Deployment

I will only watch. Do not want to pay for Google Clouds.

here


17 HTTPS Setup with Kubernetes

here




Marley

Any questions in eng: https://jsdev.org/chat/
Любые вопросы на русском: https://jsdev.ru/chat/

docker-and-kubernetes-the-complete-guide's People

Contributors

webmakaka 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.