ibm-ucda-prod

by joaquinito2051

Helm chartv3.3.35App 8.2.2Apache-2.0

IBM DevOps Deploy agent License By installing this product you accept the terms https://ibm.biz/devops-deploy-license.

About this chart

DevOps Deploy Agent - Helm Chart

Introduction

DevOps Deploy Agent 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 DevOps Deploy agent 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. However, ReadWriteMany is required to successfully scale to more than one replica/instance of the agent.
  • Includes a StatefulSet workload object
  • Support has been validated on OpenShift clusters running onPrem, in IBM Satellite, and IBM ROKS.

Prerequisites

  1. Kubernetes 1.19.0+/OpenShift 4.6.0+; kubectl and oc CLI; Helm 3;
  1. Accessing the container Image - The DevOps Deploy agent 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 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
  1. The agent must have an DevOps Deploy server or relay to connect to.

  2. Secret - A Kubernetes Secret object must be created to store 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 kubectl CLI, create a Secret object in the target namespace.
kubectl create secret generic ucd-secrets \
  --from-literal=keystorepassword=MyKeystorePassword

  1. A PersistentVolume that will hold the conf directory for the DevOps Deploy agent 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: ucda-conf-vol
  labels:
    volume: ucda-conf-vol
spec:
  capacity:
    storage: 10Mi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  nfs:
    server: 192.168.1.17
    path: /volume1/k8/ucda-conf
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: ucda-conf-volc
spec:
  storageClassName: ""
  accessModes:
    - "ReadWriteOnce"
  resources:
    requests:
      storage: 10Mi
  selector:
    matchLabels:
      volume: ucda-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.

  1. 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

Resources Required

  • 200MB of RAM
  • 50 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-ucda-prod > myvalues.yaml

Edit the file myvalues.yaml to specify the parameter values to use when installing the DevOps Deploy agent instance. The configuration section lists the parameter values that can be set.

To install the chart into namespace 'ucdtest' with the release name my-ucda-release and use the values from myvalues.yaml:

$ helm install my-ucda-release ibm-helm/ibm-ucda-prod --namespace ucdtest --values myvalues.yaml

Tip: List all releases using helm list.

Verifying the Chart

Check the Resources->Agents page of the DevOps Deploy server UI to verify the agent has connected successfully.

Upgrading the Chart

Check here for information about ugrading the chart.

Uninstalling the Chart

To uninstall/delete the my-ucda-release deployment:

$ helm delete my-ucda-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Disaster Recovery

Backup product data and essential Kubernetes resources so that you can recover your DevOps Deploy agent instance after a disaster.

Backup Kubernetes Resources

Backup the Kubernetes resoures required to redeploy the DevOps Deploy agent after a disaster. Follow these steps to save the configuration of essential Kubernetes resources.

  1. 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
  1. Save secret containing DevOps Deploy agent 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
  1. 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 agent.

  1. Scale the statefulset resource to 0 to shutdown the DevOps Deploy agent.
  2. Backup the conf Persistent Volume.
  3. Scale the statefulset resource to 1 to restart the DevOps Deploy server.

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 agent using that data. Follow these steps to recreate your DevOps Deploy agent instance.

  1. Create a new project/namespace to hold the Kubernetes resources associated with the DevOps Deploy agent instance.
  2. Create the Kubernetes secret that contains the DevOps Deploy agent keystore password by running the following command.
oc apply -n <ucd_namespace> -f <ucdsecrets_name>.yaml
  1. 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
  1. Create the conf Persistent Volume and associated Persistent Volume Claim and load the saved conf directory contents into the Persistent Volume.
  2. 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.
  3. Create the new DevOps Deploy agent instance by running the following command.
helm install my-recovered-release ibm-helm/ibm-ucda-prod --namespace <ucd_namespace> --values myRecoveredValues.yaml

Configuration

Parameters

The Helm chart has the following values that can be overriden using the --set parameter or specified via -f my_values.yaml.

Common Parameters

QualifierParameterDefinitionAllowed Value
versionDevOps Deploy agent product versionDefaults to the latest product version
replicasagentNumber of DevOps Deploy agent replicasNon-zero number of replicas. Defaults to 1
imagepullPolicyImage Pull PolicyAlways, Never, or IfNotPresent. Defaults to IfNotPresent
secretAn image pull secret used to authenticate with the image registryIf no value is specified we will look for a pull secret named ibm-entitlement-key.
licenseacceptSet to true to indicate you have read and agree to license agreements : https://ibm.biz/devops-deploy-licensefalse
statefulsetannotationsAnnotations for statefulsetDefault value is ""
topologySpreadConstraints.enabledDetermines if topologySpreadConstraints are defined for the agent statefulsetDefault value is false
topologySpreadConstraints.maxSkewDescribes the degree to which Pods may be unevenly distributedDefault value is 1
topologySpreadConstraints.topologyKeyThe key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology.Default value is "kubernetes.io/arch"
topologySpreadConstraints.whenUnsatisfiableIndicates how to deal with a Pod if it doesn't satisfy the spread constraint.Default value is ScheduleAnyway
persistenceenabledDetermines if persistent storage will be used to hold the DevOps Deploy agent conf directory contents. This should always be true to preserve agent data on container restarts.Default value "true"
useDynamicProvisioningSet to "true" if the cluster supports dynamic storage provisoningDefault value "true"
fsGroupThe group ID to use to access persistent volumesDefault value "1

Deploy ibm-ucda-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-ucda-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-ucda-prod is pinned at v3.3.35 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