Installing CloudBees CI on modern cloud platforms on OpenShift

4 minute read

Make sure to review the OpenShift pre-installation requirements before you install CloudBees CI on modern cloud platforms. The supported Helm versions are listed in the Supported platforms page.

Typically, controllers are provisioned using a full context path such as http://acme.com/controller1 and you access the operations center using a URL like http://acme.com/cjoc, for example. However, because you cannot register more than one URL using the same domain in OpenShift, it is not possible to deploy multiple controllers using the same domain, for example, http://acme.com/controller1 and http://acme.com/controller2.

Therefore, for OpenShift CloudBees CI deployments, you can optionally configure subdomains to access controllers and the operations center. When you install CloudBees CI using the Helm chart, if you set the Subdomain attribute to true, you configure CloudBees CI to use a subdomain instead of the typical full context path. So, for example, you can access the operations center using http://cjoc.acme and the controllers using http://controller1.acme.com and http://controller2.acme.com.

The following steps allow you to install CloudBees CI with either HTTP or HTTPS support.

Installing CloudBees CI with HTTP or HTTPS support does the following:

  • Sets the OperationsCenter.HostName and optionally the OperationsCenter.Name (the default value is cjoc) fields.

  • Installs the Helm chart with the release name cloudbees-core and hostname cloudbees-core.example.com.

  • Deploys cloudbees-core on the OpenShift cluster in the default configuration.

The OperationsCenter.HostName field is optional. However, a known issue has changed its behavior so that the installation fails unless you provide one. Until the issue is resolved, you must either configure a hostname during the installation, or change settings in the system properties before you attempt the installation. If necessary, you can use a tool like nip.io or xip.io to create a hostname from an IP address.

If you do not want to specify a hostname, you must configure the following system properties before you attempt the installation:

  1. Set com.cloudbees.network.useSubdomain to false.

  2. Configure com.cloudbees.networkingprotocol to use http or https, depending on your installation preferences.

  3. Make sure that CloudBees CI can reach the Jenkins hostname you enter for com.cloudbees.networking.hostname.

  4. Enter the port that the operations center runs on in com.cloudbees.networking.port.

Refer to one of the following procedures to install CloudBees CI on modern cloud platforms:

Installing CloudBees CI on modern cloud platforms with HTTP support

To install CloudBees CI on modern cloud platforms with HTTP support:

  1. Type the following commands:

    Fields are case-sensitve: OperationsCenter.HostName is different than operationcenter.hostname.
    $ helm install cloudbees-core \ (1) (2)
                   cloudbees/cloudbees-core \ (3)
                   --set OperationsCenter.HostName='{domain-name}' \ (4)
                   --set OperationsCenter.Project.name="myproject" (5)
    1If you copy this command into your terminal don’t forget to remove the annotations at the end of each line.
    2The name isn’t required, but without it Helm will automatically generate a release name with random strings. For this reason, CloudBees recommends always set a release name.
    3In this example, the command is using the CloudBees Helm chart Repository.
    4OperationsCenter.HostName field is required. The CloudBees CI Helm chart will not install without a HostName being provided.
    5OperationsCenter.Project.name is the OpenShift project.

After you have installed CloudBees CI, you should verify that it is installed correctly.

Installing CloudBees CI on modern cloud platforms with HTTPS support

To install CloudBees CI on modern cloud platforms with HTTPS support:

  1. First, create a new OpenShift TLS certificate secret. For instructions, see the Secrets chapter of the Red Hat OpenShift documentation.

  2. Once an OpenShift certificate secret has been created, you can use the Helm chart to install CloudBees CI with SSL\TLS support by setting OperationsCenter.Ingress.tls.Enable to true.

  3. Type the following commands:

    Fields are case-sensitve: OperationsCenter.HostName is different than operationcenter.hostname.
    $ helm install cloudbees-core \
                   cloudbees/cloudbees-core \
                   --set OperationsCenter.HostName='{domain-name}'
                   --set OperationsCenter.Route.tls.Enable=true \ (1)
                   --set OperationsCenter.Project.name="myproject" \ (2)
    1Here, you are setting OperationsCenter.Route.tls.Enable to true. This property turns on CloudBees CI HTTPS support.
    2OperationsCenter.Project.name is the OpenShift project.

After you have installed CloudBees CI, you should verify that it is installed correctly.

Verifying the installation using helm status

Once the CloudBees CI install is initiated, Helm displays the status of the release.

The helm status command displays the status of the CloudBees CI release. This command is also executed after helm install and helm update commands are executed.

The helm status command displays three areas of information:

  • Current CloudBees CI Release

  • Kubernetes Resources

  • Release Notes

$ helm status
NAME:   cloudbees-core (1)
LAST DEPLOYED: Tue Apr 16 17:44:12 2019 (1)
NAMESPACE: default (1)
STATUS: DEPLOYED (1)
REVISION: 1
TEST SUITE: None
NOTES:
1. Once {OC} is up and running, get your initial admin user password by running:
  kubectl rollout status sts cjoc --namespace cloudbees-core
  kubectl exec cjoc-0 --namespace cloudbees-core -- cat /var/jenkins_home/secrets/initialAdminPassword
2. Visit https://acme.example.com/cjoc/

3. Login with the password from step 1.

For more information on running {CI-CLOUD}, visit:
xref:cloudbees-ci:ROOT:index.adoc[CloudBees CI]
1The first block provides a summary of the CloudBees CI release including:
  • Name of the release

  • The time released

  • The status of the release and

  • The namespace the release is installed in.

Signing in to your CloudBees CI installation

Now that you’ve installed CloudBees CI and operations center, you’ll want to see your system in action.

  1. Retrieve your administrative user password with the oc command:

    $ oc exec cjoc-0 -- cat /var/jenkins_home/secrets/initialAdminPassword
  2. Open a browser client and navigate to http://cloudbees-core.example.com/cjoc/.

  3. Sign in with the username admin and the password you retrieved.

If you use the OpenShift Jenkins plugin, you can now configure it to work with CloudBees CI on modern cloud platforms. Refer to Red Hat’s OpenShift Jenkins plugin documentation for more information.