Documentation

Deployment steps

Deploy Self-Hosted Deployment to Amazon Web Services and monitor the deployment.
Read time 7 minutesLast updated 4 days ago

Before deployment, check the prerequisites.
Note
This guide is for deployment into the
us-east-1
region. You can adapt it to any supported Amazon Web Services (AWS) region.
If all prerequisites are met, the deployment should take 30 to 60 minutes. This time doesn't include the subsequent administration tasks, such as setting up an identity provider for single sign-on (SSO).
Follow these steps to deploy Self-Hosted Deployment to your AWS account.

1. Unpackage the archive file

The archive file contains the Terraform scripts and the Helm charts that are required for deployment.
  1. Before you download the required scripts and packaging, install the ORAS command line interface (CLI).
  2. Sign in to the private container registry using your provided credentials:
    $ oras login uccmpprivatecloud.azurecr.ioUsername: Token:
  3. To list the available releases, run this command:
    oras repo tags uccmpprivatecloud.azurecr.io/releases/aws-configuration
  4. To pull a specific release, run this command. Replace
    <RELEASE_VERSION>
    with the number of the release, for example
    1.5.0
    :
    oras pull uccmpprivatecloud.azurecr.io/releases/aws-configuration:<RELEASE_VERSION>
  5. Check that the following package is in your file system:
    unity-private-cloud-aws-<RELEASE_VERSION>.tar.gz
  6. To create the following directory, run this command:
    mkdir asset-solutions-private-cloud
  7. To extract the package into that directory, run this command:
    tar -xvzf unity-private-cloud-aws-*.tar.gz -C asset-solutions-private-cloud
    To go to the directory that contains all scripts and configuration, run this command:
    cd asset-solutions-private-cloud
    The commands that follow run from this directory.

2. Set up a Terraform backend

Terraform stores its backend state in .json format. Store state files in a safe, remote place with incremental backups. You can run Terraform locally, but this practice isn't recommended as a long-term solution.
To manage Terraform state remotely, you might want to use an S3 backend where object versioning is enabled. There are a number of remote backends including Terraform Cloud.
If you need an S3 backend, complete these steps:
  1. To set up the Terraform backend, run this command:
    ./aws/scripts/setup-terraform-backend.sh
    When prompted, enter an AWS region—for example,
    us-east-1
    —and then press Enter.
    This script provisions a backend in your AWS account that uses both S3 and DynamoDB to restore state and state locks respectively.
  2. The script automatically creates the backend file and writes the required configuration to it.
Upon completion, the script returns the results:
The terraform backend has been successfully created and stored in 'aws/terraform/backends/us-east-1.tfvars'.
The script creates the backend file and copies the backend variables to it. You don't need to perform these operations manually.

3. Provision resources with Terraform

Using Terraform, deploy and manage all required AWS resources.

3.1 Set the Terraform variables

Note
The
variables.tf
file contains the exhaustive list of configuration variables and their descriptions.
  1. Set the following required variables. The recommended practice is to customize these variables for your own environment, in this file:
    aws/terraform/tfvars/us-east-1.tfvars
    Set these variables:
    region = "us-east-1"vpc_id = "vpc-<YOUR_VPC_ID>"private_subnet_ids = [ "subnet-<YOUR_SUBNET_ID_1>", "subnet-<YOUR_SUBNET_ID_2>",]asset_solutions_domain = "example.com"keycloak_mini_usf_clientsecret = "<YOUR_KEYCLOAK_CLIENT_SECRET>" # This should be uniquekeycloak_licensing_server_clientsecret = "<YOUR_LICENSING_SERVER_CLIENT_SECRET>" # This should be unique# UVCS: run the server inside the cluster (recommended)enable_uvcs = trueuvcs_license = "<YOUR_BASE64_ENCODED_UVCS_LICENSE>"# UVCS: alternatively, connect an existing external server# enable_uvcs = false# uvcs_url = "https://plasticscm.example.com:7179"# uvcs_authorization = "Bearer <YOUR_UVCS_AUTHORIZATION_TOKEN>"# uvcs_repository_guid = "<YOUR_REPOSITORY_GUID>"allowed_ingress_cidrs = [ "0.0.0.0/0", ]# Required, and only false is accepted: MongoDB and Elasticsearch always run in the clusterenable_mongo = falseenable_elasticsearch = false# Required for transformations: a ReadWriteMany (RWX) storage class for the shared workflow volume.# Creates an Amazon Elastic File System (EFS) file system and its storage class. If you already run an RWX# storage class, leave enable_efs unset and name that class instead:# kubernetes_efs_storage_class_name = "<YOUR_RWX_STORAGE_CLASS>"enable_efs = true# On a new EKS cluster, only these Identity and Access Management (IAM) roles (by name) and users are cluster admins.# Include the role you deploy with, or the Helm install in section 4 can't reach the cluster.eks_cluster_admin_roles = ["<YOUR_DEPLOY_ROLE_NAME>"]# eks_cluster_admin_users = ["<YOUR_IAM_USER_NAME>"]# enable_percona_monitoring = true # Enable Percona Monitoring and Management if needed (ClusterRole and ClusterRoleBinding will be required)
    Note
    In order to bring your own EKS cluster (BYO EKS), you need to set the
    enable_eks
    setting to false.
  2. Customize the following command to your preferred region, and then run it:
    $ cd aws/terraform$ make init-us-east-1$ make apply-us-east-1Apply complete! Resources: …Generating helm values for third party services...…Merging helm values files...…Copying generated helm charts and values to target directory: ../argocd/charts/us-east-1✅ Successfully generated helm configuration.
    The output is abridged. In it,
    …
    marks the lines that are left out.
  3. To list all resources that Terraform created, run this command:
    terraform state list
