ibm-devops-prod

by joaquinito2051

Helm chartv12.0.0App 12.0.0-202609120126-62105fa5dbApache-2.0

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

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.

ClaimSizeAccess ModeContent
data-*-postgresql-026GiRWOUser data used by services
data-*-rabbitmq-08GiRWONotifications between services
data-*-results-08GiRWOReports
data-*-tam-032GiRWOCloned git repositories
data-*-userlibs-01GiRWXUser 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, signup must be set to false.

  • 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.yaml if 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

ParameterDescriptionDefault
clusterDomainThe DNS name of the Kubernetes cluster if the default is overridden.cluster.local
execution.ingress.hostPatternPattern used to generate hostnames so that running assets may be accessed via ingress.PLATFORM specifc
execution.nodePorts.enabledWhen network.policy is disabled, allow NodePorts to be used to access to running assets like virtual services.true
execution.priorityClassNameThe products dynamic workload pods will have this priorityClass.''
execution.priorityClassValueWhen set a priorityClass named execution.priorityClassName is created with the set priority value.
global.domainThe web address to expose the product on. For example 192.168.0.100.nip.ioREQUIRED
global.ibmCertSecretNameOptionally used to terminate TLS and when ingress.cert.selfSigned, is used to verify trust of loopback connections.ingress
global.ibmImagePullSecretThe docker-registry secret to pull images from the imageRegistry.''
global.ibmImagePullUsernameUsername to pull images from the imageRegistry.'cp'
global.ibmImagePullPasswordPassword to pull images from the imageRegistry.''
global.persistence.rwoStorageClassThe storageClass to use if the cluster default is not appropriate.''
global.persistence.rwxStorageClassFor 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.privateCaBundleSecretNameName of secret containing ca.crt, which lists certificates to trust (in PEM format).''
rationalLicenseKeyServerWhere floating licenses are hosted to entitle use of the product. For example @ip-address''
imageRegistryThe location of container images to use. See move-imagescp.icr.io/cp
ingress.cert.createCreate an self-signed certificate matching the ingress domain if none exists in secret global.ibmCertSecretName.true
ingress.cert.selfSignedIf the ingress domain certificate is not signed by a globally trusted CA.PLATFORM specifc
ingress.proxy.addressesComma-separated list of trusted proxy IP addresses. When set, only requests from these addresses are trusted to provide X-Forwarded-For headers.''
ingress.proxy.countNumber 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.truststoreFileHostnameVerificationPolicyHTTPS 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
licenseConfirmation that the EULA has been accepted. For example truefalse
networkPolicy.egress.cidrsNetwork 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.enableWhen network.policy is enabled create a rule to narrow egress from the product.false
networkPolicy.enabledDeny other software, installed in the cluster, access to the product.true
passwordSeedThe seed used to generate all passwords.REQUIRED
priorityClassNameThe products pods (excluding dynamic workload) will have this priorityClass.''
priorityClassValueWhen set a priorityClass named priorityClassName is created with the set priority value.
router.allowedOriginA comma separated list of allowed origins for CORS. For example *.domain.com,*.test.com,10.10.*.*''
results.jaegerAgentThe name of the service/host that execution engines write traces to.''
results.jaegerDashboardThe URL for where traces may be opened in a browser.''
signupAllow 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartibm-devops-prod is pinned at v12.0.0 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