CloudBees Core uses the default storage class to provision storage. Use this guide to assist you in setting up a network file system (NFS) as the default storage class for an elastic file system (EFS) with CloudBees Core.

Create an EFS filesystem from the AWS console

Step 1 - Configure file system access

Using the wizard configure the following according to your organization.

  • VPC

  • Availability Zones

Step 2 - Choose optional settings

  1. Choose the performance mode. It is recommended that you use General Purpose to achieve best performance with CloudBees Core.

  2. Choose the throughput mode. It is recommended that you use the following settings to achieve best performance with CloudBees Core:

    • Provisioned

    • Throughput (MiB/s) 160

Step 3 - Review and create

It is recommended that you choose the Create File System setting for CloudBees Core.

Configure NFS as your desired storage for Kubernetes

Refer to these Kubernetes NFS-Client Provisioner instructions to configure NFS as your desired storage for Kubernetes.

Configure NFS storageclass in cloudbees-core.yml

There are two sections in the yaml file that will need to be updated to define the nfs storageClass in the example below, where the storage class name is defined as nfs1

Edit the cloudbees-core.yml file and modify the section cjoc StatefulSet resource definition

Add the following to this section to define the storage class used by CloudBees Core Operations Center and masters.

-Dcom.cloudbees.masterprovisioning.kubernetes.KubernetesMasterProvisioning.storageClassName=nfs1
value: >-
  -XshowSettings:vm
  -XX:MaxRAM=${MEM_LIMIT}m
  -XX:MaxRAMFraction=1
  -XX:+PrintGCDetails
  -Dcb.IMProp.warProfiles=kubernetes.json
  -Dcb.IMProp.warProfiles.cje=kubernetes.json
  -Dcom.cloudbees.opscenter.analytics.reporter.JocAnalyticsReporter.PERIOD=120
  -Dcom.cloudbees.opscenter.analytics.reporter.metrics.AperiodicMetricSubmitter.PERIOD=120
  -Dcom.cloudbees.opscenter.analytics.FeederConfiguration.PERIOD=120
  -Dcom.cloudbees.masterprovisioning.kubernetes.KubernetesMasterProvisioning.fsGroup=1000
  -Dhudson.lifecycle=hudson.lifecycle.ExitLifecycle
  -Dcom.cloudbees.jce.masterprovisioning.DockerImageDefinitionConfiguration.disableAutoConfiguration=true
  -Dcom.cloudbees.jce.masterprovisioning.DockerImageDefinitionConfiguration.masterImageName="CloudBees Core - Managed Master 2.121.3.1"
  -Dcom.cloudbees.jce.masterprovisioning.DockerImageDefinitionConfiguration.masterImage=docker.cloudbees.com/unified-distribution/core-mm:2.121.3.1

Update the section defined as volumeClaimTemplates as well and set the storageClassName

volumeClaimTemplates:
  - metadata:
      name: jenkins-home
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 20Gi
      storageClassName: nfs1

Once the modifications have been made to utilize nfs as the storageClass, deploy CloudBees Core to your Kubernetes Cluster

kubectl apply -f cloudbees-core.yml