Installing CloudBees CI on modern cloud platforms on EKS

3 minute read

The following steps describe a public setup using HTTPS with a domain name.

Prerequisites

These prerequisites require access to AWS with administrative privileges as they involve IAM work.

  1. Follow the steps from AWS Load Balancer Controller to install the AWS Load Balancer controller in the EKS cluster.

  2. Create a certificate in AWS Certificate Manager for the required domain name.

Installing CloudBees CI on modern cloud platforms on EKS

These steps require access to the EKS cluster.

A known issue has changed the behavior of the OperationsCenter.HostName value. Until the issue is resolved, you must either configure a hostname or change the system properties when you install CloudBees CI on modern cloud platforms. You can configure the hostname using OperationsCenter.Hostname in the values.yaml file or from the Helm command line. 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 required system properties:

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

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

  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.

  1. Add the CloudBees Helm chart repository as follows:

    helm repo add cloudbees https://charts.cloudbees.com/public/cloudbees
    helm repo update
  2. Before initiating an installation, type the following command to create a namespace:

    kubectl create namespace cloudbees-core

    Then proceed with the installation.

  3. Create a file named values.yaml with the following content.

    OperationsCenter:
      HostName: cloudbees-core.example.com (1)
      Protocol: https (2)
      Platform: eks
      Ingress:
        Class: alb
        Annotations:
          alb.ingress.kubernetes.io/scheme: internet-facing (3)
    1Replace cloudbees-core.example.com with your domain name.
    2Remove to use http
    3Can be omitted in order to use an internal load balancer.

    Refer to the full list of annotations if more details are needed.

  4. Perform the installation.

    helm upgrade --install cloudbees-core \
                   cloudbees/cloudbees-core \
                   --namespace cloudbees-core \
                   -f values.yaml

Creating a DNS record

Look up the ALB host name using the following command

kubectl --namespace cloudbees-core get ingress cjoc -o go-template='{{ range .status.loadBalancer.ingress }}{{ .hostname}}{{"\n"}}{{end}}'

This should return something like k8s-cloudbees-aabbccddee-1234567890.<region>.elb.amazonaws.com. Create a CNAME (or an alias in route 53) DNS record targeting this name in order to access the CloudBees CI on modern cloud platforms deployment.

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.