GCP Portal Deployment Using Automation - Pratiksha-Marane/duplo-docs GitHub Wiki

Automation Guide for GCP Deployment

1. Verify DNS

  • Check if the DNS is *.duplocloud.net.
    • If yes, proceed.
    • If no (e.g., *.customdomain.com), create a new DNS entry first.

2. Clone the Repository

  • Pull the latest code from the repository:
    git clone https://github.com/duplocloud-internal/duplo-infra/tree/release_jul_2024/terraform/gcp
    

3. Prerequisites

Ensure the following tools and versions are installed:

  • Google Cloud SDK CLI
  • Terraform: Version 1.5.2
  • Google Provider Plugin: Version 5.21
  • Python: Version 3.12 OR Above.

4. Required Permissions

  • Google Cloud Account with:
    a. Admin permissions in the GCP project you're deploying to.
    b. Read permissions to the gcp-infra project for reading VM images.

5. Information to Gather

Before starting, collect the following details:

  • DNS
  • Zone
  • Project ID

6. Automated Deployment Steps

First, navigate to the directory:
Ensure Terraform is run from the release_jul_2024 branch.

  1. Enable required GCP APIs:

    ./enable_gcp_apis.sh <project-id>
    
  2. Initialize Terraform:

    terraform init
    
  3. Create a deployment plan:

    ./deploy_gcp_infrastructure.sh <project-id> <project-URL> [email protected] <region> <zone>
    
  4. Apply the deployment:

    ./deploy_gcp_infrastructure.sh <project-id> <project-URL> [email protected] <region> <zone> --apply
    

7. Certificate Activation

Once the deployment script creates a certificate:

  • If using a non-*.duplocloud.net DNS:

    • Add the provided CNAME record to the DNS you created earlier to activate the certificate.
  • If using *.duplocloud.net DNS:

    • Add the CNAME record to the *.duplocloud.net DNS.
    • Send the CNAME record to (e.g., Raghavan) for configuration.

8. Additional Configuration

  • Provide the Load Balancer IP and the Portal URL:
    • Add them to DNS and SSO for proper configuration.

9. Update the Portal

  1. Set the GCP project and authenticate your Google Cloud account:
    gcloud config set project <project-id>
    gcloud auth login
    
  2. Ensure the portal is updated to the July Latest Version:
    GCP_PROJECT_ID=<project-id> VERSION=branch/release_jul_2024/latest UI_VERSION=branch/release_jul_2024/latest  GCP_REGION=<region> GCP_ZONE=<Zone> ./update-duplo.sh
    
⚠️ **GitHub.com Fallback** ⚠️