ibm-ucv-prod

by joaquinito2051

Helm chartv5.3.0App 5.3.0Apache-2.0

IBM DevOps Velocity Documentation For additional details regarding install and use of product see here https://www.ibm.com/support/knowledgecenter/SSCKX6 License By installing this product you accept the following license terms: https://github.com/UrbanCode/velocity/blob/master/LICENSE

About this chart

CASE Bundle for IBM DevOps Velocity (ibm-ucv-prod)

Introduction

IBM DevOps Velocity is a DevOps and value stream management tool to help you understand your DevOps practices, implement changes, review change impact, and automate release processes.

Chart Details

This chart deploys a single instance of IBM DevOps Velocity.

  • 9 backend microservices
  • 3 frontend microservices
  • Single AMQP (Advanced Message Queuing Protocol) StatefulSet
  • NGINX for inter-service routing
  • Exposed externally via Ingress

Prerequisites

  1. Kubernetes - use this tool to check which versions are supported
  2. MongoDB Database - may be running in your cluster or outside of it. Need to provide the mongo connection string for a user with database create permissions.
  3. Permissions: The installing user needs Cluster Admin privileges in order to install the Argo framework.
  4. Configuration scripts (see below)

Configuration Scripts

The scripts below are for ibm_cloud_pak

  • common
    • Scripts to check existence of security policy/context
  • post-delete
    • clusterAdministration
      • deleteSecurityClusterPrereqs.sh
    • namespaceAdministration
      • deleteSecurityNamespacePrereqs.sh
  • post-install
    • namespaceAdministration
      • deleteSecretGenerationJobs.sh
  • pre-install
    • clusterAdministration
      • createSecurityClusterPrereqs.sh
    • namespaceAdministration
      • createSecurityNamespacePrereqs.sh
      • createSecretNamespacePrereqs.sh
      • createImagePolicyNamespacePrereqs.sh

PodSecurityPolicy Requirements

This chart requires a PodSecurityPolicy to be bound to the target namespace prior to installation. To meet this requirement there may be cluster scoped as well as namespace scoped pre and post actions that need to occur.

The predefined PodSecurityPolicy named ibm-restricted-psp has been verified for this chart, if your target namespace is bound to this PodSecurityPolicy you can proceed to install the chart.

This chart also defines a custom PodSecurityPolicy which can be used to finely control the permissions/capabilities needed to deploy this chart. You can enable this custom PodSecurityPolicy using the Cluster Console user interface or the supplied instructions/scripts in the pak_extension pre-install directory.

  • From the user interface, you can copy and paste the following snippets to enable the custom PodSecurityPolicy
    • Custom PodSecurityPolicy definition:
      apiVersion: extensions/v1beta1
      kind: PodSecurityPolicy
      metadata:
        name: ibm-ucv-prod-psp
      spec:
        allowPrivilegeEscalation: false
        readOnlyRootFilesystem: false
        allowedCapabilities:
        - CHOWN
        - DAC_OVERRIDE
        - SETGID
        - SETUID
        - NET_BIND_SERVICE
        seLinux:
          rule: RunAsAny
        supplementalGroups:
          rule: RunAsAny
        runAsUser:
          rule: RunAsAny
        fsGroup:
          rule: RunAsAny
        volumes:
        - configMap
        - secret
      
    • Custom ClusterRole for the custom PodSecurityPolicy:
      apiVersion: rbac.authorization.k8s.io/v1
      kind: ClusterRole
      metadata:
        name: ibm-ucv-prod-clusterrole
      rules:
      - apiGroups:
        - extensions
        resourceNames:
        - ibm-ucv-prod-psp
        resources:
        - podsecuritypolicies
        verbs:
        - use
      

SecurityContextConstraints Requirements

This chart requires a SecurityContextConstraints to be bound to the target namespace prior to installation. To meet this requirement there may be cluster scoped as well as namespace scoped pre and post actions that need to occur.

The predefined SecurityContextConstraints name: ibm-restricted-scc has been verified for this chart, if your target namespace is bound to this SecurityContextConstraints resource you can proceed to install the chart.

