GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — project-examples/kubernetes-example at master · DevOpsLink/project-examples

Expand file tree

/

kubernetes-example

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

kubernetes-example

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
deploy
deploy
 
 
docker-app-chart
docker-app-chart
 
 
docker-app
docker-app
 
 
docker-framework
docker-framework
 
 
gradle-example
gradle-example
 
 
images
images
 
 
README.md
README.md
 
 

README.md

Outline

5 Step CI/CD In Kubernetes using Artifactory, Jenkins & Helm

Prerequisites

  • Basic knowledge of Docker, Jenkins, Kubernetes and Artifactory

Setup

  • Setup Kubernetes Cluster on GKE
  • Setup Kubernetes Cluster on AKS
  • Install Artifactory on kubernetes
  • Install Jenkins on kubernetes
  • Configure Continuous Integration/Continuous Deployment

Setup Kubernetes Cluster on GKE

Follow this to setup kubernetes cluster on GKE. https://cloud.google.com/container-engine/docs/quickstart

Setup Kubernetes Cluster on AKS

Follow this to setup kubernetes cluster on AKS. https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-deploy-cluster

Install Artifactory on kubernetes

Here is documentation to install JFrog Artifactory on kubernetes using Artifactory Helm chart

Note If you are using Artifactory SaaS you can skip this step.

Configure docker insecure registry in each node of kubernetes cluster if you are using self-signed certificate

  • Get cluster ip of nginx services by running following command:

    kubectl get services nginx-kubernetes-service
    
  • Ssh into each node of cluster and configure insecure registry using steps provided here

    Note: configure range which include $CLUSTER_IP as insecure registry.

  • Add following entry in /etc/hosts file:

    $CLUSTER_IP     docker.artifactory docker-remote.artifactory docker-local.artifactory
    
  • Pull node docker image from artifactory by running following command:

    docker pull docker.artifactory/node
    

Install Jenkins on kubernetes

Use Jenkins Helm Chart to install Jenkins in kubernetes.
Note: Make sure to set resources for Jenkins deployment in values.yaml file. Jenkins comes with the Kubernetes plugin.
Cache docker images of jenkins master and agent in Artifactory by changing value of Master.Image to docker.artifactory/jenkinsci/jenkins and Agent.Image to docker.artifactory/jenkinsci/jnlp-slave in values.yaml file.

Configuring Jenkins to build docker images

  • From Jenkins home click on Manage Jenkins -> Configure System.
  • You will see section Cloud -> Kubernetes -> Images -> Volumes.
  • Click on Add Volume and add Host Path Volume with following mount path: configure_docker
  • ssh into each kubernetes node of your cluster and perform following:
    1. Create jenkins user.
    2. Add jenkins user to docker group.
    3. Make sure jenkins user can access /var/run/docker.sock and /usr/bin/docker in each kubernetes node.
    4. Create test job in Jenkins and run docker version command from test job.

5 Step CI/CD

Step 1. Create an application war file

  • Creates a sample application called ‘webservice-1.1.2.war’
  • Pushes it to a local repository in Artifactory
  • gradle-example

Step 2. Create a template Docker image

  • Creates a base Docker image called ‘docker-framework’ using Ubuntu + Java + Tomcat
  • Pushes it to a local repository in Artifactory
  • docker-framework

Step 3. Create a product Docker image

  • Downloads, from Artifactory, the ‘webservice-1.1.2.war’ file and the ‘docker-framework’ Docker image, that were created in the previous two pipelines
  • Creates a ‘docker-app’ production Docker image
  • Pushes it to Artifactory
  • Promotes it to a production repository in Artifactory
  • docker-app

Step 4. Create Helm chart of product Docker image

  • Create helm chart of docker-app
  • Push helm chart in local helm repository in Artifactory
  • chart

Step 5. Deploy docker-app in Kubernetes cluster using helm chart

  • Pull helm chart from Virtual helm repository of Artifactory
  • Deploy docker-app in Kubernetes using downloaded helm chart
  • deploy




Benefits: For more information about the benefits of JFrog Artifactory as a Helm repository visit Artifactory's Helm Chart Repositories documentation page.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.