- December 26, 2017
- Posted by: Jakir Patel
- Category: Kubernetes
Kubernetes is the container orchestration tool used for automated scaling, deployment, and management of the containerized application. Kubernetes is currently hosted with Cloud Native Computing Foundation. In the previous blog, we explained about modern CI CD with Kubernetes and pillars required to build the pipeline. If you did not read our previous blog, then please visit this link. In this blog, we will discuss Continuous Integration with Kubernetes and how it can help us define the CI CD deployment pipeline for Kubernetes.
There are various tools available for continuous integration like Jenkins, CircleCI, Travis CI etc. Automated Continuous Integration pipeline improves code coverage, makes build process faster, decreases code review time and increases overall code quality, which will remove broken code and help identify code vulnerabilities. Once integrated in your software development lifecycle, the process is really quick and helps improve developer velocity and reduce cost for business. One should try to create separate CI pipelines for different environment’s like Development, QA, Staging and Production. You can also separate them as non-prod and prod pipelines. The main reason being the stages might be different for each environment.
Micro-services architecture allows creating small services of the application and reliable communication of these services over HTTP interface. Docker, Rkt or any other container engine can be used for creating images, which are independent atomic units of deployment. Containerization is the approach of bundling all dependencies of the application into the single container. Container images are stored in private/public container registries like JFROG or Docker Hub. The running containerized image is called a container. Container orchestration plays the very important role in launching containers, scheduling them on right node, scaling them horizontally and managing the lifecycle of the container. While, Kubernetes ensures maintaining the desired state of the cluster.
Kubernetes CI Pipeline:
Key steps to build a Continuous Integration (CI) pipeline are:
Fetching the code from the appropriate branch using SCM.
Creating images of the service (With Dockerfile)
Pushing images to private/public repository
Creating infrastructure with configuration management
Deploying, updating and rollbacking application services with Kubernetes
Apart from that other steps are code quality check, running against different testing suite, security check and vulnerability check (penetration) etc. There are open source CI tools available like Jenkins and Travis CI. Paid CI tools include Circle CI, TeamCity, GoCD, Codefresh and Codeship. One should consider few factors for choosing the right CI tool. It includes scalability, availability, builds setup requirements, Docker and Kubernetes support and community support of the CI tool. The good CI tool is to make the process easier. As continuous integration is the backbone of the Agile software development process, it is also necessary to make sure higher availability (HA) of the CI environment as shown in diagram above.
Continuous Integration (CI) pipeline setup can turn into a daunting task and it’s important to lay the foundation right. A solid foundation can save a lot of effort and cost down the line. We at codeRISE.io have helped multiple companies successfully implement CI pipelines for both small and large enterprise projects and can help you define your CI pipeline strategy, choose the right CI tool, follow best practices, industry defined patterns, security and compliance requirements and successfully implement the Continuous Integration Pipeline with Kubernetes for your product.