This chart also defines a custom SecurityContextConstraints which can be used to finely control the permissions/capabilities needed to deploy this chart. You can enable this custom SecurityContextConstraints resource using the supplied instructions/scripts in the pak_extension pre-install directory.

  • From the user interface, you can copy and paste the following snippets to enable the custom SecurityContextConstraints

    • Custom SecurityContextConstraints definition:
      apiVersion: security.openshift.io/v1
      kind: SecurityContextConstraints
      allowPrivilegedContainer: false
      allowHostDirVolumePlugin: false
      allowHostIPC: false
      allowHostNetwork: false
      allowHostPID: false
      allowHostPorts: false
      metadata:
        name: ibm-ucv-prod-scc
      readOnlyRootFilesystem: false
      allowHostPID: false
      allowedCapabilities:
      - CHOWN
      - DAC_OVERRIDE
      - SETGID
      - SETUID
      - NET_BIND_SERVICE
      supplementalGroups:
        type: MustRunAs
        ranges:
        - max: 65535
      min: 1
      runAsUser:
        type: MustRunAsRange
      seLinux:
        type: MustRunAs
      seLinuxContext:
        type: MustRunAs
      fsGroup:
        type: MustRunAs
        ranges:
        - max: 65535
          min: 1
      volumes:
      - configMap
      - secret
      
  • From the command line, you can run the setup scripts included under pak_extensions when running the namespace scripts add the namespace as argument

    As a cluster admin the pre-install instructions are located at:

    • pre-install/clusterAdministration/createSecurityClusterPrereqs.sh

    As team admin the namespace scoped instructions are located at:

    • pre-install/namespaceAdministration/createSecurityNamespacePrereqs.sh
    • pre-install/namespaceAdministration/createSecretNamespacePrereqs.sh
    • pre-install/namespaceAdministration/createImagePolicyNamespacePrereqs.sh

Resources Required

The minimal system resources required:

  • CPU: 8 vCPU (virtual CPUs)
  • Memory: 12 GB
  • Storage: 20 GB

Installing the Chart

To install the chart with the release name my-release:

helm install my-release --set license=accept --set access.key=$ACCESS_KEY --set url.domain=localhost ibm-marketplace/ibm-ucv-prod

The above command sets license, access key and domain name parameters. Other parameters may also be required. If parameters aren't specifed with the --set flag, their values will default to the values specified in the values.yaml file.

The configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

  • Generally teams have subsections for:
    • Verifying the Chart
    • Uninstalling the Chart

Verifying the Chart

See the instruction (from NOTES.txt within chart) after the helm installation completes for chart verification. The instruction can also be viewed by running the command: helm status my-release.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release

Cleanup any pre-reqs that were created

If cleanup scripts were included in the pak_extensions/post-delete directory; run them to cleanup namespace and cluster scoped resources when appropriate.

Configuration

The helm chart has the following values. They can be overwritten using the --set key=value[,key=value] argument to helm install.

ParameterDescriptionDefault
licenseEnter 'accept' to indicate that you accept all terms and conditions of the End User License Agreement (EULA).true
access.keyThe access key obtained with the sign up or purchase of DevOps Velocity. This key is required to start Velocity and contains information such as the Velocity Edition and Trial vs Permanent.invalid-key
url.protocolThe protocol of the Velocity URL. Only https is supported.https
url.domainThe domain name users will access Velocity at. This is usually the ingress host name or the hostname of your kubernetes master node. If you have any reverse proxy in front of your kubernetes cluster, use that.localhost
url.portThe port users will use to access the app. If you have any reverse proxy in front of your kubernetes cluster, use that.32443
rabbitmq.urlThe URL that services will use to authenticate against RabbitMQ. Should be of form amqp://<rabbit-username>:<rabbit-password>@<rabbit-service-name/URL>:<rabbit-port>/<optional-v_host>. The username and password should match what is entered below.amqp://rabbit:carrot@velocity-rabbitmq:5672/
rabbitmq.nodePortThe port that RabbitMQ will be exposed outside the cluster on. This will be used by external tools that rely on RabbitMQ to communicate with Velocity such as Jenkins.31672
rabbitmq.managerPortThe port that the RabbitMQ administrative console will run on. This is not exposed outside of the cluster.15672
rabbitmq.erlangCookieThe cookie used by RabbitMQ and services to determine whether they are allowed to communicate with each other.128ad9b8-3d9f-11e8-b467-0ed5f89f718c
loglevelThe loggin level for all services to use. Possible values are ALL > DEBUG > INFO > WARN > ERROR > FATAL > OFF.ALL
ingress.enableSet to true if you want ingress rules set up, otherwise set to false. If you are using NodePort or an ingress of your own, then set to false.true
ingress.pathThe path that ingress will serve Velocity on./
secrets.rabbitThe name of the Kubernetes Secret to store sensetive RabbitMQ information. Will be created dynamically if it does not exist.velocity-rabbitmq
secrets.tlsThe name of the Kubernetes Secret containing TLS certificate information. Will be created dynamically if it does not exist.velocity-tls
secrets.tokensThe name of the Kubernetes Secret to store sensetive Velocity tokens. Will be created dynamically if it does not exist.velocity-tokens
secrets.databaseThe name of the Kubernetes Secret to store sensetive MongoDB information. Will be created dynamically if it does not exist.velocity-database

