You are on page 1of 5

Installing CloudBees CI on modern cloud

platforms on Kubernetes
5 minute read

Credit: https://docs.cloudbees.com/docs/cloudbees-ci/latest/kubernetes-install-guide/installing-
kubernetes-using-helm

 Installing an Ingress Controller


 Installing CloudBees CI on modern cloud platforms with HTTP support
 Installing CloudBees CI on modern cloud platforms with HTTPS support
 Using self-signed certificates

Be sure that you have set up all the prerequisites before you install. The supported Helm
versions are listed in the Supported platforms page.
The following steps allow you to install CloudBees CI on modern cloud platforms with
either HTTP or HTTPS support. By default, the CloudBees CI Helm chart uses HTTP. To
use HTTPS, you must enable the TLS support and provide your TLS certificate before you
install. If the certificate that you plan to use is near expiration, CloudBees recommends
that you replace the certificate before you install CloudBees CI on modern cloud
platforms. See Replacing an expired certificate for details.
The CloudBees CI on modern cloud platforms installation requires an NGINX Ingress
Controller. If you do not already have a controller installed, you can install one when you
install CloudBees CI on modern cloud platforms.
Installing CloudBees CI on modern cloud platforms does the following:
 Uses the default values specified by CloudBees.
 Sets the OperationCenter.HostName field, if provided.
 Installs the chart with the release name cloudbees-core.
 Uses hostname cloudbees-core.example.com.
 Uses the default storage class defined in the target cluster.
CloudBees CI on modern cloud platforms uses Docker containers to run a cluster of computers within the Kube
container management system. You can optionally Verify the CloudBees CI on modern cloud platforms Docker
images to ensure their origin and authenticity.
Refer to one of the following procedures to install CloudBees CI on modern cloud
platforms:
 Installing an Ingress Controller.
 Installing CloudBees CI on modern cloud platforms with HTTP support .
 Installing CloudBees CI on modern cloud platforms with HTTPS support .
Installing an Ingress Controller
An Ingress Controller must be installed separately.
To install an NGINX Ingress Controller using Helm chart:
1. Add the NGINX Ingress Helm chart repository.
2. helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
3. Run the following commands to install the Ingress Controller:
4. helm install \
5. ingress-nginx \
6. ingress-nginx/ingress-nginx \
7. --namespace ingress-nginx \
--create-namespace
8. Once the Ingress Controller is installed, configure a DNS entry to target the
corresponding external IP or hostname.
For more information about Ingress Controllers, refer to the Kubernetes documentation.
For more information on installing NGINX Ingress Controller, refer to the NGINX Ingress
Controller Installation Guide.
Installing CloudBees CI on modern cloud platforms with
HTTP support
1. Add the CloudBees Helm chart repository as follows:
2. helm repo add cloudbees
https://public-charts.artifacts.cloudbees.com/repository/public/
helm repo update
3. Before initiating an installation, type the following commands to create a
namespace:
4. kubectl create namespace cloudbees-core
kubectl config set-context $(kubectl config current-context) --
namespace=cloudbees-core
You can obtain the full list of values using helm show values
cloudbees/cloudbees-core or from Artifact HUB.
5. Type the following commands:
Fields are case-sensitive: OperationsCenter.HostName is different than operationscenter.hostname.

6. helm install cloudbees-core \


7. cloudbees/cloudbees-core \
8. --namespace cloudbees-core \
9. --set OperationsCenter.HostName='cloudbees-
core.example.com'
In this example, the command is using the CloudBees Helm chart repository. If you
downloaded the CloudBees CI Helm chart using helm fetch,
replace cloudbees/cloudbees-core with the file name.

Adding the --namespace argument instructs Helm to install everything in the cloudbees-
core namespace. Otherwise, it uses the currently selected namespace. If you are already in
your desired namespace, this argument is not needed. Remember the
namespace must already exist.

OperationsCenter.HostName field is optional. If it is omitted, CloudBees CI uses Ingresses


using wildcard hostnames and can be accessed through any hostname.

