ibm-devops-automation

by joaquinito2051

Helm chartv1.0.1App 1.0.1Apache-2.0

A Helm chart for the IBM DevOps Automation

About this chart

IBM DevOps Automation

Introduction

IBM DevOps Automation is a cloud-based continuous integration platform built on modern, cloud-native technologies that enables product teams to plan, code, test, and deploy the applications and also provides a holistic view of the progress in the DevOps cycle. Automation is built to install on IBM® Red Hat OpenShift & K8s platforms.

K8s Installation Instructions

Prerequisites

  1. An available K8s cluster.

  2. A valid public certificates issued by trusted Certificate Authorities (CAs).

  3. For installation instructions and requisite requirements, see Installation of DevOps Automation at https://www.ibm.com/docs/en/devops-automation/1.0.1?topic=guide-installation-devops-automation

  4. Image and Helm Chart - The DevOps Automation images and helm chart can be accessed via the Entitled Registry and public Helm repository.

* The public Helm chart repository can be accessed at <https://github.com/IBM/charts/tree/master/repo/ibm-helm> and directions for accessing the DevOps Automation chart will be discussed later in this README.
* Get a key to the entitled registry
  * Log in to [MyIBM Container Software Library](https://myibm.ibm.com/products-services/containerlibrary) with the IBMid and password that are associated with the entitled software.
  * In the Entitlement keys section, select Copy key to copy the entitlement key to the clipboard.
  * An imagePullSecret must be created to be able to authenticate and pull images from the Entitled Registry.  Note: Secrets are namespace scoped, so they must be created in every namespace you plan to install DevOps Automation into.  Following is an example command to create an imagePullSecret named 'ibm-entitlement-key'.

  ```bash
  kubectl create secret docker-registry ibm-entitlement-key \
    --namespace [namespace_name] \
    --docker-username=cp \
    --docker-password=<EntitlementKey> \
    --docker-server=cp.icr.io
  ```

Storage

If the cluster default StorageClass does not support the ReadWriteMany (RWX) accessMode, an alternative class must be specified using the following additional helm value: global.persistence.rwxStorageClass For example, ibmc-file-gold.

ReadWriteOnce (RWO) access mode storage can be configured with the following helm value: global.persistence.rwoStorageClass For example, ibmc-block-gold.

Licensing

DevOps Automation requires an installed IBM Rational License Key Server (RLKS). You must specify this RLKS server during installation.

See IBM Rational License Key Server documentation for more details.

Install

This installation includes locally deployed databases. This includes a sample install of MongoDB.

Before you begin, follow requisite steps and configuration at Installation of DevOps Automation: https://www.ibm.com/docs/en/devops-automation/1.0.1?topic=guide-installation-devops-automation

Fetch chart for install:

helm repo add ibm-helm https://raw.githubusercontent.com/IBM/charts/master/repo/ibm-helm --force-update
#Required 
#External fully qualified domain name the cluster
#
#See Installation of DevOps Automation documentation for more details: 
#https://www.ibm.com/docs/en/devops-automation/1.0.1?topic=guide-installation-devops-automation
DOMAIN=

#Required
#Set value to 'true' to accept the license. 
ACCEPT_LICENSE=

#Required 
#Hostname of IBM Rational license server
LICENSE_SERVER=

#Required 
#SMTP Server configuration 
EMAIL_SERVER_HOST=
EMAIL_SERVER_PORT=
EMAIL_FROM_ADDRESS=

#Optional 
#Additional SMTP Server configuration
EMAIL_SERVER_USERNAME=""
EMAIL_SERVER_PASSWORD=""
EMAIL_SERVER_STARTTLS=false
EMAIL_SERVER_SMTPS=false

#Specify the TLS secret name in your namespace as necessary. 
#
#See Installation of DevOps Automation documentation for more details: 
#https://www.ibm.com/docs/en/devops-automation/1.0.1?topic=guide-installation-devops-automation
TLS_CERT_SECRET_NAME=

#Required
#Secure seed required to generate passwords
#A random string
#Unrecoverable so keep it safe
PASSWORD_SEED=

#Alternative RWX storage class
#See Storage
#For example: ibmc-file-gold
RWX_STORAGE_CLASS=

#Alternative RWX storage class
#See Storage
#For example: ibmc-block-gold
RWO_STORAGE_CLASS=

#Required
NAMESPACE=devops-automation
HELM_NAME=devops-automation

#Optional Additional Helm options
ADDITIONAL_HELM_OPTIONS=""

run_install() { 

  if ! kubectl  get namespace ${NAMESPACE} > /dev/null 2>&1; then
    kubectl  create namespace ${NAMESPACE} || { echo "Failed to create namespace"; return 1; }
  fi


  if ! kubectl  get secret mongodb-url-secret --namespace ${NAMESPACE} > /dev/null 2>&1; then

    MONGO_CHART_VERSION="${MONGO_CHART_VERSION:-14.13.0}"
    MONGO_IMAGE_TAG="${MONGO_IMAGE_TAG:-6.0}"
    MONGO_IMAGE_REPO="${MONGO_IMAGE_REPO:-bitnami/mongodb}" 
    MONGO_HELM_RELEASE_NAME="${MONGO_HELM_RELEASE_NAME:-devops-automation-mongo}"
    MONGO_NAMESPACE="${MONGO_NAMESPACE:-${NAMESPACE}}"
    MONGO_PVC_SIZE=${MONGO_PVC_SIZE:-20Gi}
  
    helm repo add bitnami https://charts.bitnami.com/bitnami --force-update 1> /dev/null

    MONGO_INSTALL_OPTIONS="\
      --set image.repository=${MONGO_IMAGE_REPO} \
      --set image.tag=${MONGO_IMAGE_TAG} \
      --set persistence.size=${MONGO_PVC_SIZE}
    "
    
    if [ -n "${RWO_STORAGE_CLASS}" ]; then
      MONGO_INSTALL_OPTIONS="${MONGO_INSTALL_OPTIONS} --set persistence.storageClass=${RWO_STORAGE_CLASS}"
    fi
    
    if [ -n "${MONGO_ADDITIONAL_INSTALL_OPTIONS}" ]; then
      MONGO_INSTALL_OPTIONS="${MONGO_INSTALL_OPTIONS} ${MONGO_ADDITIONAL_INSTALL_OPTIONS}"
    fi

    helm upgrade --install ${MONGO_HELM_RELEASE_NAME} \
      --version ${MONGO_CHART_VERSION} \
      ${MONGO_INSTALL_OPTIONS} \
      --namespace=${MONGO_NAMESPACE} \
      --create-namespace \
      bitnami/mongodb 1> /dev/null || { echo "Failed to install MongoDB"; return 1; }
    
    MONGODB_ROOT_PASSWORD=$(kubectl  get secret --namespace ${NAMESPACE} ${MONGO_HELM_RELEASE_NAME}-mongodb -o jsonpath="{.data.mongodb-root-password}" | base64 -d)
    
    MONGO_URL="mongodb://root:${MONGODB_ROOT_PASSWORD}@${MONGO_HELM_RELEASE_NAME}-mongodb:27017/admin"

    kubectl create secret generic mongodb-url-secret --namespace ${NAMESPACE} --from-literal=password="${MONGO_URL}" 1> /dev/null || { echo "Failed to create MongoDB secret"; return 1; }
     
  fi
  
  HELM_OPTIONS="${HELM_OPTIONS:-} \
--set global.domain=${DOMAIN} \
--set-literal global.passwordSeed=${PASSWORD_SEED} \
--set global.platform.smtp.sender=${EMAIL_FROM_ADDRESS} \
--set global.platform.smtp.host=${EMAIL_SERVER_HOST} \
--set global.platform.smtp.port=${EMAIL_SERVER_PORT} \
--set global.platform.smtp.username=${EMAIL_SERVER_USERNAME} \
--set global.platform.smtp.password=${EMAIL_SERVER_PASSWORD} \
--set global.platform.smtp.startTLS=${EMAIL_SERVER_STARTTLS} \
--set global.platform.smtp.smtps=${EMAIL_SERVER_SMTPS} \
--set global.ibmCertSecretName=${TLS_CERT_SECRET_NAME} \
--set license=${ACCEPT_LICENSE}
"

  if [ -n "${LICENSE_SERVER}" ]; then
    HELM_OPTIONS="${HELM_OPTIONS} --set global.rationalLicenseKeyServer=@${LICENSE_SERVER}"
  fi

  if [ -n "${RWX_STORAGE_CLASS}" ]; then
    HELM_OPTIONS="${HELM_OPTIONS} --set global.persistence.rwxStorageClass=${RWX_STORAGE_CLASS}"
  fi

  if [ -n "${RWO_STORAGE_CLASS}" ]; then
    HELM_OPTIONS="${HELM_OPTIONS} --set global.persistence.rwoStorageClass=${RWO_STORAGE_CLASS}"
  fi

  HELM_OPTIONS="${HELM_OPTIONS} ${ADDITIONAL_HELM_OPTIONS}"

  helm upgrade --install ${HELM_NAME} ibm-helm/ibm-devops-automation --version 1.0.1 ${HELM_OPTIONS} \
    -n ${NAMESPACE} || return 1
}

run_install

Backup

See Solution Documentation for information on backup.

Uninstall

Delete the product:

NAMESPACE=devops-automation
HELM_NAME=devops-automation
helm uninstall $HELM_NAME -n $NAMESPACE

The claims and persistent volumes that contain user data are not automatically be deleted. If you re-install the product these resources will be re-used if present.

To delete EVERYTHING, including user data contained in claims and persistent volumes

NAMESPACE=devops-automation
kubectl delete namespace $NAMESPACE

Note: This will hang if the namespace contains workload which has not terminated.

Configuration

ParameterDescriptionDefault
licenseConfirmation that the EULA has been accepted. For example trueREQUIRED
global.passwordSeedThe seed used to generate all passwords.REQUIRED
global.platform.smtp.hostSMTP server hostREQUIRED
global.platform.smtp.portSMTP server port numberREQUIRED
global.rationalLicenseKeyServerWhere floating licenses are hosted to entitle use of the product. For example @ip-addressREQUIRED
global.platform.smtp.senderThe SMTP sender email address has to delivered from on-boarding processREQUIRED
global.platform.smtp.usernameSMTP server username""
global.platform.smtp.passwordSMTP server password""
global.platform.smtp.startTLSThis parameter sets the mail server to secure protocol using TLS or SSL. Accepted values are:- true to set secure protocol using TLS or SSL.- false to set unsecure protocolfalse
global.platform.smtp.smtpsThis parameter sets the mail server protocol. Accepted values are:- true to set smtps protocol.- false to set smtp protocol.false
global.persistence.rwoStorageClassThe RWO storageClass to use if the cluster default is not appropriate.''
global.persistence.rwxStorageClassThe RWX storageClass to use if the cluster default is not appropriate.''

Solution Configuration

Additional configuration for solutions is managed via helm parameters. See Solution Documentation for details.

Each helm parameter specific to a solution will be prefixed by its helm chart name.

  • Plan: ibm-devopsplan-prod
  • Test: ibm-devops-prod
  • Deploy: ibm-ucd-prod
  • Measure: ibm-ucv-prod

For example, to configure a property in the Plan solution, use the following:

--set ibm-devopsplan-prod.property=value

OpenShift Installation Instructions

Prerequisites

  1. OpenShift, OpenShift CLI (oc), and Helm 3.

  2. Image and Helm Chart - The DevOps Plan images, and helm chart can be accessed via the Entitled Registry and public Helm repository.

    • The public Helm chart repository can be accessed at https://github.com/IBM/charts/tree/master/repo/ibm-helm and directions for accessing the DevOps Plan chart will be discussed later in this README.

    • Get a key to the entitled registry

      • Log in to MyIBM Container Software Library with the IBMid and password that are associated with the entitled software.
      • In the Entitlement keys section, select Copy key to copy the entitlement key to the clipboard.
      • An imagePullSecret must be created to be able to authenticate and pull images from the Entitled Registry. Note: Secrets are namespace scoped, so they must be created in every namespace you plan to install DevOps Plan into. Following is an example command to create an imagePullSecret named 'ibm-entitlement-key'.
      oc create secret docker-registry ibm-entitlement-key \
        --namespace [namespace_name] \
        --docker-username=cp \
        --docker-password=<EntitlementKey> \
        --docker-server=cp.icr.io
      

Storage

If the cluster default StorageClass does not support the ReadWriteMany (RWX) accessMode, an alternative class must be specified using the following additional helm value: global.persistence.rwxStorageClass For example, ibmc-file-gold.

ReadWriteOnce (RWO) access mode storage can be configured with the following helm value: global.persistence.rwoStorageClass For example, ibmc-block-gold.

Licensing

DevOps Automation requires an installed IBM Rational License Key Server (RLKS). You must specify this RLKS server during installation.

See IBM Rational License Key Server documentation for more details.

Install

This installation includes locally deployed databases. This includes a sample install of MongoDB.

Before you begin, follow requisite steps and configuration at Installation of DevOps Automation: https://www.ibm.com/docs/en/devops-automation/1.0.1?topic=guide-installation-devops-automation

Fetch chart for install:

helm repo add ibm-helm https://raw.githubusercontent.com/IBM/charts/master/repo/ibm-helm --force-update
helm pull --untar ibm-helm/ibm-devops-automation --version 1.0.1
#Required 
#External fully qualified domain name the cluster
#
#Note: The default configuration inherits the default domain when you created your Openshift cluster.
#You may also choose to further customize the domain such as adding a prefix, 
#for instance devops-automation.$(oc get....), using an altnernative ingress controller, or 
#directly specifying a fully qualified associated with your cluster.
DOMAIN=$(oc get -n openshift-ingress-operator ingresscontroller default -o jsonpath='{.status.domain}')

#Required
#Set value to 'true' t

Deploy ibm-devops-automation with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ibm-devops-automation on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartibm-devops-automation is pinned at v1.0.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply