Skip to content
[DEVOPS] [Stephen Grider] Docker and Kubernetes: The Complete Guide [2018, ENG]
JavaScript HTML CSS Dockerfile Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
04_Making_Real_Projects_with_Docker
05_Docker_Compose_with_Multiple_Local_Containers
06_Creating_a_Production_Grade_Workflow
07_Continuous_Integration_and_Deployment_with_AWS
08_Building_a_Multi_Container_Application
09_Dockerizing_Multiple_Services
10_A_Continuous_Integration_Workflow_for_Multiple_Images
11_Multi_Container_Deployments_to_AWS
12_Onwards_to_Kubernetes
13_Maintaining_Sets_of_Containers_with_Deployments
14_A_Multi_Container_App_with_Kubernetes
15_Handling_Traffic_with_Ingress_Controllers
16_Kubernetes_Production_Deployment
17_HTTPS_Setup_with_Kubernetes
img
.gitignore
README.md

README.md

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

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/marley-nodejs/Docker-and-Kubernetes-The-Complete-Guide-Local-Kubernetes-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

jsdev.org

You can’t perform that action at this time.