Deploying CDP JavaScript SDK

This section describes the steps to configure and deploy HCL CDP JavaScript SDK on an Azure Kubernetes Service (AKS) cluster using the provided Helm chart.

Before you begin

Make sure to create the cdp-java-script-sdk secret in the HashiCorp vault before deploying the CDP JavaScript SDK.

To create the cdp-java-script-sdk secret in the HashiCorp Vault, follow the steps below:

  1. Create a cdp-java-script-sdk secret sample key and value in the cdp-java-script-sdk secret shown below, and update the actual values.
    {
      "CAMPAIGN_DEFAULT_TTL": "",
      "DbDriver": "",
      "DbPassword": "",
      "DbUrl": "",
      "DbUsername": "",
      "KMS_HASHICORPVAULT_ENDPOINT": "",
      "KMS_HASHICORPVAULT_ENDPOINT_TOKEN": "",
      "KMS_IMPLEMENTATION": "",
      "awsRegions": "",
      "supportedRegions": ""
    }

Procedure

  1. Configure the values.yaml file.

    Update the environment-specific configuration in chart-location/cdp-java-script-sdk/values.yaml.

  2. Configure application ConfigMaps.

    Enable ConfigMaps and configure the required CDP JavaScript SDK Service application URLs.

  3. Configure container image.

    Update the HCL CDP JavaScript SDK Service image repository and required image version/tag.

  4. Verify image pull secret.
    kubectl get secret hclcr-cred -n cdp-dev-app
  5. Configure NGINX Ingress.

    Enable Ingress and configure the required hostname, path, and TLS settings.

  6. Configure Vault secrets.

    Ensure the vault-creds Secret exists:

    kubectl get secret vault-creds -n cdp-dev-app

    The init container retrieves the kms-service secret from CDP_Secrets and writes it to /etc/secrets/mysecrets.json.

  7. Verify or create namespace.
    kubectl get namespace cdp-dev-app

    If required, create the namespace:

    kubectl create namespace cdp-dev-app
  8. Install CDP JavaScript SDK Service.
    helm install cdp-java-script-sdk \
      chart-location/cdp-java-script-sdk \
      -f chart-location/cdp-java-script-sdk/values.yaml \
      -n cdp-dev-app
  9. Verify Helm release.
    helm list -n cdp-dev-app

    Expected status: deployed

  10. Verify deployment and pods.
    kubectl get deployment -n cdp-dev-app
    kubectl get pods -n cdp-dev-app -l k8s-app=cdp-java-script-sdk

    Expected pod status:

    READY   STATUS
    1/1     Running