Installation

CloudBees CD server installation and upgrade

Overview

This option installs the CloudBees CD server, built-in database, web server, and repository server into one cluster. A local bound agent and CloudBees CD tools are also installed.

In a production configuration, connect CloudBees CD to a separate database. If CloudBees CD is initially installed with the built-in database, you can reconfigure it to use a separate database at any time. See Separate database instance for further details.

Using a separate database requires a CloudBees CD enterprise license. You must configure an external database at the same time as you install your enterprise license to prevent error messages about an unsupported configuration or a license requirement.

Installation

Create your custom values file to override Helm chart values for your installation. For your convenience, preconfigured values files are available here to get you started. Use these files as is, or use them as a starting point.

Best practice is to make a local copy of one of the preconfigured files and modify that local copy with your settings, as needed. That way, you have a record of your configuration when it comes time to update your installation.
Values file Decription

cloudbees-cd-demo.yaml

File for use with non-production installations. It configures a single node CloudBees CD server installation with a non-production license and installs MariaDB as the database.

cloudbes-cd-prod.yaml

File for use with production installations. You must configure your database, storage and CloudBees CD credentials in a local copy of this file before it can be used.

cloudbees-cd-defaults.yaml

File listing all Helm chart values along with their default value. Use as a reference when specifying additional configuration in your local values file.

Add public CloudBees repository as follows:

helm repo add cloudbees https://charts.cloudbees.com/public/cloudbees
helm repo update

Run the following Helm command to install CloudBees CD.

helm install releaseName cloudbees/cloudbees-flow \
          -f valuesFile --namespace nameSpace --timeout 10000s
helm upgrade releaseName cloudbees/cloudbees-flow \
          -f valuesFile --namespace nameSpace --timeout 10000s

where:

releaseName

A user-defined name for this particular installation. If not specified, one is generated for you.

valuesFile

The local YAML-formatted values file with your specific chart override values. Specify something like my-values.yaml. If not specified, default chart values are used, as defined in the cloudbees-example repo.

nameSpace

A user-defined name for the namespace under which CloudBees CD components are installed.

CloudBees CD installation takes several minutes. Once all the pods are running, you can track the progress of the CloudBees CD server initialization,via the flow-server-init-job job log file in the Kubernetes dashboard.

CloudBees CD agent installation and upgrade

Overview

This option installs the CloudBees CD agent, only. This allows for configuring multiple agents separately to fit your particular needs. You must have already installed the CloudBees CD server in the cluster. If you need to install the CloudBees CD server, see CloudBees CD server installation and upgrade before proceeding with the agent installation below.

Installation

Create your custom values file to override Helm chart values to use for installing the agents. For your convenience, preconfigured values files are available here to get you started. Use these files as is, or use them as a starting point.

Best practice is to make a local copy of one of the preconfigured files and modify that local copy with your settings, as needed. That way, you have a record of your configuration when it comes time to update your installation.

When multiple replicas are configured in the values file, via the replicas value, pay particular attention to the way in which the agent resource name template is defined so that all replicas are registered properly. See Agent resource name templates for complete information.
Values file Decription

cloudbees-cd-agent-example.yaml

Example file to use for an agent installation. You must configure your agent settings in a local copy of this file before it can be used.

cloudbees-cd-agent-defaults.yaml

File listing all Helm chart values along with their default value. Use as a reference when specifying additional configuration in your local values file. cloudbees-flow-agent chart configuration values for details about values in this file.

Add public CloudBees repository as follows:

helm repo add cloudbees https://charts.cloudbees.com/public/cloudbees
helm repo update

Run the following Helm command to install or upgrade.

Before initiating an install operation, you must create a namespace, as follows.

kubectl create namespace <nameSpace>

Then proceed with the installation.

helm install <agentReleaseName> cloudbees/cloudbees-flow-agent \
      -f <agentValuesFile> --namespace <nameSpace> --timeout 10000 \
      [--set-file customScript=<customScript>]

helm upgrade cloudbees/cloudbees-flow-agent \
      -f <agentValuesFile> --namespace <nameSpace> --timeout 10000 \
      [--set-file customScript=<customScript>]

where:

agentReleaseName

A user-defined name for this particular installation.

agentValuesFile

The local YAML-formatted values file with your specific chart override values. Specify something like my-values.yaml. If not specified, default chart values are used, as defined in the cloudbees-example repo.

nameSpace

A user-defined name for the namespace under which the CloudBees agent is installed. Specify the same name used for CloudBees CD server namespace.

customScript

The local file path for a user-defined script to be installed in the agent container. See Configuring third-party tools.

Configuring third-party tools

CloudBees CD agents typically do work using third-party tools installed on or accessible to the agent. In a traditional deployment, this typically means that the tools are installed locally on the agent machine. For agents running in a Kubernetes cluster, third-party tools can be deployed in agent container so they are immediately accessible by the agent. Configuration can be accomplished in one of the following ways: making a custom image or dynamically configuring the tools .

Making a custom container

For installations where the set of third-party tools is well defined and static, create your own container using the the CloudBees CD agent image as the base image to which the third-party tools are added. Below is an example Dockerfile configuring the custom container.

FROM cloudbees/cbflow-agent:9.2.0.139827_1.0.7_20191110

RUN apt-get update && \
apt-get install git apt-utils apt-transport-https wget curl gnupg gnupg2 gnupg1 -y
apt-get update && curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
       apt-key add -  && \
       echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | \
       tee -a /etc/apt/sources.list.d/kubernetes.list
curl -L https://git.io/get_helm.sh | bash

Creating a custom script

For installations needing a more flexible method, where the set of tools may vary, use the --set-file option to the helm command to load the installation script into the container using the customScript key. The example custom script below contains commands to install git, and other tools, in the pod using the apt-get package manager.

apt-get update
apt-get install git apt-utils apt-transport-https wget curl gnupg gnupg2 gnupg1 -y
apt-get update && curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
       apt-key add -  && \
       echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | \
       tee -a /etc/apt/sources.list.d/kubernetes.list
curl -L https://git.io/get_helm.sh | bash

Load Balancing with Ingress

This CloudBees CD chart provides support for load balancing with the NGINIX Ingress controller, which allows simple host and URL based HTTP routing. Note that an Ingress controller typically doesn’t eliminate the need for an external load balancer—it simply adds an additional layer of routing and control behind the load balancer. With Ingress configured, all service endpoints like web, server, and repository are exposed from the same domain name and load-balancer endpoint.

As a best practice, configure the Ingress controller so that all CloudBees CD services can be exposed through a single load balancer. By default, Ingress is enabled in the CloudBees CD chart. Following is a summary of the settings:

nginx-ingress.controller.ingressClass

Default: flow-ingress

nginx-ingress.controller.publishService.enabled

Default: true

nginx-ingress.controller.scope.enabled

Default: true

nginx-ingress.enabled

Default: true

nginx-ingress.tcp.61613

CloudBees CD server

Default: {{ .Release.Namespace }}/flow-server:61613

nginx-ingress.tcp.8200

CloudBees CD repository

Default: {{ .Release.Namespace }}/flow-repository:8200

nginx-ingress.tcp.8443

CloudBees CD web server

Default: {{ .Release.Namespace }}/flow-server:8443

nginx-ingress.tcp.9200

DevOps Insight Elasticsearch database

Default: {{ .Release.Namespace }}/flow-devopsinsight:9200

nginx-ingress.tcp.9500

DevOps Insight server

Default: {{ .Release.Namespace }}/flow-devopsinsight:9500