After you have installed CloudBees CI on modern cloud platforms, 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. Add the CloudBees Helm chart repository as follows:
2. helm repo add cloudbees
https://public-charts.artifacts.cloudbees.com/repository/public/
helm repo update
3. Before initiating an installation, type the following commands to create a
namespace:
4. kubectl create namespace cloudbees-core
kubectl config set-context $(kubectl config current-context) --
namespace=cloudbees-core
You can obtain the full list of values using helm show values
cloudbees/cloudbees-core or from Artifact HUB.
5. Type the following commands to create a new Kubernetes certificate secret:
Fields are case-sensitive: OperationsCenter.HostName is different than operationscenter.hostname.

6. kubectl create secret tls cloudbees-core-example-com-tls \


7. --key /etc/letsencrypt/live/example.com/privkey.pem \
8. --cert /etc/letsencrypt/live/example.com/fullchain.pem \
9. --namespace cloudbees-core
You are creating a new TLS secret with the name cloudbees-core-example-com-tls,
which is the CloudBees CI Helm default TLS secret name. If you want to change this name,
you need to also update OperationsCenter.Ingress.tls.SecretName with your secret
name.

Use your key file.

Use your certificate. fullchain.pem should start with your certificate (-----BEGIN
CERTIFICATE-----…-----END CERTIFICATE-----), followed by any intermediate
certificates. The order is important. Each intermediate certificate should be on its own line
in the file, and also have the same header -----BEGIN CERTIFICATE-----…-----END
CERTIFICATE-----. Do not change the headers to try to comment which one is an
intermediate certificate.

The secret should be in the same namespace as the pod that will use it. You can ensure this
by using the --namespace argument. CloudBees recommends working within the
namespace.

4. Type the following commands to set


the OperationsCenter.Ingress.tls.Enable to true:
5. helm install cloudbees-core \
6. cloudbees/cloudbees-core \
7. --namespace cloudbees-core \
8. --set OperationsCenter.HostName='cloudbees-
core.example.com' \
9. --set OperationsCenter.Ingress.tls.Enable=true \
--set OperationsCenter.Ingress.tls.SecretName='cloudbees-
core-example-com-tls'
Adding the --namespace argument instructs Helm to install everything in the cloudbees-
core namespace. Otherwise, it uses the currently selected namespace. If you are already in
your desired namespace, this argument is not needed. Remember the
namespace must already exist.

OperationsCenter.HostName field is optional. To specify one, replace cloudbees-


core.example.com domain name with your domain name.

The property OperationsCenter.Ingress.tls.Enable=true enables CloudBees CI TLS


support at Ingress level.

You need to set OperationsCenter.Ingress.tls.SecretName with your secret name.

After you have installed CloudBees CI on modern cloud platforms, you should verify that
it is installed correctly.
Verifying your CloudBees CI installation

The helm status command displays the status of the CloudBees CI release. This
command is also executed after helm install and helm upgrade commands are
executed.
The helm status command displays two areas of information:
 Current CloudBees CI release
 Installation notes
helm status cloudbees-core
NAME: cloudbees-core
LAST DEPLOYED: Tue Apr 16 17:44:12 2019
NAMESPACE: cloudbees-core
STATUS: DEPLOYED
REVISION: 1
TEST SUITE: None
NOTES:
1. Once operations center 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://cloudbees-core.example.com/cjoc/

3. Sign in with the password from step 1.



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. Type the following command to retrieve your administrative user password:
kubectl exec cjoc-0 -- cat /var/jenkins_home/secrets/initialAdminPassword
2. Open a browser to http://cloudbees-core.example.com/cjoc/ .
3. Sign in with the username admin and the password you retrieved.
For more information on running CloudBees CI on Kubernetes, see the CloudBees CI on
modern cloud platforms administration guide.
Using self-signed certificates
If you need access to resources using a corporate self-signed Certificate Authority (CA),
read this article.

Pre-installation requirements

Verifying Docker images

Submit Feedback

© CloudBees, Inc. 2010 - 2024

Privacy Policy|Legal Notices|Security

You might also like