After you have successfully provisioned the AWS resources, deploy the Helm charts and the generated Helm values to the Kubernetes cluster.

4. Install the Helm charts

Many of the required services run on Kubernetes. To deploy these services, install the Helm charts on the cluster. You can use different methods. The following steps use the
helm
command directly. To deploy and sync the Helm charts with your Kubernetes cluster, you can also use continuous delivery tools, such as Argo CD.
Warning
If Argo CD deploys the charts through the ApplicationSet that
aws/scripts/generate-appsets.sh
writes, delete that ApplicationSet only with
--cascade=orphan
, from the namespace Argo CD runs in. Replace
<YOUR_ARGO_CD_NAMESPACE>
with that namespace:
kubectl -n <YOUR_ARGO_CD_NAMESPACE> delete applicationset asset-solutions --cascade=orphan
Every Application that the ApplicationSet creates has the Argo CD resources finalizer. A plain delete removes every Application and, through that finalizer, everything they deployed, including the PostgreSQL, MongoDB, Elasticsearch, and RabbitMQ clusters. With
--cascade=orphan
, the Applications and their resources stay. Before you delete the ApplicationSet, back up your databases, as described in Backup and recovery.
To install the Helm charts, complete these steps:
  1. From the
    aws/terraform
    directory, run this command:
    make helm-upgrade-us-east-1
    This command installs all the necessary Helm charts on the Kubernetes cluster. The Helm charts are generated from the Terraform output and are stored by default in this directory:
    aws/argocd/charts/us-east-1
    .
  2. To check the status of the deployments, run this command:
    kubectl get pods --all-namespaces --watch
  3. Ensure that all pods eventually move to the Running state.
  4. If a pod isn't running, describe it and check its logs to find the issue.

5. Configure the DNS and certificates

To make Self-Hosted Deployment secure and accessible, you need Domain Name System (DNS) records and certificates. The configuration of DNS depends on the DNS provider and certificate authority. For example, you can use Amazon Route 53 to configure DNS and use AWS Certificate Manager (ACM) to issue certificates.
Traefik runs behind an AWS Network Load Balancer. The load balancer uses a certificate from ACM to decrypt incoming Transport Layer Security (TLS) traffic.
  1. Register a fully qualified domain name (FQDN) for the frontend, for example,
    example.com
    .
  2. To reference your existing ACM certificate, add this Terraform variable to your Terraform variables file, for example
    aws/terraform/tfvars/us-east-1.tfvars
    . Replace
    <YOUR_ACM_CERTIFICATE_ARN>
    with the Amazon Resource Name (ARN) of the certificate:
    traefik_load_balancer_config = { type = "nlb" is_internal = "false" scheme = "internet-facing" target = "instance" ssl_certificate = "<YOUR_ACM_CERTIFICATE_ARN>" ssl_port = "443" ssl_policy = "ELBSecurityPolicy-TLS13-1-2-2021-06" backend_proto = "tcp" cross_zone = true access_logs = { enabled = false s3_bucket_create = false s3_bucket_prefix = "elb-logs-unity-asset-manager-vpc" }}
  3. To apply the change and regenerate the Traefik values, run this command. Replace
    <YOUR_REGION>
    with your region:
    make apply-<YOUR_REGION>
  4. To deploy the values, run this command, as in Install the Helm charts. Use the same region:
    make helm-upgrade-<YOUR_REGION>
To modify your configuration after deployment, refer to the deployment overview.

Next steps