Build-Test-Deploy with Kubernetes (CI/CD)
This document will detail how you build a production-ready CI/CD infrastructure with Kubernetes with recommended CI/CD tool integrations.
What is CI/CD :
Continuous Integration :
Continuous integration is about automating the build and testing processes to ensure that the resulting software is in good condition, ideally every time a developer changes the code. CI helps development teams avoid “integration hell” where software works on individual developers’ machines, but it fails when all developers combine (or “integrate”) their code.
Continuous Delivery :
Continuous delivery goes a step further to automate software releases, which typically involves packaging software for deployment in a production-like environment. The goal of continuous delivery is to ensure that software is always ready for production, even if the team decides not to do so for business reasons.
Continuous Deployment :
Continuous deployment is a process that automatically deploys the results of continuous delivery to the final production environment, typically every time a developer changes the code (assuming all automated tests pass). By adopting both continuous integration and continuous deployment, you not only reduce risks and catch bugs quickly, but also move towards working software faster. With low-risk releases, you can quickly adapt to business needs and user needs.
This allows for greater collaboration between ops and delivery, fueling real change in your organization, and turning your release process into a business advantage.
Read Also-
Use following tech-stack to create CI/CD Pipeline.
These are all open source tools and available at 0 cost, if you have a strong use case for your CI/CD framework where you want to go with the enterprise editions for 24 hour support then you can install the enterprise editions. For enterprise edition you need to pay for each year for community support and upgrades .
Tool-Set :
- Jenkins with Blue Ocean plugin
- Maven artifactory JFROG / NEXUS
- Docker
- Jacoco / Cobertura / emma
- Sonarqube
- Anchore
- Kubernetes
- Maven
- Java: / NPM / C / PHP / JS
- Git
- Helmchart
- Velero
- Dependency Track
- Hashicorp Vault
Installation steps-kubernetes cluster .
Install with kubeadm
Use following link to setup Kubernetes cluster .
a)Setup master :
kubeadm
kubectl
kubelet
docker
b)Setup slave :
kubeadm
kubectl
kubelet
docker
Kubernetes components details :
Check link :https://kubernetes.io/docs/concepts/overview/components/
- Deployment
- Namespace
- Resource Quota
- Ingress
- Service
- Configmap
- Replicaset
- configmap
- Stateless and Stateful application deployment with PV and PVC .
- Volume Mounting with shared NFS server .
Start with Setting up production CI/CD setup :
- Deploy Jenkins server on kubernetes, you can use NFS .
- Deploy sonarqube instance on kubernetes .
- Deploy anchore engine .
- Configure multibranch pipeline settings in Jenkins .
- Jenkins configuration .
- Add required plugins .
- Config for git .
- Config for pipeline repository.
- Add kubernetes plugin and config .
- Add saml/ldap settings to handle user authentication .
- Credentials for maven , npm , docker , kubeconfig can be handled in Jenkins credentials .No of slaves as docker containers .
- Configuration for sonarqube credentials.
- Configuration for anchore credentials
- Use Pipeline feature and groovy script code with stages for multibranch pipeline integrations.
Add “Jenkinsfile” in git repository .
Hope you like this blog….
- AnchorSetup using Docker-Compose - October 18, 2024
- Devops assignment - October 17, 2024
- Deployment of vault HA using MySQL - September 18, 2024
1 thought on “Build-Test-Deploy with Kubernetes (CI/CD)”