Skip to content

Latest commit

 

History

History
312 lines (268 loc) · 9.5 KB

deploy-to-gce-instances-lb-proxy.md

File metadata and controls

312 lines (268 loc) · 9.5 KB

Deploy to GCE instances with manual load balancers(Proxy load balancers)

Google Cloud Platform(GCP) account requirements

See the Logging into gcloud section of the Installation prerequisities overview documentation for the IAM role requirements.

Quota

The following quota limits are required in the ABMRA_PLATFORM_PROJECT_ID project to provision all of the instances with the default configuration:

Service Limit name Dimensions (e.g location) Limit
Compute Engine API N2 CPUs region: us-central1 100
Compute Engine API N2 CPUs region: us-west1 96

Prepare Cloud Shell

  1. Open Cloud Shell
  2. [Cloud Shell] Authenticate gcloud and set the application-default
    gcloud auth login --activate --no-launch-browser --quiet --update-adc
    
  3. [Cloud Shell] Clone this project to the Cloud Shell home directory
    git clone https://github.com/GoogleCloudPlatform/anthos-bare-metal-ref-arch.git
    
  4. [Cloud Shell] Set the Organization ID or Folder ID where the projects will be created.

    This step can be skipped if using existing projects.

    export ABMRA_ORGANIZATION_ID=
    
    OR
    export ABMRA_FOLDER_ID=
    
  5. [Cloud Shell] Set the Billing Account ID of the Billing Account for the new projects.

    This step can be skipped if using existing projects.

    export ABMRA_BILLING_ACCOUNT_ID=
    
  6. [Cloud Shell] Set the Project IDs for the new or existing projects, if not set the following defaults will be used:
    export ABMRA_NETWORK_PROJECT_ID=project-0-net-prod
    export ABMRA_PLATFORM_PROJECT_ID=project-1-platform-prod
    export ABMRA_APP_PROJECT_ID=project-2-bofa-prod
    
  7. [Cloud Shell] Enable additional configuration for GCE with manual load balancers
    export ABMRA_BASE_CONF=hybrid-manual-lb
    export ABMRA_ADDITIONAL_CONF=gce
    
  8. [Cloud Shell] Change directory into anthos-bare-metal-ref-arch
    cd anthos-bare-metal-ref-arch
    
  9. [Cloud Shell] Setup variables file
    ./scripts/helpers/set_variables.sh
    
  10. [Cloud Shell] Logout, the new shell configurations will take effect on next login
    logout
    

Create the GCP projects

  1. Open Cloud Shell
  2. [Cloud Shell] Create the GCP projects
    ${ABMRA_WORK_DIR}/scripts/002_create_gcp_projects.sh
    

Create the Shared VPC

To create the Shared VPC in the ABMRA_NETWORK_PROJECT_ID project, the Compute Shared VPC Admin role is required for the organization or folder.

  1. Open Cloud Shell
  2. [Cloud Shell] Create the Shared VPC
    ${ABMRA_WORK_DIR}/scripts/003_create_shared_vpc.sh
    

Create the administrative host

  1. Open Cloud Shell
  2. [Cloud Shell] Generate the conf files
    ${ABMRA_WORK_DIR}/scripts/000_generate_conf_files.sh
    
  3. [Cloud Shell] Create the administrative host
    ${ABMRA_WORK_DIR}/scripts/gcp/001_create_admin_instance.sh
    

Prepare the administrative host

  1. Connect to the administrative host
    • Preferred SSH client
    • CloudShell:
      gcloud compute ssh --project ${ABMRA_PLATFORM_PROJECT_ID} --zone=us-central1-a bare-metal-admin-1
      
  2. [Admin Host] Clone this project to the administrative host
    git clone https://github.com/GoogleCloudPlatform/anthos-bare-metal-ref-arch.git
    
  3. [Admin Host] Set the Project IDs for the projects, these should match the value entered above.
    export ABMRA_NETWORK_PROJECT_ID=project-0-net-prod
    export ABMRA_PLATFORM_PROJECT_ID=project-1-platform-prod
    export ABMRA_APP_PROJECT_ID=project-2-bofa-prod
    
  4. [Admin Host] Enable additional configuration for GCE with manual load balancers
    export ABMRA_BASE_CONF=hybrid-manual-lb
    export ABMRA_ADDITIONAL_CONF=gce
    
  5. [Admin Host] Change directory into anthos-bare-metal-ref-arch
    cd anthos-bare-metal-ref-arch
    
  6. [Admin Host] Setup variables file
    ./scripts/helpers/set_variables.sh
    
  7. [Admin Host] Source the vars.sh file
    source ./scripts/vars.sh
    
  8. [Admin Host] Generate the conf files
    ${ABMRA_WORK_DIR}/scripts/000_generate_conf_files.sh
    
  9. [Admin Host] Prepare the administrative host
    ${ABMRA_WORK_DIR}/scripts/001_prepare_admin_host.sh
    
  10. [Admin Host] Logout, the new shell configurations will take effect on next login.
    logout
    

