ibm-ucd-prod
IBM DevOps Deploy is a versatile, enterprise-level continuous delivery solution which tackles everything from mainframe to microservices. DevOps Deploy is the tool for automating application deployments through multiple environments and is designed to facilitate continuous delivery while providing the audit trails, versioning, and approvals needed in production. License By installing this product you accept the following license terms: https://ibm.biz/devops-deploy-license.
About this chart
IBM DevOps Deploy - Helm Chart
Introduction
IBM DevOps Deploy is a tool for automating application deployments through your environments. It is designed to facilitate rapid feedback and continuous delivery in agile development while providing the audit trails, versioning and approvals needed in production.
Chart Details
- This chart deploys a single server instance of IBM DevOps Deploy that may be scaled to multiple instances.
- The Persistent Volume access modes ReadWriteOnce (RWO) and ReadWriteMany (RWX) are both supported for use with IBM DevOps Deploy server. However, ReadWriteMany is required to successfully scale to more than one replica/instance of the server.
- Includes two statefulSet workload objects, one for server instances and one for distributed front end instances, and corresponding services for them.
- Support has been validated on OpenShift clusters running onPrem, in IBM Satellite, and IBM ROKS.
Prerequisites
- Kubernetes 1.19.0+/OpenShift 4.12.0+; kubectl and oc CLI; Helm 3;
- Image and Helm Chart - The DevOps Deploy server image 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 Deploy server 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. If the secret is named ibm-entitlement-key it will be used as the default pull secret, no value needs to be specified in the image.secret field. Once this secret has been created you will specify the secret name as the value for the image.secret parameter in the values.yaml you provide to 'helm install ...' Note: Secrets are namespace scoped, so they must be created in every namespace you plan to install DevOps Deploy into. Following is an example command to create an imagePullSecret named 'ibm-entitlement-key'.
oc create secret docker-registry ibm-entitlement-key --docker-username=cp --docker-password=<EntitlementKey> --docker-server=cp.icr.io
- Database - DevOps Deploy requires a database. The database may be running in your cluster or on hardware that resides outside of your cluster. This database must be configured as described in Installing the server database before installing the containerized DevOps Deploy server. The values used to connect to the database are required when installing the DevOps Deploy server.
NOTE: You have the option of automatically installing MySQL V8.0 during deployment of the DevOps Deploy server. This can be done by specifying the "database.createDatabase: true" in the values.yaml settings used during deployment. If this setting is specified, then a database will be created using the database name and database username specified in your settings. The database password will be obtained from the Kubernetes secret object that is used during deployment of the DevOps Deploy server.
- Secret - A Kubernetes Secret object must be created to store the initial DevOps Deploy server administrator password, the password used to access the database mentioned above, and the password for all keystores used by the DevOps Deploy server. The name of the secret you create must be specified in the property 'secret.name' in your values.yaml.
- Through the oc/kubectl CLI, create a Secret object in the target namespace.
oc create secret generic ucd-secrets \
--from-literal=initpassword=admin \
--from-literal=dbpassword=MyDbpassword \
--from-literal=keystorepassword=MyKeystorePassword
NOTE: If you need to change the keystorepassword after the initial server deployment, follow the instructions shown here: Changing Password For Keystore Files.
NOTE: If you do not create a Kubernetes Secret object prior to deployment, a secret will be created for you with randomized values for the passwords. The name of the secret will be
<helmReleaseName>-secretsand will be created in the namespace of the Helm release. Follow the instructions provided in the output of thehelm get notes <helmReleaseName>command to access the the contents of the auto-generated secret.
- A PersistentVolume that will hold the appdata directory for the DevOps Deploy server is required. If your cluster supports dynamic volume provisioning you will not need to manually create a PersistentVolume (PV) or PersistentVolumeClaim (PVC) before installing this chart. If your cluster does not support dynamic volume provisioning, you will need to either ensure a PV is available or you will need to create one before installing this chart. You can optionally create the PVC to bind it to a specific PV, or you can let the chart create a PVC and bind to any available PV that meets the required size and storage class. Sample YAML to create the PV and PVC are provided below.
- Ensure that the spec.persistentVolumeReclaimPolicy parameter is set to Retain on the application data persistent volume. By default, the value is Delete for dynamically created persistent volumes. Setting the value to Retain ensures that the persistent volume is not freed or deleted if its associated persistent volume claim is deleted.
apiVersion: v1
kind: PersistentVolume
metadata:
name: ucd-appdata-vol
labels:
volume: ucd-appdata-vol
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
nfs:
server: 192.168.1.17
path: /volume1/k8/ucd-appdata
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: ucd-appdata-volc
spec:
storageClassName: ""
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 20Gi
selector:
matchLabels:
volume: ucd-appdata-vol
-
The following storage options have been tested with IBM DevOps Deploy
-
IBM Block Storage supports the ReadWriteOnce access mode. ReadWriteMany is not supported.
-
IBM File Storage supports ReadWriteMany which is required for Distributed Front End(DFE).
-
-
IBM DevOps Deploy requires non-root access to persistent storage. When using IBM File Storage you need to either use one of the IBM provided “gid” file storage classes (ie. ibmc-file-gold-gid) with default group ID 65531 or create your own customized storage class to specify a different group ID. See the information at https://cloud.ibm.com/docs/containers?topic=containers-cs_storage_nonroot for more details. Once you know the correct group ID, set the persistence.fsGroup property in the values.yaml to that group ID.
- JDBC drivers - DevOps Deploy is not packaged with the required JDBC driver(s) needed to access your database instance. Multiple methods are available to add the required JDBC drivers(s) to your deployment:
-
If "fetchDriver" is set to true in values.yaml, then the latest available JDBC driver version will be automatically downloaded for you from a maven repository based on the database type that you specified. You also have the option of specifying the specific driverVersion that you wish to have downloaded if the latest version is not compatible with the database that is being used.
-
If you want to download the JDBC driver(s) from a location that you define and you are using Dynamic Volume Provisioning to create the persistent storage that DevOps Deploy requires, then you can create a Kubernetes ConfigMap resource to copy the JDBC driver(s) to your PV during the chart installation process. First write a bash script that copies the JDBC driver(s) from a location accessible from your cluster to
${UCD_HOME}/ext_lib/. Next, store the script, namedscript.sh, in a yaml file describing a ConfigMap. Finally, create the ConfigMap in your cluster by running a command such asoc create configmap <map-name> <data-source>. Below is an example ConfigMap yaml file that copies a MySQL .jar file from a web server using wget.
kind: ConfigMap
apiVersion: v1
metadata:
name: user-script
data:
script.sh: |
#!/bin/bash
echo "Running script.sh..."
if [ ! -f ${UCD_HOME}/ext_lib/mysql-jdbc.jar ] ; then
echo "Copying file(s)..."
wget -L -O mysql-jdbc.jar http://webserver-example/mysql-jdbc.jar
mv mysql-jdbc.jar ${UCD_HOME}/ext_lib/
echo "Done copying."
else
echo "File ${UCD_HOME}/ext_lib/mysql-jdbc.jar already exists."
fi
- If you statically provision the persistent storage required by DevOps Deploy server to hold the appdata directory, then you can create a "ext_lib" subdirectory in that preallocated storage and copy the required JDBC driver(s) into that location prior to installing the server.
- If a route or ingress is used to access the WSS port of the DevOps Deploy server from an DevOps Deploy agent, then port 443 should be specified along with the configured URL to access the proper service port defined for the DevOps Deploy Server.
SecurityContextConstraints Requirements
This chart requires a SecurityContextConstraints to be bound to the target namespace prior to installation. The default SecurityContextConstraints named restricted has been verified for this chart, if your target namespace is bound to this SecurityContextConstraints resource you can proceed to install the chart.
- Custom SecurityContextConstraints definition:
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
allowHostDirVolumePlugin: false
allowHostIPC: false
allowHostNetwork: false
allowHostPID: false
allowHostPorts: false
allowPrivilegeEscalation: false
allowPrivilegedContainer: false
allowedCapabilities: null
defaultAddCapabilities: null
fsGroup:
type: MustRunAs
metadata:
annotations:
kubernetes.io/description: restricted denies access to all host features and requires
pods to be run with a UID, and SELinux context that are allocated to the namespace. This
is the most restrictive SCC and it is used by default for authenticated users.
name: ucd-restricted
priority: null
readOnlyRootFilesystem: false
requiredDropCapabilities:
- ALL
runAsUser:
type: MustRunAsRange
seLinuxContext:
type: MustRunAs
supplementalGroups:
type: RunAsAny
users: []
volumes:
- configMap
- downwardAPI
- emptyDir
- persistentVolumeClaim
- projected
- secret
Licensing Requirements
The DevOps Deploy server image will attempt to upload DevOps Deploy license metrics(agent high-water mark) to the IBM Lcense service. For the upload to be successful, this chart needs IBM Licensing operator (a component of IBM Foundational/Common Services) to be installed in the Openshift cluster. Please follow these instructions to install IBM License service.
Once the IBM License service is installed, you need to copy the license service upload secret(ibm-licensing-upload-token) and configmap(ibm-licensing-upload-config) to the namespace/project the DevOps Deploy server will be installed in. Be sure that the current namespace/project is the one that DevOps Deploy will be installed into, before running the following commands.
oc get secret ibm-licensing-upload-token -n ibm-licensing -o yaml | sed 's/^.*namespace: ibm-licensing.*$//' | oc create -f -
oc get configMap ibm-licensing-upload-config -n ibm-licensing -o yaml | sed 's/^.*namespace: ibm-licensing.*$//' | oc create -f -
Once the Deploy server has started emitting license metrics to the IBM License service (this can take up to 24 hours), you can retrieve license usage data by following these instructions.
Resources Required
- 4GB of RAM, plus 4MB of RAM for each agent
- 2 CPU cores, plus 2 cores for each 500 agents
Client Data Storage Locations
All client data is stored in either the user specified database or the appdata persistent volume. DevOps Deploy does not do any active encryption of these data locations. These locations should be included in whatever backup plans the user chooses to implement.
Installing the Chart
Add the IBM helm chart repository to the local client.
$ helm repo add ibm-helm https://raw.githubusercontent.com/IBM/charts/master/repo/ibm-helm/
Get a copy of the values.yaml file from the helm chart so you can update it with values used by the install.
$ helm inspect values ibm-helm/ibm-ucd-prod > myvalues.yaml
Edit the file myvalues.yaml to specify the parameter values to use when installing the DevOps Deploy server instance. The configuration section lists the parameter values that can be set.
To install the chart into namespace 'deploytest' with the release name my-deploy-release and use the values from myvalues.yaml:
$ helm install my-deploy-release ibm-helm/ibm-ucd-prod --namespace deploytest --values myvalues.yaml
Tip: List all releases using
helm list.
Verifying the Chart
See the ins
Deploy ibm-ucd-prod with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ibm-ucd-prod 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartibm-ucd-prod is pinned at v8.0.28 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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