Today we’ll talk about the smooth integration of GitLab with Kubernetes, and unveil how to set up CI/CD pipeline within the Cloudlets hosting platform.
GitLab's ecosystem is enriched with a large number of features like:
- You can create a pipeline and control the lifecycle of your project’s deployment due to the built-in continuous integration system (CI/CD)
- It is also possible to establish a CI/CD pipeline that automatically detects, builds, tests, and deploys your projects.
Kubernetes is already integrated with GitLab within Cloudlets Platform, and enables you to get rid of integration routines required to add the K8S manually and customize such data as Proper API URL; Correct access token; Valid CA certificate; Project namespaces; Local network access, and so on.
Cloudlets platform automates all these integration actions. So let’s check how to create a project, build a pipeline and deploy java apps to Kubernetes cluster integrated with the Gitlab server right in the cloud.
How to install Kubernetes and GitLab
Sign in to the Cloudlets platform dashboard,
go to the Marketplace,
find and install DevOps Lab - GitLab Server and Kubernetes Cluster applications (in any order) one by one.
Note that the solution from this guide is available only for billing customers.
- For using a custom domain, you have to activate the Install Let’s Encrypt Certificates and Custom Domain Addon option while installing the GitLab server.
Your environment will be installed in several minutes, after you’ll receive a message with installation details (user url, login and password):
- Then install Kubernetes application using the default installation parameters or customize it due to your requirements.
In a few minutes the second environment with Kubernetes Cluster will be automatically installed in the cloud:
After these two installations are finished, their topologies will look like:
Integrate Kubernetes with GitLab
Now let’s integrate our Kubernetes environment with GitLab via "Kubernetes GitLab Integration Add-On".
1. To this, just click Add-Ons next to the Master node, find the Integration Add-On and press Configure.
2. In the open dialogue find the GitLab DevOps environment and press Apply.
3. That’s all - now your Kubernetes integration with GitLab server is ready.
To login to the GitLab dashboard just use the credentials you received in the mail about successful deployment.
Then click Admin area
And select Kubernetes in the left side menu
4. To check the integration details click on Kubernetes under the Kubernetes cluster
In such a way you can now use GitLab pipelines in order to build and deploy your projects to Kubernetes cluster.
To follow the steps from this guide just register at Cloudlets Platform and upgrade to the billing account (the platform provides double credit for all the new customers , for example if you refill your account with $50, you’ll get $50 more!).