You will learn some basic docker commands. Create docker image and publish the image to docker container registry. Finally deploy the sample website to Google Kubernetes Engine cluster.
#gke #gkecluster
Part - 1:
=======
Create a sample website using docker container
docker run -p 8080:80 nginx:latest
docker cp index.html [container-id]:/usr/share/nginx/html/
docker commit [container-id] cad/web:version1
docker tag cad/web:version1 us.gcr.io/youtube-demo-255723/cad-site:version1
docker push us.gcr.io/youtube-demo-255723/cad-site:version1
PART - 2
=======
Deploying container in GKE cluster
gcloud config set project youtube-demo-255723
gcloud config set compute/zone us-central1-a
Creating a GKE cluster
gcloud container clusters create gk-cluster --num-nodes=1
gcloud container clusters get-credentials gk-cluster
This command configures kubectl to use the cluster you created.
Deploying an application to the cluster
kubectl create deployment web-server --image=us.gcr.io/youtube-demo-255723/cad-site:version1
Exposing the Deployment
kubectl expose deployment web-server --type LoadBalancer --port 80 --target-port 80
Inspecting and viewing the application
1. Inspect the running Pods by using
kubectl get pods
2. Inspect the hello-server Service by using
kubectl get service
Sources:
• cloud.google.com/container-re...
• docs.docker.com/engine/refere...
• cloud.google.com/sdk/gcloud/r...
• cloud.google.com/kubernetes-e...
----------
PLEASE SUBSCRIBE ➡️bit.ly/36x6qQy ❤️
If you like my work considering buying me a COFFEE: bit.ly/3lumyqx
----------
PLAYLISTS:
- Associate Cloud Engineer Study Guide: bit.ly/37y1dYl
- Google Cloud Playlist: bit.ly/37uMZal
----------
- Questions? Thoughts? Disagreements? Tell us here in the comments.
----------
LETS CONNECT:
👍 Facebook: / multicloudguy
📸 Instagram - / multicloudguy
🐦 Twitter - / multicloudguy
17 мар 2020