Create the GCE instances

  1. Connect to the administrative host
  2. [Admin Host] Authenticate gcloud and set the application-default
    gcloud auth login --activate --no-launch-browser --quiet --update-adc
    

    NOTE: If you get an error message such as: gcloud: command not found or -bash: /snap/bin/gcloud: No such file or directory, logout to activate the shell configuration changes.

  3. [Admin Host] Create the GCE cluster instances
    ${ABMRA_WORK_DIR}/scripts/gcp/002_create_cluster_instances.sh
    
  4. [Admin Host] Distribute the ABMRA_DEPLOYMENT_USER SSH key
    ${ABMRA_WORK_DIR}/scripts/gcp/003_distribute_ssh_keys.sh
    
  5. [Admin Host] Validate the ABMRA_DEPLOYMENT_USER settings
    ${ABMRA_WORK_DIR}/scripts/gcp/004_validate_deployment_user.sh
    

Create the control plane load balancers

  1. Connect to the administrative host
  2. [Admin Host] Create the control plane load balancer
    ${ABMRA_WORK_DIR}/scripts/gcp/lb-proxy/001_create_cp_lb.sh
    
  3. [Admin Host] Create the ingress load balancer address
    ${ABMRA_WORK_DIR}/scripts/gcp/lb-proxy/002_create_ingress_lb_address.sh
    

Prepare the cluster configuration files

  1. Connect to the administrative host
  2. [Admin Host] Generate the configuration files
    ${ABMRA_WORK_DIR}/scripts/gcp/lb-proxy/003_generate_conf_files.sh
    
  3. [Admin Host] Prepare the cluster configuration files
    ${ABMRA_WORK_DIR}/scripts/004_prepare_configuration_files.sh
    

Create the clusters

  1. Connect to the administrative host
  2. [Admin Host] Create the clusters
    ${ABMRA_WORK_DIR}/scripts/005_create_clusters.sh
    

Configure Connect Gateway

  1. Connect to the administrative host
  2. [Admin Host] Configure Connect Gateway
    ${ABMRA_WORK_DIR}/scripts/006_configure_connect_gateway.sh
    
  3. Open the URL provided by the script
  4. Verify that all clusters show healthy

Create the ingress load balancers

  1. [Admin Host] Create the ingress load balancer
    ${ABMRA_WORK_DIR}/scripts/gcp/lb-proxy/004_create_ingress_lb.sh
    

Configure Anthos Config Management(ACM)

  1. Connect to the administrative host
  2. [Admin Host] Setup ACM
    ${ABMRA_WORK_DIR}/scripts/007_setup_acm.sh
    
  3. [Admin Host] Verify ACM
    ${ABMRA_WORK_DIR}/scripts/008_verify_acm.sh
    
    Verify the following:
    • Status for each cluster shows SYNCED before proceeding.

      NOTE: Errors may be displayed while the synchronization is in progress.

Configure Anthos Service Mesh(ASM)

  1. Connect to the administrative host

  2. [Admin Host] Setup ASM

    ${ABMRA_WORK_DIR}/scripts/009_setup_asm.sh
    
  3. [Admin Host] Verify ASM

    ${ABMRA_WORK_DIR}/scripts/010_verify_asm.sh
    

    Verify the following:

    • Deployments and Pods are READY.
  4. [Admin Host] Create the ASM load balancer

    ${ABMRA_WORK_DIR}/scripts/gcp/lb-proxy/005_create_asm_lb.sh
    

Deploy the example application

See the Deploy the application guide.

Tear down

To delete all of the resources, the instances and projects can just be deleted. To rollback the environment, the Manual rollback steps can be applied until preferred state is reached.

Delete projects

  1. Open Cloud Shell
  2. [Cloud Shell] Delete the cluster instances
    ${ABMRA_WORK_DIR}/scripts/gcp/995_delete_cluster_instances.sh
    
  3. [Cloud Shell] Delete the administrative host
    ${ABMRA_WORK_DIR}/scripts/gcp/999_delete_admin_instance.sh
    
  4. [Cloud Shell] Delete the GCP projects
    ${ABMRA_WORK_DIR}/scripts/999_delete_gcp_projects.sh
    

Manual rollback

  1. Connect to the administrative host
  2. [Admin Host] Unregister the clusters
    ${ABMRA_WORK_DIR}/scripts/gcp/994_unregister_cluster.sh
    
  3. [Admin Host] Delete the cluster instances
    ${ABMRA_WORK_DIR}/scripts/gcp/995_delete_cluster_instances.sh
    
  4. [Admin Host] Delete the load balancers
    ${ABMRA_WORK_DIR}/scripts/gcp/lb-proxy/999_delete_lbs.sh
    
  5. [Admin Host] Delete the cluster configurations
    ${ABMRA_WORK_DIR}/scripts/gcp/997_delete_cluster_configurations.sh
    
  6. [Admin Host] Delete the Google service accounts
    ${ABMRA_WORK_DIR}/scripts/gcp/998_delete_gsas.sh
    
  7. [Admin Host] Logout of the administrative host
    logout
    
  8. [Cloud Shell] Delete the administrative host
    ${ABMRA_WORK_DIR}/scripts/gcp/999_delete_admin_instance.sh
    
  9. [Cloud Shell] Delete the ACM Cloud Source Repository
    ${ABMRA_WORK_DIR}/scripts/998_delete_acm_csr.sh
    
  10. [Cloud Shell] Delete the GCP projects
    ${ABMRA_WORK_DIR}/scripts/999_delete_gcp_projects.sh