ibm-ucdr-prod
IBM DevOps Deploy agent relay License By installing this product you accept the terms https://ibm.biz/devops-deploy-license.
About this chart
DevOps Deploy Agent Relay - Helm Chart
Introduction
DevOps Deploy Agent Relay 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 instance of the IBM DevOps Deploy agent relay 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 agent relay. However, ReadWriteMany is required to successfully scale to more than one replica/instance of the agent relay.
- Includes a StatefulSet workload object
- Support has been validated on OpenShift clusters running onPrem, in IBM Satellite, and IBM ROKS.
Prerequisites
- Kubernetes 1.19.0+/OpenShift 4.6.0+; kubectl and oc CLI; Helm 3;
-
Accessing the container Image - The DevOps Deploy agent relay image is accessed via the IBM 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 that secrets are namespace scoped, so they must be created in every namespace you plan to install DevOps Deploy agent relay 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
-
The DevOps Deploy agent relay must have a DevOps Deploy server to connect to.
-
Secret - A Kubernetes Secret object must be created to store the DevOps Deploy server's Codestation authentication token and the password for all keystores used by the product. 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=cspassword=255b21b7-ca48-4f2e-95c0-048fdbff4197 \
--from-literal=keystorepassword=MyKeystorePassword
NOTE: If you need to change the keystorepassword after the initial agent relay deployment, follow the instructions shown here: Changing Password For Keystore File.
- A PersistentVolume that will hold the conf directory for the DevOps Deploy relay is required. If your cluster supports dynamic volume provisioning you will not need to 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 conf directory 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: ucdr-conf-vol
labels:
volume: ucdr-conf-vol
spec:
capacity:
storage: 10Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
nfs:
server: 192.168.1.17
path: /volume1/k8/ucdr-conf
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: ucdr-conf-volc
spec:
storageClassName: ""
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 10Mi
selector:
matchLabels:
volume: ucdr-conf-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 multiple instances of the DevOps Deploy agent.
-
-
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.
- If a route or ingress is used to access the WSS port of the DevOps Deploy server from an DevOps Deploy relay, 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
Resources Required
- 200MB of RAM
- 100 millicores CPU
Client Data Storage Locations
All client data is stored in the conf persistent volume. DevOps Deploy does not do any active encryption of this data location. This location 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-ucdr-prod > myvalues.yaml
Edit the file myvalues.yaml to specify the parameter values to use when installing the DevOps Deploy agent relay instance. The configuration section lists the parameter values that can be set.
To install the chart into namespace 'ucdtest' with the release name my-ucdr-release and use the values from myvalues.yaml:
$ helm install my-ucdr-release ibm-helm/ibm-ucdr-prod --namespace ucdtest --values myvalues.yaml
Tip: List all releases using
helm list.
Verifying the Chart
Check the Resources->Agent Relays page of the DevOps Deploy server UI to verify the agent relay has connected successfully.
Upgrading the Chart
Check here for information about ugrading the chart.
Uninstalling the Chart
To uninstall/delete the my-ucdr-release deployment:
$ helm delete my-ucdr-release
The command removes all the Kubernetes components associated with the chart and deletes the release.
Changing Password For Keystore File
To change the password used by the DevOps Deploy Agent Relay keystore file, follow these steps:
-
Scale the statefulset resource to 0 to shutdown the DevOps Deploy Agent Relay.
-
Update the Kubernetes secret used to define the agent relay passwords to set the keystorepassword to the new value.
-
IMPORTANT: Update the Kubernetes secret used to define the agent relay passwords to set the previouskeystorepassword to the existing keystore password being used.
-
Scale the statefulset resource to 1 to restart the DevOps Deploy Agent Relay.
-
When the Agent Relay is restarted, the keystore passwords will be updated to the new value during pod initialization.
Disaster Recovery
Backup product data and essential Kubernetes resources so that you can recover your DevOps Deploy relay instance after a disaster.
Backup Kubernetes Resources
Backup the Kubernetes resoures required to redeploy the DevOps Deploy relay after a disaster. Follow these steps to save the configuration of essential Kubernetes resources.
- Save Helm values Run the following command to save a local copy of the Helm values file
helm get values <Helm-release-name> --namespace <ucd_namespace> --all >savedHelmValues.yaml
- Save secret containing DevOps Deploy relay keystore passwords Find the value for the Values.secret.name property in the saved Helm values file above. This is the name of the secret we want to save a local copy of. Run the following command, replacing ucdsecrets_name with the value from the values.secret.name property.
oc get secret <ucdsecrets_name> -n <ucd_namespace> -o yaml > <ucdsecrets_name>.yaml
- Save image pull secret Find the value for the Values.image.secret property in the saved Helm values file above. This is the name of the secret used to pull images from the IBM Entitled Registry. Run the following command, replacing ibm-entitlement-key with the value from the Values.image.secret property.
oc get secret <ibm-entitlement-key> -n <ucd_namespace> -o yaml > <ibm-entitlement-key>.yaml
Backup Product Data
Backup the conf directory used by the DevOps Deploy server. To ensure the most accurate saving of data, no deployments should be active. Follow these steps to take a backup of the relay.
- Scale the statefulset resource to 0 to shutdown the DevOps Deploy relay.
- Backup the conf Persistent Volume.
- Scale the statefulset resource to 1 to restart the DevOps Deploy relay.
Recover from a disaster
If you have successfully backed up the resources and data as described in Backup Kubernetes Resources and Backup Product Data you can recreate an instance of DevOps Deploy relay using that data. Follow these steps to recreate your DevOps Deploy relay instance.
- Create a new project/namespace to hold the Kubernetes resources associated with the DevOps Deploy relay instance.
- Create the Kubernetes secret that contains the DevOps Deploy relay keystore password by running the following command.
oc apply -n <ucd_namespace> -f <ucdsecrets_name>.yaml
- Create the image pull secret needed to access images in the IBM Entitled Registry by running the following command.
oc apply -n <ucd_namespace> -f <ibm-entitlement-key>.yaml
- Create the conf Persistent Volume and associated Persistent Volume Claim and load the saved conf directory contents into the Persistent Volume.
- Create a values.yaml file that contains the properties and values from your savedHelmValues.yaml file. Be sure that the Values.confVolume.existingClaimName field is set to the Persistent Volume Claim for the new conf Persistent Volume.
- Create the new DevOps Deploy relay instance by running the following command.
helm install my-recovered-release ibm-helm/ibm-ucdr-prod --namespace <ucd_namespace> --values myRecoveredValues.yaml
Configuration
Parameters
The Helm chart has the following values.
Common Parameters
| Qualifier | Parameter | Definition | Allowed Value |
|---|---|---|---|
| version | DevOps Deploy relay product vesion | Defaults to latest product version | |
| replicas | relay | Number of DevOps Deploy relay replicas | Non-zero number of replicas. Defaults to 1 |
| image | pullPolicy | Image Pull Policy | Always, Never, or IfNotPresent. Defaults to IfNotPresent |
| secret | An image pull secret used to authenticate with the image registry | If no value is specified we will look for a pull secret named ibm-entitlement-key. | |
| license | accept | Set to true to indicate you have read and agree to license agreements : https://ibm.biz/devops-deploy-license | false |
| statefulset | annotations | Annotations for statefulset | Default value is "" |
| topologySpreadConstraints.enabled | Determines if topologySpreadConstraints are defined for |
Deploy ibm-ucdr-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-ucdr-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-ucdr-prod is pinned at v3.3.35 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