Google Kubernetes Engine: Create GKE Cluster and Deploy Sample Website!!

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ต.ค. 2024
  • 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.c...
    • docs.docker.co...
    • cloud.google.c...
    • cloud.google.c...
    ----------
    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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 118

  • @reddyajith9508
    @reddyajith9508 3 ปีที่แล้ว +1

    As expected ...simple and sweet ..
    Thanks for making our lives easy GK !!

  • @alexbardelli1
    @alexbardelli1 2 ปีที่แล้ว

    I would like to thank you for all your contents about GCP, you really cleared out my mind about which cloud Provider peruse as first.

  • @Bijuthtt
    @Bijuthtt 3 ปีที่แล้ว +1

    Awesome tutorial. explained in a nice way. Thank you sir

  • @santoshkudhale6799
    @santoshkudhale6799 4 ปีที่แล้ว +1

    Thanks for making this GKE series. Its helpful. 👍🏼

  • @svJayaram9
    @svJayaram9 4 ปีที่แล้ว +1

    Yes i am able to deploy the html in the cluster. Thank you for your video

  • @shitsonfireyo
    @shitsonfireyo 2 ปีที่แล้ว

    exactly what I was looking for! thank you!

  • @dharmeshpatel8778
    @dharmeshpatel8778 3 ปีที่แล้ว

    Thank you so much! I had been trying to deploy since two days and your video helped me finish my job interview assessment.

  • @gui250493
    @gui250493 3 ปีที่แล้ว +1

    Very well done.
    Thanks very much.
    You could also build the image out of a Dockerfile, but It was a clear tutorial. Thanks.
    Please, send more.

  • @ramroy5942
    @ramroy5942 2 ปีที่แล้ว

    Your lectures are very Insightfull Kartik....thankyou for enriching us

  • @chandrachoodraveendran6413
    @chandrachoodraveendran6413 ปีที่แล้ว

    It was an awesome video, great value in short time

  • @IRegan
    @IRegan ปีที่แล้ว

    Thank you so much, I found it interesting and a perfect tutorial man🙏

  • @monishverma362
    @monishverma362 4 ปีที่แล้ว +1

    Nice tutorial. I was able to get my spring boot app up and running

  • @srinivasrevadi44
    @srinivasrevadi44 ปีที่แล้ว

    you saved my a**, thanks you,
    able to do hands on

  • @prakashannadurai2031
    @prakashannadurai2031 2 ปีที่แล้ว

    It's a superb bro and i tried this in my PC and it works. For this site i'm trying to add ingress rule, but stuck up. Is there any video for adding the same.

  • @piyushdarji7926
    @piyushdarji7926 3 ปีที่แล้ว +1

    Wow ...so helpful sir

  • @subesingh7285
    @subesingh7285 4 ปีที่แล้ว +1

    Thank you for such a good video!

  • @CSRFVICTIMEmperor
    @CSRFVICTIMEmperor 6 หลายเดือนก่อน

    Hi, can you create a video about the pricing and the best options to use for large-scale web applications?

  • @adamtechdays
    @adamtechdays 3 ปีที่แล้ว +2

    This was an excellent video, clarified a lot. Do we need to know the ins and outs of yml file creations for the Google Cloud Associate exam or is this method sufficient?

  • @mengyuli5711
    @mengyuli5711 3 ปีที่แล้ว

    Your video is awesome.

  • @verizon2851
    @verizon2851 4 ปีที่แล้ว +2

    Can we directly deploy an image from dockerhub registry to the GKE cluster?? And also, the video was very informative. Thanks!

  • @sidharthaworld
    @sidharthaworld 3 ปีที่แล้ว +2

    Thanks for sharing awesome video's . Can you share us the same using declarative way instead of adhoc way and what is Ephemeral Containers ?

  • @gcpchannelforbegineers7080
    @gcpchannelforbegineers7080 3 ปีที่แล้ว

    Simply awesome sir. Here you explain with single node can you please do an video if you created more than 1 nodes so that we've better idea sir.

  • @Deevg-f9e
    @Deevg-f9e 7 หลายเดือนก่อน

    Very informative. I tried to create a GKE auto mode cluster with a shared VPC network(private IP range), and assigned necessary IAM roles to the GKE hosted service project with (compute.engineadmin and container.admin roles). While provisioning the gke auto pilot cluster, getting this exception as " Error: Error waiting for creating GKE cluster: All cluster resources were brought up, but: only 0 nodes out of 1 have registered; cluster may be unhealthy." Verified the logs for any key findings, but not helpful. Any thoughts/references on this error scenario to troubleshoot ??

  • @janellepablo3922
    @janellepablo3922 4 ปีที่แล้ว

    thank you. this is very helpful.

  • @shubhamvishwakarma9233
    @shubhamvishwakarma9233 3 ปีที่แล้ว

    Awesome work !!!

  • @zohebsiddiqui4975
    @zohebsiddiqui4975 4 ปีที่แล้ว +1

    Hi GK
    With the your great help i am following most of your tutorials and able to perform the labs success-fully .
    Getting good support from the FB group as well.
    This has created my interest in the cloud even more the way to teach is awesome but just one more thing if you give the back ground of what your are going to do in the lab would help even more to beginners.But still you are amazing.
    And finally i able to deploy my website in the kubernetes cluster.
    One more thing do we need to delete the cluster and docker repository to avoid charges please do let me know
    Thanks.

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว

      Thank you, yes pls delete the cluster right away.

  • @douglasharley2440
    @douglasharley2440 4 ปีที่แล้ว

    *great video* ! much thanks

  • @pavangrandhi
    @pavangrandhi 4 หลายเดือนก่อน

    Thank you 🙏

  • @scorpiovibration8172
    @scorpiovibration8172 3 ปีที่แล้ว

    Best explanation sir :)

  • @RaghavSood19
    @RaghavSood19 4 ปีที่แล้ว

    Helpful thanks

  • @najeebshaik9064
    @najeebshaik9064 9 หลายเดือนก่อน

    Hi , My application runs when i run this command "docker run -p 8080:8080 [image name]"
    But after this command "kubectl expose deployment wb-server --type LoadBalancer --port 80 --target-port 80"
    The external ip address doesn't run anything.
    Can you please help me here. Thanks

  • @abhinavmajumdar7365
    @abhinavmajumdar7365 ปีที่แล้ว

    From where to study to prepare for k8s certification?

  • @nileshmunnur573
    @nileshmunnur573 2 ปีที่แล้ว

    I am building a containerized web application that has a .net frontend container and a REST Api backend container.
    I'd like to know which of these options is the best for our needs:
    · Deploy everything in the same cluster and node pool and let kubernetes manage and scale them as needed
    · Deploy everything in the same cluster and 2 different node pools with different machine types and node limits for frontend and backend
    · Deploy frontend and backend in different clusters all together with a single node pool each

  • @rajkumarmishra4409
    @rajkumarmishra4409 ปีที่แล้ว

    How can we run script in gke cluster through terraform..?? Please any answer

  • @leandrojpg
    @leandrojpg ปีที่แล้ว

    if you can make a video with cloudbuild with deploy in gke and using tag automatically by cloudbuildd.

  • @akshayasarangapani9122
    @akshayasarangapani9122 4 ปีที่แล้ว +1

    Wonderful video! Thank You. I ran docker with nginx . Able to view default nginx webpage. But when I ran tried "docker cp index.html [container-id]:/usr/share/nginx/html/" , it gives the following error "lstat /home/USER/index.html: no such file or directory. Also I don't see index.html on my home directory as well as no nginx folder under /usr/share. Any idea what is an issue ?

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว

      You can easily create one and copy it.

    • @akshayasarangapani9122
      @akshayasarangapani9122 4 ปีที่แล้ว

      @@CloudAdvocate yeah , that's what I did . created index.html file using vi editor and copied the content of html file. It just displayed the blank page

  • @moosegoose1282
    @moosegoose1282 3 ปีที่แล้ว

    Hey bro, does GKE set up ssl for you? I see the https on the site. If I deploy a web api it will also have ssl right? I’m planning on deploying 3 separation containers

  • @praveshtiwari6449
    @praveshtiwari6449 4 ปีที่แล้ว

    Wonderful video, Good Job (y) I am trying to deploy a software using kubernetes. everything went well ...but when i am trying to access it . it's showing "default backend - 404" in browser.

  • @Sunil.khambadkar
    @Sunil.khambadkar 4 ปีที่แล้ว

    Hello Sir, i am SAP security guy so everything is new for me and i started learning ACE from Udemy , but when i reached to Kubernetes i was stacked. but your video GKE part 1 helps me alot for understand the kubernetes. one question may be it's stupid one but how to create this file nginx:latest, shall i can also create my separate file?

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว +1

      Thats a command to pull the latest version of nginx image from the docker registry.

    • @Sunil.khambadkar
      @Sunil.khambadkar 4 ปีที่แล้ว

      Okies got it thanks

  • @maamukutty
    @maamukutty 4 ปีที่แล้ว

    Hey bro.. Thanks for the video.. I haven't gone deep into kubernetes yet..but to go for a starter, Can you please explain the difference between app engine vs kubernetes..

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว +1

      Good article on that Hari “App Engine Flex || Kubernetes Engine - ?” by Daz Wilkin link.medium.com/WTfhWW4wm8 :) Too lengthy to explain in comments.

    • @maamukutty
      @maamukutty 4 ปีที่แล้ว

      @@CloudAdvocate Oh.. Thanks a lot for sharing this.. If u think its one good content for u to make a video on it.It's would be my pleasure 😜

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว +1

      @@maamukutty Sure good idea!!

  • @svJayaram9
    @svJayaram9 4 ปีที่แล้ว

    Hi GK, how are you.. really your video's are so clear and very understandable. I think you can create one GCP course and post it on Udemy. So that we can buy that complete course for ACE. What you say? And one more question is, is there any possibility to share your mail id?

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว

      Hi Sankar, I am doing well thank you. Yea I wanted to do. Hopefully soon. My email is multicloudguy@gmail.com

  • @bbhajesh
    @bbhajesh 4 ปีที่แล้ว

    Hey Thanks, Nice one. Do you have any tutorial about how to run GKE from a message from pub/sub subscriber?

  • @mrjohnchen
    @mrjohnchen 2 ปีที่แล้ว

    Hi there. Thanks for the detailed demo. I faced a problem when I execute "docker cp index.html [container-id]:/usr/share/nginx/html/". The error message: lstat /home/.../index.html: no such file or directory. Which folder should I be in to execute this command?

    • @matheusmedrado4430
      @matheusmedrado4430 2 ปีที่แล้ว

      i think you should upload some custom html file or create a html file to do that.
      Because this command just copy a file to the container you need a index.html file to make the command work

  • @subesingh7285
    @subesingh7285 4 ปีที่แล้ว +1

    Hi GK, When you will upload new video in this series?

  • @prasanthimalepati8811
    @prasanthimalepati8811 4 ปีที่แล้ว

    I am getting Connection refused error while trying to access the external IP.please help me on this.

  • @danypremraj7121
    @danypremraj7121 4 ปีที่แล้ว

    One question
    U said nginx default port is 8080
    But while deploying in the kubernetes we have set both source and target port as 80. Why?????

  • @herbertpurpora9452
    @herbertpurpora9452 3 ปีที่แล้ว

    hello, how can we access the files inside a bucket? I'm a newbie in gcp

  • @c00per_
    @c00per_ 10 หลายเดือนก่อน

    I m from south India Which region should i select. [Im on free tier
    ]

    • @c00per_
      @c00per_ 10 หลายเดือนก่อน

      Bro please reply

  • @AllinOne-wn6wt
    @AllinOne-wn6wt 4 ปีที่แล้ว

    we will deploy a docker image /container image(cad/web:version1) not a container in cluster am I correct.Then pod doesn't contain container. we can't make a ssh to the container image right. how do we make multiple container images in a single pod. Can we pull images from container registry and modify the images

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว

      Its container inside a pod. You can ssh to that. stackoverflow.com/questions/38485771/how-to-ssh-to-docker-container-in-kubernetes-cluster this link should help you.

  • @ashshah8995
    @ashshah8995 3 ปีที่แล้ว

    how would you then attach a database too it?

  • @Nepali_old_bhajans
    @Nepali_old_bhajans 3 ปีที่แล้ว

    Sir, we need more videos on kubernetes.

  • @santroproin6969
    @santroproin6969 4 ปีที่แล้ว +1

    Sir can you provide your files you have used in this video . in the description they are not there. OR repo link .

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว +1

      Sure Sandeep. Will do.

    • @santroproin6969
      @santroproin6969 4 ปีที่แล้ว

      @@CloudAdvocate Sir if possible please upload in next few hours or tomorrow. It is important for me

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว

      @@santroproin6969 I was looking at my description. I have copied everything that I have it on my file. All the commands. Which script are you talking about?

    • @santroproin6969
      @santroproin6969 4 ปีที่แล้ว

      @@CloudAdvocate the index.html files

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว +1

      @@santroproin6969 Please get it from github.com/cloudadvocate/google-cloud/blob/master/gke/index.html

  • @GigiMathewTX
    @GigiMathewTX 4 ปีที่แล้ว

    Is it possible to do a video on adding Wordpress docker container with Kubernetes?

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว +1

      There is step by step guide here cloud.google.com/kubernetes-engine/docs/tutorials/persistent-disk

  • @biswajitdash9343
    @biswajitdash9343 3 ปีที่แล้ว

    I am trying to build and deploy an php application on gcp using docker and gke...can anyone help me please..

  • @arunrajj17cs94
    @arunrajj17cs94 4 ปีที่แล้ว

    The first Command didn't run.(docker run -p 8080:80 nginx:latest). Please help
    docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
    See 'docker run --help'.

    • @arunrajj17cs94
      @arunrajj17cs94 4 ปีที่แล้ว +1

      solved : th-cam.com/video/jeKnYZCcdvE/w-d-xo.html

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว +1

      @@arunrajj17cs94 cool

    • @AnujTechShorts
      @AnujTechShorts 4 ปีที่แล้ว

      type = sudo service docker start

  • @thejaswinid9992
    @thejaswinid9992 4 ปีที่แล้ว

    Hi Gk.i am getting error.Followed your steps but unable to view cloud advocate page.I can view only nginx.

    • @thejaswinid9992
      @thejaswinid9992 4 ปีที่แล้ว

      34.69.114.108:31562/

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว

      Then maybe you didn't copy cloud advocate index.html. so you are left with default page.

  • @ngnaven
    @ngnaven 4 ปีที่แล้ว

    Hi, I followed the same steps as above. But it is still showing some error. I think there is some problem in my Dockerfile.
    I get an error in the preview port step.
    Can you share your Dockerfile ? Also below are the contents of my Dockerfile. Please have a look.
    FROM nginx:alpine
    RUN rm -rf /usr/share/nginx/html
    COPY . /usr/share/nginx/html
    EXPOSE 8080
    CMD ["nginx", "-g", "daemon off;"]

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว

      Hi Naveen, I don't think I have built from a dockerfile. I did it all manual to show more commands.

  • @68naveeng
    @68naveeng 4 ปีที่แล้ว

    could you please add video on CICD Jenkins, spinnaker, ansible, terraform attache with Kubernetes engine.

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว

      Thanks for suggestions Naveen. Are you suggesting separate videos on each services or using them with kubernetes?

    • @68naveeng
      @68naveeng 4 ปีที่แล้ว +1

      Separate or single how we to integrate kubernate with Jenkins , ansible and terraform

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว

      @@68naveeng Thanks Naveen, will do that.

  • @yogeshasalkar2507
    @yogeshasalkar2507 3 ปีที่แล้ว

    GKE is IaaS, PaaS or SaaS?

  • @Nepali_old_bhajans
    @Nepali_old_bhajans 3 ปีที่แล้ว

    When I open a cloud shell I get something like this =: @cloudshell:~ (resonant-fiber-292023)
    but in your case, you got into the files folder. Please can you explain that part? thank you.

    • @CloudAdvocate
      @CloudAdvocate  3 ปีที่แล้ว +1

      I must have gone into that folder :)

  • @aykageneration
    @aykageneration 4 ปีที่แล้ว

    hello! is the same steps for deploy multiplayer android game (dedicated game server)?

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว

      Not sure what you mean by that :)

    • @aykageneration
      @aykageneration 4 ปีที่แล้ว

      @@CloudAdvocate : i create multiplayer android game and i want host the dedicated game server so for doing that i need to create docker image then container after that with GKE (google kubernetes engine) + Agones create the dedicated game server...for me the problem how create docker image for my android game you undrestand me ? thank you

    • @aykageneration
      @aykageneration 4 ปีที่แล้ว

      in your video you working for deploy sample of website so is the same work for deploy multiplayer game server? i hope you can see what i mean :)

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว +1

      Yes, if you are gonna run it as a container..you can try the same steps.

  • @laukikkshirsagar4792
    @laukikkshirsagar4792 4 ปีที่แล้ว

    Hey Hi GK,. Thank you for this video.
    I am new to this field and want to know how can I deploy .py or .sh file or any standalone App other than .html file... I mean what if I want to deploy standalone App instead of website... Do I need to containerize my app code every time or is there any other way other way.
    I may sound weired but I have lot of confusion on this.. please help

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว

      Yes, you have to build an image everytime.

    • @laukikkshirsagar4792
      @laukikkshirsagar4792 4 ปีที่แล้ว

      Ok thank you,, but this deployment is on kubernetes cluster and that's why we have to containerize the application everytime. Can we do it without containerizing on a normal VM, instead of cluster

    • @CloudAdvocate
      @CloudAdvocate  4 ปีที่แล้ว +1

      If you want to run ur app inside a container you have to follow the same with or without k8's. If you wanna run container in a vm..you can install docker and do it...still need an image.

    • @laukikkshirsagar4792
      @laukikkshirsagar4792 4 ปีที่แล้ว

      @@CloudAdvocate thank you

  • @tcarreira
    @tcarreira 3 ปีที่แล้ว

    I understand why you did it, but please, avoid any `docker commit` on any tutorial or teaching content.
    There are many newcomers that think `docker commit` is acceptable. It is not (and I'm sure you agree, but the newcomers cannot distinguish good from bad)
    Otherwise, thanks for your content