How to Build and Deploy an app Helm Chart on Kubernetes Cluster with GitLab CI/CD
ฝัง
- เผยแพร่เมื่อ 4 ก.ค. 2024
- In this comprehensive tutorial, dive into the intricacies of deploying Helm Charts on a Kubernetes cluster using the power of GitLab CI/CD pipelines. Learn step-by-step how to automate and streamline your application deployment process, leveraging the seamless integration between Helm and GitLab. From setting up your CI/CD pipeline to understanding Helm Charts and their deployment nuances, this video will equip you with the knowledge and skills to efficiently manage and scale your applications in a Kubernetes environment. Join us on this journey to mastering Helm and GitLab CI/CD for a more efficient and robust deployment workflow. Elevate your DevOps game and ensure smoother releases with this in-depth guide.
www.buymeacoffee.com/karaminejad
Resource files for this project on my github:
github.com/mkaraminejad/cicd_...
00:00:00 Pre-Introduction
00:00:56 Introduction
00:02:55 Scenario description
00:04:25 Lab Requirements
00:06:00 Install Gitlab agent on K8S
00:13:05 Test Agent connection to K8S
00:18:18 Prepare App Image
00:27:00 Push App Image to Gitlab Image Registry by CICD
00:34:20 Create Helm chart
00:38:06 Install Helm Chart on K8S Manually
00:40:11 Publish Helm chart to helm Repo Manually
00:45:15 Create, Publish and deploy Helm Chart to K8S by CICD
01:00:22 Uninstall Helm Chart by CICD
Hi Malek, thank you for your lessons. You have a super didactic, and you don't edit the video in the errors, you face all the steps.
You deserve much more than 5 coffees.
Thank you so much
Great Tutorial - with some hints from the comments and some research its now working and should be a good base for bigger projects... 👍👊🙂
Thanks
excellent! thank you
Great video, THANK YOU!
Thank you
you could use helm show chart to extract the chart data :)
I did same setup I have created seperate repo for the girlab-agent to k8s cluster and when I try to run the pipeline agent will connect to the cluster and I'm getting kubect pods details
But when I created pipeline and in another repo I'm not able to connect cluster?
What when I have more repositories(each for one microservice)? Do I have to configure gitlab agent on k8s for each of them? I created 2 repositories, first one k8s-gitlab-connection where Kubernetes cluster is configured in Gitlab and agent was installed on k8s cluster. There is connection, it works. But I have an another repository microservice-1-repository, when I configured the pipeline I'm getting "error: no context exists with the name: xxx" for this command "kubectl config use-context: xxx". I guess this happeing because I don't have Kubernetes cluster integration for this specific project. But I don't want to do it for each repository...
I found an answer, I changed config.yaml by adding
ci_access:
# This agent is accessible from CI jobs in projects in these groups
groups:
- id: gitlab/repository/group
then all my miscroservices can see k8s connections!
great content! thx!!!!
Great Video. Looking to see if an application like JIRA has a license key when launching it. How can the license key be added into the values.yaml file?
Thank you so much, this was the answer on my last question 🙂your explanations are consistently excellent, always making complex topics easy to understand...So if I make any changes to the deployments.yaml I have to push that again to the registry or not? if i want to update the YAML files inside the template folder... that would be also helpful if we know that... thanks again
Thank you
Great Video Sir! Can you please share how to install the runner as well! As it is not included in the video! Thank You! :)
Hello Rohan
I have a Video about it: th-cam.com/video/6BlsKlhOhDE/w-d-xo.html
Really nice presentation.
Do you mind sharing your git? It would be so useful.
Thank you
Great video! I am stuck at one part. It's probably obvious, but the secret file is a dockerconfigjson type. The .dockerconfigjson base64 string returns an illage base64 data input. Do we need to create our own json file for gitlab or docker here? @38:45
For secret that uses dockerconfigjson, you can just once type in your terminal:
docker login registry.gitlab.com
then ask you username and password and will show you login success.
so now if you check :
ls ".docker/config.json " it will show you the config.json file is there with the following content:
{
"auths": {
"registry.gitlab.com": {}
},
"credsStore": "wincred.exe"
}
so for create secret you can use this config.json file like below:
kubectl create secret docker-registry my-secret --from-file=.dockerconfigjson=config.json --dry-run=client -o yaml > secret.yaml
also you can reach me by email to discuss about it: howtoskillsvid@gmail.com
Thank you so much. I tried to implement the same usecase. However, it is only working when configuring my container registry, helm chart registry, kubernetes connection operator in one Gitlab project. If I split, I am getting "error: no context exists with the name:". Not sure how you managed to make it work in three different project. Appreciate your help in this case.
Thank you so much for your consideration:
1- create 1st repo for connection between your gitlab and K8s and also test it via CI/CD
2- Create 2ed repo for your Data/Helm chart, etc. Then allow it access to Tunnel between 1st repo and k8s by allowing it in config.yaml
EX:
ci_access:
projects:
- id: d6245/helm_project
You can reach me out by email:
howtoskillsvid@gmail.com
Thank you for the the video and for the great content. I am getting an error when deploying the app manually on my k8s cluster. my pod status is "ErrImagePull". Do I need to use another image besides the one I deployed in the gitlab container registry?
When you get "ErrImagePull", you have to check the logs ok K8s. please type:
#kubectl describe pod
and see why you get this error.
if it is related to authentication do:
#docker login registry.gitlab.com
Then ask enter username and token. if login successful try to manually create your pod and in this time should be OK
hi, have you a repo for this demo ? regards
github.com/mkaraminejad/cicd_pipeline