ibm-devops-prod
DevOps Test Hub - Speed innovation with continuous testing Documentation For additional details regarding install parameters check https://github.com/IBM/charts/blob/master/repo/ibm-helm/ibm-devops-prod.md License By installing this product you accept the terms http://ibm.biz/rtas-license.
About this chart
IBM DevOps Test Hub
IBM DevOps Test Hub brings together test data, test environments, and test runs and reports into a single, web-based browser for testers and non-testers. It is Kubernetes native and hence requires a cluster to run. If you do not have a cluster available we enable you to get started by providing scripts to provision a basic environment using K3s.
Prerequisites
Resources Required
- RedHat OpenShift Container Platform v4.21 or later (x86_64)
- Dynamic Volume Provisioning supporting accessModes ReadWriteOnce (RWO) and ReadWriteMany (RWX).
- Jaeger Operator (Optional) If tests should contribute trace information and Jaeger based reports are required.
The product requires a minimum of: (in addition to resources required by the cluster)
- 16GiB memory
- 8 cpu
- 128GiB of persistent storage
Depending on workload considerably more resources could be required.
To install the product you will need cluster administrator privileges.
Red Hat OpenShift SecurityContextConstraints Requirements
The product is compatible with the restricted and restricted-v2 SecurityContextConstraint.
If you would prefer to use the custom ibm-devops-restricted SCC, please do the following before installation:
Custom SecurityContextConstraints definition:
oc create -f - <<EOF
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
name: ibm-devops-restricted
allowHostDirVolumePlugin: false
allowHostIPC: false
allowHostNetwork: false
allowHostPID: false
allowHostPorts: false
allowPrivilegeEscalation: true
allowPrivilegedContainer: false
allowedCapabilities: null
defaultAddCapabilities: null
fsGroup:
type: MustRunAs
groups:
priority: null
readOnlyRootFilesystem: false
requiredDropCapabilities:
- KILL
- MKNOD
- SETUID
- SETGID
runAsUser:
type: MustRunAsRange
seLinuxContext:
type: MustRunAs
supplementalGroups:
type: RunAsAny
users: []
volumes:
- configMap
- downwardAPI
- emptyDir
- persistentVolumeClaim
- projected
- secret
EOF
Configure services to use this SCC. From the command line, run:
oc adm policy add-scc-to-group ibm-devops-restricted system:serviceaccounts:devops-system
Red Hat OpenShift Sysdig Requirements
IBM Cloud deploys Sysdig into Red Hat OpenShift. The default configuration causes many warnings in the RabbitMQ pod that eventually causes pod restarts.
2023-02-23 01:55:01.045358+00:00 [warning] <0.710.0> HTTP access denied: user 'guest' - invalid credentials
2023-02-23 01:55:02.050662+00:00 [warning] <0.711.0> HTTP access denied: user 'guest' - invalid credentials
Fix this by filtering out RabbitMQ:
oc edit configmap sysdig-agent -n ibm-observe
Append to dragent.yaml
use_container_filter: true
container_filter:
- exclude:
kubernetes.pod.label.app.kubernetes.io/name: rabbitmq
This change propagates after a couple of minutes. Further reading
Local Machine
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:
--set global.persistence.rwxStorageClass=ibmc-file-gold \
The following ReadWriteMany storage implementations have been validated:
The default configuration creates claims that dynamically provision the below persistent volumes.
| Claim | Size | Access Mode | Content |
|---|---|---|---|
| data-*-postgresql-0 | 26Gi | RWO | User data used by services |
| data-*-rabbitmq-0 | 8Gi | RWO | Notifications between services |
| data-*-results-0 | 8Gi | RWO | Reports |
| data-*-tam-0 | 32Gi | RWO | Cloned git repositories |
| data-*-userlibs-0 | 1Gi | RWX | User provided third party libraries and extensions |
The pod fsGroup can be set for these volumes using the Helm securityContext.fsGroup value if your volume provisioner requires it.
Install
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-prod --version 12.0.000
cd ibm-devops-prod
Chart
NAMESPACE=devops-system
HELM_NAME=main
INGRESS_PROXY_ADDRESSES=$(oc get configmap subnet-config -n kube-system -o json | jq -r '.data["subnets.json"] | fromjson | map(.cidrs) | join(",")')
INGRESS_DOMAIN=devops.$(oc get -n openshift-ingress-operator ingresscontroller default -ojsonpath='{.status.domain}')
PASSWORD_SEED= # secure seed required to generate passwords - unrecoverable so keep it safe
ENTITLEMENT_REGISTRY_KEY= # from https://myibm.ibm.com/products-services/containerlibrary
[email protected]
helm upgrade --install $HELM_NAME . -n $NAMESPACE \
--server-side=true --force-conflicts \
--create-namespace \
--set global.domain=$INGRESS_DOMAIN \
-f values-openshift.yaml \
-f values-dedicated-nodes.yaml \
--set global.persistence.rwxStorageClass=ibmc-file-gold \
--set ingress.proxy.addresses=$INGRESS_PROXY_ADDRESSES \
--set-literal passwordSeed=$PASSWORD_SEED \
--set signup=true \
--set-literal global.ibmImagePullPassword=$ENTITLEMENT_REGISTRY_KEY \
--set rationalLicenseKeyServer=$RATIONAL_LICENSE_FILE \
--set license=true
-
When the ingress domain is accessible to untrusted parties,
signupmust be set tofalse. -
The password seed is used to generate default passwords and should be stored securely. Its required again to restore from a backup.
-
Only use
values-dedicated-nodes.yamlif you have labeled and tainted specific nodes or pools to run test assets. -
The rwxStorageClass is cloud provider dependent, the value provided is only an example.
Troubleshooting
If in doubt run oc get pods -A to see what is not running followed by oc describe pod for more detail.
If pods are Pending and describe gives no clues, check you're not waiting on storage: oc get pvc -n $NAMESPACE
Configuration
| Parameter | Description | Default |
|---|---|---|
clusterDomain | The DNS name of the Kubernetes cluster if the default is overridden. | cluster.local |
execution.ingress.hostPattern | Pattern used to generate hostnames so that running assets may be accessed via ingress. | PLATFORM specifc |
execution.nodePorts.enabled | When network.policy is disabled, allow NodePorts to be used to access to running assets like virtual services. | true |
execution.priorityClassName | The products dynamic workload pods will have this priorityClass. | '' |
execution.priorityClassValue | When set a priorityClass named execution.priorityClassName is created with the set priority value. | |
global.domain | The web address to expose the product on. For example 192.168.0.100.nip.io | REQUIRED |
global.ibmCertSecretName | Optionally used to terminate TLS and when ingress.cert.selfSigned, is used to verify trust of loopback connections. | ingress |
global.ibmImagePullSecret | The docker-registry secret to pull images from the imageRegistry. | '' |
global.ibmImagePullUsername | Username to pull images from the imageRegistry. | 'cp' |
global.ibmImagePullPassword | Password to pull images from the imageRegistry. | '' |
global.persistence.rwoStorageClass | The storageClass to use if the cluster default is not appropriate. | '' |
global.persistence.rwxStorageClass | For environments that do not provide a default StorageClass that supports the ReadWriteMany (RWX) accessMode, this value must be set to a suitable StorageClass that supports ReadWriteMany access. | REQUIRED |
global.privateCaBundleSecretName | Name of secret containing ca.crt, which lists certificates to trust (in PEM format). | '' |
rationalLicenseKeyServer | Where floating licenses are hosted to entitle use of the product. For example @ip-address | '' |
imageRegistry | The location of container images to use. See move-images | cp.icr.io/cp |
ingress.cert.create | Create an self-signed certificate matching the ingress domain if none exists in secret global.ibmCertSecretName. | true |
ingress.cert.selfSigned | If the ingress domain certificate is not signed by a globally trusted CA. | PLATFORM specifc |
ingress.proxy.addresses | Comma-separated list of trusted proxy IP addresses. When set, only requests from these addresses are trusted to provide X-Forwarded-For headers. | '' |
ingress.proxy.count | Number of trusted proxies between the client and the gateway for X-Forwarded-For parsing. Adjust per environment: 1 for ingress only, 2 for external load balancer. | 1 |
keycloak.truststoreFileHostnameVerificationPolicy | HTTPS hostname cerificate verifcation policy. ANY (hostname is not verified), WILDCARD (allows wildcards in subdomain names) or STRICT (the Common Name (CN) must match the hostname exactly). | WILDCARD |
license | Confirmation that the EULA has been accepted. For example true | false |
networkPolicy.egress.cidrs | Network ranges to allow access to. This does not include access to github.com where helm test resources are stored. | [ 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 ] |
networkPolicy.egress.enable | When network.policy is enabled create a rule to narrow egress from the product. | false |
networkPolicy.enabled | Deny other software, installed in the cluster, access to the product. | true |
passwordSeed | The seed used to generate all passwords. | REQUIRED |
priorityClassName | The products pods (excluding dynamic workload) will have this priorityClass. | '' |
priorityClassValue | When set a priorityClass named priorityClassName is created with the set priority value. | |
router.allowedOrigin | A comma separated list of allowed origins for CORS. For example *.domain.com,*.test.com,10.10.*.* | '' |
results.jaegerAgent | The name of the service/host that execution engines write traces to. | '' |
results.jaegerDashboard | The URL for where traces may be opened in a browser. | '' |
signup | Allow users to create their own accounts. (Setting also in realm under Login > User registration) | false |
Upgrade
Releases prior to v11.0.8 cannot be upgraded directly; you must first upgrade to an intermediate release.
Before performing your upgrade RabbitMQ flags must be enabled on a running install:
oc exec -n $NAMESPACE $HELM_NAME-rabbitmq-0 -- rabbitmqctl enable_feature_flag all
If you are restoring from a quiesced snapshot, meaning no instance is running, you can instead delete the RabbitMQ data before installing:
oc delete pvc -n $NAMESPACE data-$HELM_NAME-rabbitmq-0
Before performing your upgrade backup your user data.
Install the product as above.
Backup
Velero
Install velero v14.0.1 or later and place on your PATH.
S3
Prepare the cluster to use CSI Snapshots by installing the CSI Snapshotter.
Provision S3 storage with your cloud provider. As an example we'll use MinIO.
To use velero with S3 storage, the AWS storage plugin must be used with a credentials file in the following form:
[default]
aws_access_key_id = ACCESS_KEY_ID
aws_secret_access_key = SECRET_ACCESS_KEY
Install velero using the AWS plugin and CSI feature:
S3_IP=127.0.0.1
REGION=minio
BUCKET_NAME=$NAMESPACE
velero install \
--provider aws \
--features=EnableCSI \
--plugins=velero/velero-plugin-for-aws:v1.10.1 \
--bucket "$BUCKET_NAME" \
--secret-file ./credentials \
--snapshot-location-config region=$REGION \
--backup-location-config region=$REGION,s3ForcePathStyle="true",s3Url=https://${S3_IP}:9000 \
--use-node-agent \
--wait
Deploy ibm-devops-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-devops-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-devops-prod is pinned at v12.0.0 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