Link Search Menu Expand Document

Integration with CI/CD

One of the cornerstones of Cloud Native applications is the ability to deliver features as soon as posible to our customers. For this to become a reality we tend to rely on CI/CD pipelines that create the link between the coding stage and the deployment of a tested application. In this type of scenarios, the developer will make the changes in the codebase and submit those as part of a pull/merge request. That pull/merge request will be evaluated by other team members for correctness, and will be also analyzed by a CI/CD pipeline.

This pipeline includes stages such as compiling the code, performing unit tests, running linters, executing integration and end-to-end test, etc. Once all required tests have passed, and the request is approved, another pipeline is triggered. This new CD pipeline is usually involved in creating and publishing the container images, rendering the YAML files required to deploy a component, and either publishing the results to another repository for a GitOps approach, or pushing the changes to a target Kubernetes cluster.

The NAPPTIVE Playground provides a method to easily get on-demand Kubernetes namespaces that can be used for many of the CI/CD use cases, from integration testing to deployment of the newly released application. To illustrate how to accomplish this with the Playground, we have create a demo project to showcase how CI/CD system such as GitHub Action can be used in conjunction with NAPPTIVE to deploy an application.

CI/CD Workflow

The project considers an scenario where a repository (i.e., cd-example) has a set of associated GitHub Actions that are automatically triggered whenever a new merge is perfomed on the master branch of the repository. The action will trigger a script that is able to communicate with the NAPPTIVE Playground, obtain information about the deployed application, and proceed to either create or update the running application.

This project showcases the use of Personal Access Tokens to enable authentication from a script, and the interaction with the playground using the CLI and the standard kubectl tool.

Want to try it out?

Follow the instructions on the CD demo project, fork it, and discover how CI/CD pipelines can easily leverage systems such as the NAPPTIVE Playground.

What’s next