Tip: You can use the default values.yaml

Storage

There are no permanent storage solutions required.

Limitations

  • Only supported on amd64 architecture.

Identity and Access Management

User Authentication and Authorization Strategy

The DevOps Velocity authentication strategy includes browser cookies and user access key for API usage. Authorization resolves tenant permissions according to roles and teams.

Integrations

DevOps Velocity supports LDAP and header based SSO integrations. LDAP roles are supported and roles passed via SSO header.

Administration and Management

User authentication and authorization is intended to be managed from the UI. Management through an API is also possible.

Audit

User audit records are found in the "audit_log" collection in the "security" database.

Backup and Recovery

DevOps Velocity can be fully backed-up as a restore point by capturing the following:

  1. Database: This should be a single MongoDB instance containing multiple MongoDB databases per service.
  2. Environmental variables (secrets): these may affect, for instance - encryption, access, and operation.

For database and environment variable secrets management strategies, it is both risky and difficult to prescribe a one-size fits all solution for either or both plans. Refer to industry and company specific best practices that best apply per use case. Common approaches to database backup include the backup of persistent volumes either with or without using MongoDBs unique built-in tooling. Environmental variables and secrets, both critical and sensitive, should both be treated like passwords that are lightweight and easily backed-up by simple copying.

The following is a simple back-up and restore example:

  1. Backup the Database (Refer to MongoDB documentation for details https://docs.mongodb.com/manual/tutorial/backup-and-restore-tools/)

    1. Run MongoDBs mongodump command against DevOps Velocity's MongoDB instance (this command can execute against a remote instance). For example:

      mongodump --host=mongoInstanceAddress --port=27017 --out=/opt/backup/velocity-2020-7-4

    2. Move (archive) the dump file to a secure location.

    3. To restore a dump file run mongorestore.

      NOTE: mongorestore by default only adds and does not remove database data. To entirely restore a database to a restore point, either delete all databases before running, or run with the --drop flag. For example:

      mongorestore --host mongoInstanceAddress --port 27017 --drop /backup/dump

  2. Backup and restore environmental variables (secrets)

    1. Copy all deployment secrets to a secure location.
    2. To restore values, copy them back into production as needed.

Scaling Services

Some services can be scaled with performance improvements, others cannot. See the list of services below for a summary as of Velocity 2.0.0:

Service Containers

The following services can be scaled with expected performance improvements:

  • multi-app-pipeline-api
  • release-events-api
  • reporting-consumer
  • security-api

The following services should not be scaled, but might be scaled in future releases of Velocity:

  • application-api
  • continuous-release-consumer
  • continuous-release-poller

The following services are not expected to provide performance gains, and therefore are not recommended for scaling.

  • release-events-ui
  • continuous-release-ui
  • rcl-web-client

Non-service containers

Do not scale the rabbit container:

  • rabbitnode1

Scaling of velocity router

Deploy ibm-ucv-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-ucv-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-ucv-prod is pinned at v5.3.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