Sei sulla pagina 1di 7

CICD for API’s on AKS using Jenkins Job:

Tools: Jenkins, Docker, Azure Container Registry, Azure Kubernetes Services, Azure API Management
Service

Architecture:

High Level Procedure:

1. Code push to repository (DEV/QA/PROD) per deployment environment


2. Creation of Jenkins Jobs per deployment environment
3. Jenkins job pull the code from the respective repository
4. Building & Tagging of a Docker image out of the code
5. Pushing the Docker image to the Azure container registry
6. Deploying the Docker image from ACR to Azure Kubernetes cluster
7. Extracting Swagger files from AKS
8. Infusing Swagger files to API Management service for consumption from the Internet
Steps:

1. Login to the Jenkins URL : http://10.40.133.5:8080/ with proper credentials.

2. Select “APIpipeline” Job Click on “Build with Parameters” and name the API that needs to be
built. Click on “Build” to proceed with the Deployment. Note, that the name mentioned is the
one with which the project is checked-in to the Repository.
3. You’ll be able to see the updates pulled for that Build request at the completion of the Build.

4. Click on Console Output to check the IP for the API that was built to get access to the Swagger
file of that API.
5. Access the given URL in this format http://10.40.140.4:32629/swagger-ui.html

6. Swagger file should be extracted from this end-point of the same URL
http://10.40.140.4:32629/v2/api-docs
7. This Swagger file then needs to be infused into the APIM. You should logon to the Azure account
and traverse to the APIM resource provisioned. Select “OpenAPI Specification”

8. Here-in browse to the saved Swagger file in json format “awards.json” . Once that is loaded
some columns would be pre-filled with the values.
Others namely “API URL suffix” needs to be filled-in for differentiating within the larger set of
API’s, “Products” should be changed to “unlimited” for keeping it accessible.

9. Once, “Create” is clicked. Traverse to the API that was created “Awards” in this case. You’ll be
able to see metadata of that API in the “Design” tab of it.

10. In the Test Tab you can actually test the API by adding a “Authorization” header and the Bearer
Token in association to it. Fill in the Request Body with required parameters. And you are ready
to test your exposed URL from a POSTMAN client.
Above is the process that is followed for end-to-end CICD process for API for Contest Bonus
application.

Potrebbero piacerti anche