How to Build and Deploy an app on Kubernetes by GitLab ci cd pipeline

Sdílet
Vložit
  • čas přidán 16. 09. 2023
  • CI CD pipeline is used for quick and efficient delivery of an application to its consumers. So, In this "How To" presentation I demonstrate how to create a #gitlab CI/CD #pipeline that uses a #Gitlab-Runner to build and push images to GITLAB #container registry and we will learn how to connect an existing #kubernetes Cluster to GitLab and How to deploy applications on cluster using CI/CD tunnel
    This #tutorial assumes you have a Local Kubernetes cluster like Racher-Desktop . To setup Rancher Cluster on your windows machine, you can follow this tutorial: • How to Install & Confi...
    ==========================================
    www.buymeacoffee.com/karaminejad
    ==========================================
    Note:
    If you are using GitLab self-managed instance, You need to enable GitLab Kubernetes Agent Server (KAS) from GitLab configuration using below step.
    Add below line in /etc/gitlab/gitlab.rb file
    gitlab_kas['enable'] = true
    Restart or re-configure GitLab.
    All Files related to this Project: (1-K8S-CICD folder)
    github.com/mkaraminejad/cicd_...
    How ton install Rancher-Desktop on Windows: • How to Install & Confi...
    #kubernetes #gitlab #gitlab-runner # gitlab # build #deploy #ci cd pipeline #gitlab ci cd tutorial #gitlab tutorial #pipeline #devops ci cd pipeline

Komentáře • 96

  • @Crmzon-do1fe
    @Crmzon-do1fe Před měsícem +4

    I've been watching ALOT of devops videos for my job this week, and this is BY FAR the most hands on devops pipeline tutorial I have found. Thank you.

  • @bothorsen4292
    @bothorsen4292 Před 5 měsíci +8

    Thank you for this, it was exactly what I needed. If only the gitlab documentation was as good as this video :)

  • @raph1587
    @raph1587 Před 8 měsíci +1

    Wow! This is what I am looking for! Its so detailed and well explained! Keep the Tutorial Videos coming!

  • @hajermakina7474
    @hajermakina7474 Před 8 měsíci +5

    This is such a structured video for those who want to build a complete cicd pipeline. and explanation was really crystal clear ! you are such a gem trainer :) you have really done a fantastic job creating this video, I hope we could get more such end to end project to grind our skills !! Thank you

    • @be-devops
      @be-devops  Před 8 měsíci

      You built my day with your full energetic sentences

  • @timpomaville3080
    @timpomaville3080 Před 3 měsíci

    These videos are wonderful!

  • @amadoudiop6634
    @amadoudiop6634 Před 4 měsíci +2

    Excellent tutorial and very well explained. Thank you very much !!!

  • @MohamadMirSajadi
    @MohamadMirSajadi Před 7 měsíci +1

    it was ,nice , clear and what i was looking for . Thank you

    • @be-devops
      @be-devops  Před 7 měsíci

      Thanks for the nice comment. لطف دارید

  • @DynamiArrow
    @DynamiArrow Před 23 dny

    Best explanation of this topic that i have seen, great job

  • @AI-4-U
    @AI-4-U Před 9 měsíci +3

    You are the best teacher.
    I took so many courses, but the way you teach goes straight to my head. 🎉🎉🎉🎉

    • @be-devops
      @be-devops  Před 9 měsíci

      Thank you, today I started my day with your energetic sentence.

  • @sfarpaktech
    @sfarpaktech Před 6 měsíci

    Really helpful thanks for sharing

  • @manhnguyenitc
    @manhnguyenitc Před měsícem +1

    Thank you very much, it was exactly what I needed :)

  • @sergekomi6039
    @sergekomi6039 Před 4 měsíci +1

    great explanation very helpful thank you !!!

  • @user-mp6pq3pd9w
    @user-mp6pq3pd9w Před měsícem +1

    Thank you, very helpful.

  • @somber2075
    @somber2075 Před 4 měsíci

    Great video. It has helped me a lot

  • @lenoah8692
    @lenoah8692 Před 5 měsíci

    best teacher thanks

  • @sharukhannadagoud
    @sharukhannadagoud Před 3 měsíci

    awesome video

  • @mostafabanaei2832
    @mostafabanaei2832 Před 5 měsíci +1

    thank you for great video

  • @ahosanhabib9399
    @ahosanhabib9399 Před 3 měsíci +1

    Great teaching

  • @user-ij4hg8pi1f
    @user-ij4hg8pi1f Před 7 měsíci

    Development of skills and Wisdom and experience and learning education po

  • @ceasarpalache1045
    @ceasarpalache1045 Před měsícem +1

    Make sure your k8s-connection is in the same group as the project you're trying to deploy. If it's not, the deployment step will fail trying to set kubectl contexts.

  • @rikitikitaki5919
    @rikitikitaki5919 Před 2 měsíci +1

    Good video, but you didnt mention about runner. I think it was full cicd process if you showed installing runner

    • @be-devops
      @be-devops  Před 2 měsíci

      Thank you for your comment
      Here we more focus on CICD. But i had another video about using gitlab runner:
      czcams.com/video/6BlsKlhOhDE/video.html

    • @rikitikitaki5919
      @rikitikitaki5919 Před 2 měsíci +1

      ​@be-devops Could you explain me, please. In stage deploy, do we need to use kubernetes runner? Or it is enought that we have agent. Because when i am starting my pipeline it gives me error, that here we dont have runner to deploy. Maybe i have a mistake.

    • @be-devops
      @be-devops  Před 2 měsíci

      @@rikitikitaki5919 no need something like you say kubernetes runner. we do not have such thing.
      Only agent is ok
      you can contact me by email and send me the issue logs and we can solve it quickly

    • @be-devops
      @be-devops  Před 2 měsíci

      @@rikitikitaki5919 howtoskillsvid@gmail.com

  • @AI-4-U
    @AI-4-U Před 9 měsíci +3

    Can you please do a video on these topics.
    1. Helm charts
    2. Istio service mesh
    3. Observability with OpenTelemetry
    4. GitOps, ArgoCD

    • @be-devops
      @be-devops  Před 9 měsíci +1

      Good Ideas, sure will do

    • @neelojp8460
      @neelojp8460 Před 8 měsíci +1

      @@be-devops yes please about Helm :-)

    • @be-devops
      @be-devops  Před 8 měsíci +1

      @@neelojp8460 I am preparing it

  • @Freeline95
    @Freeline95 Před 5 měsíci

    Nice video!
    Could you give me advice by best practices.
    In your case you store k8s yaml files in your project repo. But i am developing microservices architecture and my files are storing in separated repo "infrastructure".
    How to get files from there? Git clone my private repo during the build?

    • @be-devops
      @be-devops  Před 5 měsíci

      Hi Friend,
      You can find your answer here in this video:
      czcams.com/video/OvgXuGskdCM/video.html
      I described there how to clone other repo in CICD

  • @eliaspereira777
    @eliaspereira777 Před 4 měsíci +1

    Hello, great explanation!!!
    I have a gitlab-ci.yml identical to yours, but in the build stage, I set the tags: build, only.
    The deploy is identical. When I push, the stage build completes successfully, but the stage deploy
    is waiting for a runner. I believe that with the gitlab agent, there is no need for a runner, correct?

    • @be-devops
      @be-devops  Před 4 měsíci

      yes deploy also need gitlab runner, because you are using an image to run kubectl command
      check yr deploy config. or send me by email to check it for you
      howtoskillsvid@gmail.com

  • @nikitamathur6720
    @nikitamathur6720 Před 2 měsíci +1

    Thanks for the detailed Video. Help me alot !!!
    Want to ask you that when i run 'kubectl get node -o wide' and take the internal ip of the node-cluster, i am not able to connect to my app on browser.
    I have installed docker for windows on my windows machine. Then minicube for Kubernetes. Should i install anything else.

    • @be-devops
      @be-devops  Před 2 měsíci

      Please check your firewall on windows and maybe blocked it
      but as i described I am using Rancher Desktop and really is amazing
      for its installation you can check my other video:
      czcams.com/video/I9YtRhPRMqc/video.html

  • @user-ij4hg8pi1f
    @user-ij4hg8pi1f Před 7 měsíci

    New development for skills Experience wisdom creativity and all my talents and wisdoms righteousness obedience training equipment po

  • @serokanikani
    @serokanikani Před 3 měsíci

    thanks for the tutorial, I have a problem if I update coding and push to gitlab, build image and deploy successfully.
    but it seems like the pod or service or image in microk8s is not updated
    and if I delete the service and pod first then push to gitlab, its work. my gitlab ci yaml is same with tutorial

  • @happyshoppi1036
    @happyshoppi1036 Před 4 měsíci +1

    Hi Thankyou so much for your video I have made a similar lab for testing CICD Gitlab I am facing issues whule pusing the code in gitlab container I would appreciate your help

  • @hwy9nightkid
    @hwy9nightkid Před 6 měsíci

    at about 29:26 you're showing the building of the image with a public gitlab provided runner.. is the agent also capabale of building or how should one go about supporting not just operations but build steps in our private k8s? seems I need more runner types installed?

    • @be-devops
      @be-devops  Před 6 měsíci

      Hello, I did not get your question
      would you please send me more details in my email
      howtoskillsvid@gmail.com

    • @hwy9nightkid
      @hwy9nightkid Před 5 měsíci

      I'd rather not reveal my email.. but I think I understand.. you built the docker image using gitlabs free runners... I wanted to see if you could build docker images within the k3s cluster.. but very good video thanks ! @@be-devops

    • @be-devops
      @be-devops  Před 5 měsíci

      @@hwy9nightkid Good Hint. I will check K3S and will try to do. Thanks

  • @elchinefa9524
    @elchinefa9524 Před měsícem +1

    First of all thnaks a lot for this video. I am fasinf agent connection issue. I'm using our company gitlab server and Connect a Kubernetes cluster return an error: Gitlab Failed to register an agent GRPC::Unimplemented . By the way my kubernetes running in Proxmox and it is kubeadm cluster.

    • @be-devops
      @be-devops  Před měsícem

      Please check in Kubernetes Cluster that Helm chart installed successfully and agent is running.
      you can reach me by email and we can discuses on it

    • @elchinefa9524
      @elchinefa9524 Před 28 dny

      @@be-devops Where can i find your email.

    • @be-devops
      @be-devops  Před 28 dny

      @@elchinefa9524 howtoskillsvid@gmail.com

  • @user-ij4hg8pi1f
    @user-ij4hg8pi1f Před 7 měsíci

    🙏😇

  • @user-ij4hg8pi1f
    @user-ij4hg8pi1f Před 7 měsíci

    And god po

  • @user-ow5vr5nz4r
    @user-ow5vr5nz4r Před 8 měsíci

    inmy case i have installed kubecluster in my local environment when i did the same as you presented my agent is not connecting.
    can you provide any solution for that.

    • @be-devops
      @be-devops  Před 8 měsíci

      do you have access to your kube cluster from your local machine terminal? for example if you open yr terminal and type "kubectl get node -o wide" works?
      because at first you have to be sure you cluster works well. contact me by "howtoskillsvid@gmail.com" and we can solve the issue

  • @JavierParadaHD1
    @JavierParadaHD1 Před 2 měsíci

    Teacher i have a problem, in the same group i have acces to the k8s aggent with every project without any problem, but when i need the k8s agent in another group i have'nt access, and i've already added the ci_access project and group to access it, but it doesn't work :((. I've my own self hosted gitlab and i've put as true the gitlab_kas['enable']. Help pls

  • @user-wj8qz8me2l
    @user-wj8qz8me2l Před měsícem

    Thank you ! But i have never connected status !! and i have a "Failed to register agent pod. " problem ! Can you help please !?

    • @be-devops
      @be-devops  Před měsícem +2

      Thank you for your comment.
      To make connection I would check cluster side. I suggest you when in gitlab side you create a connection, copy helm codes and past them in Cluster side.
      After please check if everything in cluster side working well:
      1) kubectl get ns
      you will see the name spaces and also the one for gitlab
      2) kubectl -n get pods
      ex:
      kubectl -n gitlab-agent-k8s-connection get pods
      the result will show you the pods should be in running status.
      If pods be in Running status but still you have no connection in gitlab, check your firewall
      You can reach me by Email.

    • @user-wj8qz8me2l
      @user-wj8qz8me2l Před měsícem

      @@be-devops Can you give me your email please ?

  • @user-ij4hg8pi1f
    @user-ij4hg8pi1f Před 7 měsíci

    Superior of all physicians group multidisciplinary plan and professionalism for all the healthcare workers po

  • @user-ij4hg8pi1f
    @user-ij4hg8pi1f Před 7 měsíci

    Sir/Dr. mark Anthony familaran po and mommy/dr.Carmela domocmat po

  • @shivendrasingh5550
    @shivendrasingh5550 Před 6 měsíci

    When the Docker image has already been built in the gitlab registry. Why do we need to push it again? Won't the image be there already?

    • @be-devops
      @be-devops  Před 6 měsíci

      When it had been built by CICD , it is located on gitlab runner and when the job done by gitlab runner it will gone because it is a container so we need to push it on gitlab repository that be useable

    • @shivendrasingh5550
      @shivendrasingh5550 Před 6 měsíci +1

      @@be-devops Thankyou for the prompt response. Please also make a video on how helm charts, gitlab-ci.yaml, Dockerfile and Docker-compose.yaml are related?
      I have seen all of them in a single project and could not understand the use of all of them.

    • @be-devops
      @be-devops  Před 6 měsíci

      @@shivendrasingh5550 check my latest video in my channel using helm chart with CICD to deploy on K8S

  • @dattran3130
    @dattran3130 Před 8 měsíci +1

    Hello ad, can you share me the repo of web in k8s-data. Very thanks you

    • @be-devops
      @be-devops  Před 8 měsíci

      I added this repo in description
      github.com/mkaraminejad/cicd_pipeline.git
      folder 1-K8S-CICD

  • @user-sz9pi9ib6y
    @user-sz9pi9ib6y Před 7 měsíci +1

    Hi bro, thanks for the video. May I know how to access the source code

    • @be-devops
      @be-devops  Před 7 měsíci

      In description there is Github repo address.
      but here you are:
      All Files related to this Project: (1-K8S-CICD folder)
      github.com/mkaraminejad/cicd_pipeline

  • @user-ij4hg8pi1f
    @user-ij4hg8pi1f Před 7 měsíci

    Physicians group multidisciplinary plan

  • @user-ij4hg8pi1f
    @user-ij4hg8pi1f Před 7 měsíci

    New cluster and projects po

  • @shashankmr2482
    @shashankmr2482 Před 2 měsíci

    You didn't mention runners there

  • @user-ij4hg8pi1f
    @user-ij4hg8pi1f Před 7 měsíci

    God and whole dragons teams po Kuya Bobby and ate Anna Po and bata Po kami ni thel Po mommy Carmela Po

  • @praveenchaudhary288
    @praveenchaudhary288 Před 7 měsíci

    getting an error occurred while loading your agents

    • @be-devops
      @be-devops  Před 7 měsíci

      your k8s cluster is in remote or local?

  • @user-ij4hg8pi1f
    @user-ij4hg8pi1f Před 7 měsíci

    Thank you god and sir mark Anthony familaran po and mommy Carmela Po box online and meetings Po 🤝🐉 Kuya Bobby and ate Anna Po nakakainis maraming thesis papers natin Po

  • @user-ij4hg8pi1f
    @user-ij4hg8pi1f Před 7 měsíci

    Sir Henry and sir Aiken and sir danni Po and madam butterfly and madam/Dr. Carolyn and madam divine and madam mercy and madam Kris amoyo po and madam grace po

  • @stream4885
    @stream4885 Před 6 měsíci +1

    Thank you for your video and presentation. after following deployment is ok and manual deployment also work, but i have this message at the end of cd/cd process. any clue why? thank you @be_devops
    .gitlab-ci.yml": error validating data: [apiVersion not set, kind not set]; if you choose to ignore these errors, turn validation off with --validate=false

    • @be-devops
      @be-devops  Před 4 měsíci

      Please share me the content of .gitlab-ci.yml by my email: howtoskillsvid@gmail.com