Enable DevOps System

Edit

What is KubeSphere DevOps System

KubeSphere DevOps System is designed for CI/CD workflow in Kubernetes. It is based on Jenkins and provides one-stop DevOps console helping developers and maintainers build, test and publish their applications to Kubernetes in a straight-forward way. It also supports plugins management, Binary-to-Image (B2I), Source-to-Image (S2I), code dependency caching, code quality analysis and pipeline logging, etc.

The DevOps system combines application development and automatic publishing on the same platform, also supports to connect with third-party private image registry (e.g. Harbor) and code repositories (e.g. GitLab/GitHub/SVN/BitBucket) to visually construct a complete CI/CD pipeline which is usually useful for air gapped environment.

In KubeSphere v2.1, there are rich features within DevOps system:

  • Binary to Image: Automatically pack your artifact such as WAR, JAR, Binary executables into Docker without writing Dockerfile and push to image repository, and finally deploy the image into Kubernetes cluster.
  • Source to Image: Automatically compile and build your source code from code repository and pack the result into Docker without writing Dockerfile, push to image repository and finally deploy the image into Kubernetes cluster.
  • Jenkinsfile-free CI/CD pipeline with graphical editing panel: Without writing Jenkinsfile, you can compose pipeline using graphical editing panel which makes the user experience much better that other solutions.
  • Jenkinsfile-based CI/CD pipeline: If your code repository already has Jenkinsfile, you’d better to use this way to create pipeline.
  • GitLab and Harbor based CI/CD pipeline:Using on-premise GitLab and Harbor to create pipeline, which is useful for air gapped environment.

Enable DevOps System before Installation

KubeSphere DevOps system requires at least 34m of CPU request and 2.69G of memory request for all-in-one installation, or at least 0.47 core of CPU request and 8.6G of memory request for multi-node installation. Please make sure your cluster has enough resource.

Note: This document is for installing KubeSphere on Linux machines. If you want to install KubeSphere and DevOps system on your existing Kubernetes cluster, please see ks-installer.

Before starting the installation, you can change the values of devops_enabled and sonarqube_enabled in conf/common.yaml from false to true to enable DevOps system and SonarQube, then you can continue your installation by following the instructions of All-in-One or Multi-Node.

  1. #DevOps Configuration
  2. devops_enabled: true
  3. jenkins_memory_lim: 8Gi
  4. jenkins_memory_req: 4Gi
  5. jenkins_volume_size: 8Gi
  6. jenkinsJavaOpts_Xms: 3g
  7. jenkinsJavaOpts_Xmx: 6g
  8. jenkinsJavaOpts_MaxRAM: 8g
  9. sonarqube_enabled: true
  10. #sonar_server_url: SHOULD_BE_REPLACED # Supports connect with external SonarQube if you have, you can replace in these two fields.
  11. #sonar_server_token: SHOULD_BE_REPLACED

Enable DevOps System after Installation

If you already have a minimal KubeSphere setup, you still can edit the ConfigMap of ks-installer using the following command.

  1. kubectl edit cm -n kubesphere-system ks-installer

Then set devops from False to True.

  1. devops:
  2. enabled: True
  3. jenkinsMemoryLim: 2Gi
  4. jenkinsMemoryReq: 1500Mi
  5. jenkinsVolumeSize: 8Gi
  6. jenkinsJavaOpts_Xms: 512m
  7. jenkinsJavaOpts_Xmx: 512m
  8. jenkinsJavaOpts_MaxRAM: 2g
  9. sonarqube:
  10. enabled: True

Save it and exit. DevOps component will be installed automatically. You can inspect the logs of ks-installer Pod to verify the installation status, and wait for the successful result logs output.