Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Tasks to perform before you use GCP with DuploCloud.
Typically the DuploCloud onboarding team performs these steps in your GCP project with your permission. These steps need to be performed and are described in detail in the subsequent subsections:
Add Service Account, Key Creation, and Project to the DuploCloud Portal. A single DuploCloud Portal supports multiple GCP projects. Each project is added to DuploCloud, and the DuploCloud platform gives access to the project via Service Account keys.
Create Certificates for Load Balancers and Kubernetes Ingress.
Set up tools for the Tenant, such as enabling kubectl
shell.
Creating a Service Account for DuploCloud GCP and adding a private key
A service account and a key are created for each GCP project to be onboarded.
Login to the and select the desired project.
Open the navigation pane at the top left of the home page ( ), and select IAM & Admin -> Organization Policies.
Filter and search for iam.disableServiceAccountKeyCreation.
Click the options menu ( ) and select Edit policy.
Add a Rule (Rule 1 in the graphic below) to turn off enablement.
In the left navigation pane, click IAM & Admin -> Service Accounts. The Service Accounts page for your project displays.
Click Create Service Account. The Create service account wizard opens.
Complete Service Account Details.
In the Grant this service account access to project step, assign the Owner role as shown below, giving the account owner permission to the project. Complete the wizard, and click Done.
Select the Service Account you created and add a new JSON Key.
Download the JSON file and give it a meaningful name, such as my-gcp-project-sa-key.json
.
Open a Terminal window and navigate to the location of the downloaded JSON file.
Run the following command. This copies the key contents on your clipboard. You can verify the contents by pasting it into a text editor.
To add the private key to DuploCloud:
Login to the DuploCloud and navigate to Administrator -> Cloud Credentials. The Cloud Credentials page displays.
Paste the key in the Service Account Private Key field.
Enter a Display name for easy reference. Ideally, this name should include the project name.
Enter the Project ID and Service Account Email from the JSON key file you downloaded.
Click Submit.
Creating a Route 53 hosted zone to program DNS entries in GCP
The DuploCloud Platform requires a unique GCP Cloud DNS zone to create DNS entries for the services you deploy. The domain must be registered with a domain provider and set in DuploCloud before configuration. We recommend creating a subdomain such as apps.[MY-COMPANY].com
or internal.[my-company].com
.
Never use this subdomain for any other purpose, as DuploCloud owns all CNAME entries in this domain and will remove any entries it does not manage.
Create a DNS Zone in the GCP Console:
Log in to the GCP console.
Select Network Services -> Cloud DNS.
Click Create Zone, as shown below, and note the Zone Name you create. You will need it to add to DuploCloud in a later step.
Access the zone and note the Nameserver names.
Navigate to your root Domain Provider's site (for acme.com
, for example).
Create an NS record that references the domain name of the hosted zone you created (apps.acme.com
), and add the zone name to the Nameservers you noted above.
Provision the zone in every DuploCloud Plan, starting with the Plan created in the previous step.
In the DuploCloud Portal, navigate to Administrator -> Plans.
Select the Plan name from the NAME column.
Select the DNS tab, and click Edit. The Set Plan DNS pane displays.
In the Cloud DNS Zone field, enter the zone name.
In the External DNS Suffix and Internal DNS Suffix fields, enter the domain name, preceded with a dot (.)
Click Submit.
Do not forget the dot (.) at the beginning of the DNS suffix, in the form as shown below.
Note that this domain must be set in each new Plan you create in your DuploCloud Infrastructure.
Set up the initial DuploCloud Infrastructure
Once your GCP project has been added to the DuploCloud Portal, the next step is to set up the first Infrastructure.
From the DuploCloud Portal, navigate to Administrator -> Infrastructure, and click Add.
Give the Infrastructure a Name, e.g., nonprod.
Select the appropriate Account.
Enter the VPC CIDR, e.g., 10.30.0.0/16 (Note: A /16 CIDR block is recommended for Kubernetes to accommodate its IP address requirements).
From the Cluster Mode list box, select GKE Standard.
From the GKE Endpoint Visibility list box, select Public (for production Infrastructures, set visibility to Private).
For the remaining fields, keep the default values.
Click Create. It will take approximately 15 to 20 minutes for the setup to complete. Monitor faults to see if any issues arise (NTP clock sync faults can be ignored).
When the Infrastructure setup is complete, a Plan with the same name as the infrastructure displays on the Plans page (Administrators -> Plans).
Create a DuploCloud Tenant for tools
Once the initial infrastructure setup is complete, the next step is to add a DuploCloud Tenant for tools like kubectl
shell, OpenTelemetry, etc.
Follow the instructions in the DuploCloud documentation to . Name the Tenant Tools, and select the Plan with the same name as the initial Infrastructure you created in the previous step.
A Tools Tenant is not required. You can assign your Tenant(s) any name(s) you wish and/or create separate Tenants for different tools and purposes.
Optional Docker configurations for DuploCloud GCP users
This section includes optional configurations for DuploCloud users managing Docker-based deployments in GCP. These configurations help optimize workflows and ensure containerized applications are securely managed and efficiently deployed. It includes two subsections:
: This page explains how to configure credentials for external Docker registries such as Docker Hub, Amazon ECR, or private repositories.
: This section guides Native Docker users through setting up a Docker shell to access the command-line interface for building, running, and managing containers.
For Docker Native users, setting up shell access for Docker enables you to run Docker commands, build, push, and pull images, and manage containers deployed in GCP. Configuring shell access helps ensure that your GCP environment, integrated with DuploCloud, is fully equipped to handle container operations.
This is only for users. If you are using Kubernetes, skip this step.
In the DuploCloud Portal, navigate to Docker -> Services. The Services page displays.
Click the Docker button, and select Enable Docker Shell. The Start Shell Service pane displays.
From the Platform list box, select Docker Native.
From the Certificate list box, select the certificate name.
From the Visibility list box, select Public.
Click Update. DuploCloud provisions a Service named dockerservices-shell
, enabling you to access your containers using SSH.
Set up and connect to the VPN for DuploCloud GCP users
Configure and implement secure VPN connections using OpenVPN. These configurations help optimize network security and ensure you can securely access your cloud resources. It includes two subsections:
: This page outlines the two-step process for setting up OpenVPN, including accepting the OpenVPN agreement in the GCP Marketplace and provisioning a VPN in the DuploCloud Portal.
: This section guides users through connecting to the provisioned VPN, enabling secure communication between local environments and cloud resources.
Enable access to the DuploCloud shell for your GCP account
Enabling kubectl shell access in GCP is part of a one-time DuploCloud Portal setup process.
In the Tenant list box, select the Tools Tenant.
Navigate to Kubernetes -> Nodes.
Select the Node Pool tab, and click Add.
Complete the required fields, and click Create.
Once the node pool is complete, it will display on the GCP VM tab with a status of Running.
In the Tenant list box, select the Tools Tenant.
Navigate to Kubernetes -> Services.
Click Add. The Add Service page displays.
From the table below, enter the values that correspond to the fields on the Add Service page. Accept default values for fields not specified.
In the Environment Variables field, enter the following YAML. Replace the flask app secret (b33d13ab-5b46-443d-a19d-asdfsd443 in this example) with a string of random numbers and letters in the same format and replace CUSTOMER_PREFIX with your customer URL prefix.
Click Next. The Advanced Options page displays.
Click Create. The Service is created.
Navigate to Kubernetes -> Services.
Select the kubectl Service from the NAME column.
Select the Load Balancers tab, and click Configure Load Balancer. The Add Load Balancer Listener pane displays.
In the Select Type list box, select K8s Cluster IP.
In the Container port and External port fields, enter 80.
In the Health Check field, enter /duplo_auth.
In the Backend Protocol list box, select TCP
Select Advanced Kubernetes settings and Set HealthCheck annotations for Ingress.
Click Add. The Load Balancer listener is added.
In the Tenant list box, select the Tools Tenant.
Navigate to Kubernetes -> Ingress.
Click Add. The Add Kubernetes Ingress page displays.
In the Ingress Name field, enter kubect-shell
.
From the Ingress Controller list box, select gce.
In the Visibility list box, select Public.
In the DNS Prefix field, enter the DNS name prefix.
In the Certificate ARN list box, select the ARN added to the Plan in the Certificate for Load Balancer and Ingress step.
Click Add Rule. The Add Ingress Rule pane displays.
In the Path field, enter (/)
In the Service Name list box, select the Service previously created (kubectl:80)
Click Add Rule. A rule directing all traffic to the kubectl Service is created.
13. On the Add Kubernetes Ingress page, click Add. The Ingress is created.
Navigate to Administrator -> Systems Settings.
Select the System Config tab, and click Add. The Add Config pane displays.
From the Config Type list box, select AppConfig.
From the Key list box, select Other.
In the second Key field, enter DuploShellfqdn
In the Value field, paste the Ingress DNS. To find the Ingress DNS, navigate to Kubernetes -> Ingress, and copy the DNS from the DNS column.
Click Submit. kubectl
shell access is enabled.
Add Service page field | Value |
---|
Name |
|
Cloud |
|
Platform |
|
Docker Image |
|
Set up Docker Registry credentials for external registry users
If you use an external Docker registry (outside of Google’s own GCR or GAR) like Docker Hub, Amazon ECR, or private registries, you must configure Docker registry credentials. This step ensures that your GCP environment has the proper authentication to access images from an external registry, preventing unauthorized access or image pull failures.
This step is only needed if you are using an external non-GCR registry.
In the DuploCloud Portal, navigate to Docker -> Services.
From the Docker list box, select Docker Credentials. The Set Docker registry Creds pane displays.
Enter your Docker credentials (Username, Password, and Email), and click Submit. The Docker registry credentials are passed to the Kubernetes cluster as a kubernetes.io/dockerconfigjson
secret.
Pull images from multiple Docker registries by adding multiple Docker Registry Credentials.
In the DuploCloud Portal, click Administrator -> Plan. The Plans page displays.
Select the Plan name from the NAME column.
Select the Config tab, and click Add. The Add Config pane displays.
In the Config Type list box, select DockerRegistryCreds.
In the Name field, enter the registry name.
In the Value field, enter your registry credentials.
Click Submit.
Create regional or global SSL certificates for GCP using Certificate Manager
If you followed the step Certificate for Load Balancer, skip this step.
SSL certificates secure connections between clients, servers, and Load Balancers by encrypting data transmitted over the network using Transport Layer Security (TLS). GCP provides two primary methods for configuring SSL certificates: Compute Engine SSL Certificates and Certificate Manager (using certificate maps). While DuploCloud supports both methods, we recommend Certificate Manager whenever possible. This approach is preferable because Compute Engine certificates cannot be validated until associated with a Load Balancer, potentially leading to downtime. In contrast, certificate maps can be validated in advance, helping to ensure consistent uptime and a smoother management experience.
Obtain public and private certificate files from your chosen SSL certificate provider, such as GoDaddy or Namecheap.
Create a DNS authorization resource using the following command where YOUR_DOMAIN is your domain URL and MAP_NAME is your certificate name (a unique name you choose for your certificate map).
Manually create the DNS records shown in the output of the list
command. You'll usually do this in the certificate's domain zone in the Cloud DNS service for the same project, but it depends on how you set up DNS.
Create the certificate:
Create the certificate map and its entries:
Add the certificate map to the DuploCloud Plan. Navigate to Administrator -> Plans. Select the Certificates tab and click Add. The Add a Certificate pane displays.
In the Name field, create a name for the certificate (the name is arbitrary as it is only a display name to be used within DuploCloud).
In the GCP Certificate Type list box, select the certificate type. The certificate type must match the certificate entered in the gcloud certificate-manager maps entries create
command.
In the GCP Certificate Map field, enter the name of your map (in this example, MAP_NAME).
Click Create. The certificate can now be used with your DuploCloud Services.
Set up a Docker Registry image repository
Create a docker image repository in GCP's Artifact Registry service and push an image to it.
Install and configure the gcloud
CLI.
Run gcloud info
and confirm it shows your email address and GCP project.
These steps are written as an example for the qa-gcp3
project using the us-east1
location.
Navigate Google Cloud Console and create a repository with the following inputs:
Type: Docker
Mode: Standard
Location: Unless you know you need multiple regions, use the same region as your Duplo portal.
Encryption: Google-managed encryption key
Immutable tags: Enabled (this isn't required, but it's a common good practice)
Cleanup policies: Dry run
Copy the repo path from the Google UI. This will be used to tag the image later. The path will look similar to this: us-east1-docker.pkg.dev/qa-gcp3/testrepo
.
Now you can tag and push any image you build. On some platforms (like Apple M1 laptops), you may need to specify a build architecture.
Authenticate Docker with GCP:
gcloud auth configure-docker us-east1-docker.pkg.dev
Build an image:
docker build --platform linux/amd64 . -t testimage:amd64
Add a tag to the image that includes the repo path from above:
docker tag testimage:amd64 us-east1-docker.pkg.dev/qa-gcp3/testrepo/testimage:amd64
(Alternatively, you can add this tag with -t
flags in the build step.)
Push the image:
docker push us-east1-docker.pkg.dev/qa-gcp3/testrepo/testimage:amd64
The image tag displays in the GCP UI:
Enter the image tag in the Docker Image field of any DuploCloud Service running in the same GCP account. Use the full path and tag (the arguments to the push
command) as shown below.
Create global and regional SSL certificates for GCP deployments
Applications deployed in the GCP environment must be exposed using SSL/TLS. To expose these applications, we provide GCP with certificates that can be used for Load Balancers and GKE ingress. In this step, we'll create an SSL certificate for the domain associated with the hosted zone you created earlier.
Obtain the public and private certificate files from your chosen SSL certificate provider, such as GoDaddy or Namecheap. We recommend obtaining a wildcard SSL certificate for the domain associated with your hosted zone (e.g., .apps.acme.com) to cover all subdomains. For example, if your DNS zone is for apps.acme.com
, you should issue a wildcard certificate for *.apps.acme.com
to secure all subdomains.
Create global and regional SSL certificates in the GCP Console using the Classic Certificates method.
Alternatively, you can use the Certificate Manager to create a Certificate Map for managing SSL certificates, which provides a more streamlined and validated approach. For details, see the instructions for creating a Certificate Map.
Log in to the GCP Console.
Navigate to Certificate Manager, and click Classic Certificates.
Click on Create SSL Certificate.
Provide the certificate with a name and upload the public and private key certificate files obtained in the prerequisite.
As a best practice, name the certificate global-<DNS Domain name>
, where the dots (.
) are replaced with hyphens (-
). For example, if your domain is example.com
, name the certificate global-example-com
.
Note the name of the global certificate for use in future steps.
From the GCP Console, open the GCP Cloud Shell by clicking on the Cloud Shell icon in the top right corner.
Once the Cloud Shell opens, create the following files:
public.cert
Paste the content of the public certificate into this file.
private.key
Paste the content of the private key into this file.
Run the following command to create a regional SSL certificate:
As a best practice, name the certificate using the format <region>-<DNS Domain name>
, where the dots (.
) in the domain name are replaced with hyphens (-
). For example, for the us-central
region and domain acme.com
, the certificate should be named uscentral1-internal-acme-com
.
After running the command, refresh the Classic Certificates page in the GCP Console. Both global and regional certificates should now be listed.
Note the certificate names for use in future steps.
Add multiple domains to the SSL certificate. This is especially useful for domain names that differ from the internal zone you set up in the previous step. This allows you to secure your primary domain and any other domains you may use for your applications or services.
Log in to the DuploCloud Portal.
Navigate to Administrator -> Plans.
Select the Certificates tab, and click Add.
Add the global and regional certificates, one at a time You can name them the same names you used in the GCP portal. For each certificate, choose the type LB SSL Certificate.
Click Create. The GCP certificates are added to your DuploCloud Portal.
Connect to the DuploCloud VPN with the OpenVPN client
DuploCloud integrates with OpenVPN by automatically provisioning VPNs for users added through the DuploCloud Portal. As a DuploCloud user, you can securely access resources within the private network by connecting via the OpenVPN client.
The OpenVPN Access Server only forwards traffic intended for resources within DuploCloud-managed private networks. Traffic to external internet resources does not pass through the VPN tunnel.
Click on your user name in the upper right corner of the DuploCloud Portal, and select Profile. Your Profile page displays.
VPN credentials are displayed in the VPN Details area of the Profile page.
Click on your user name in the upper right corner of the DuploCloud Portal, and select Profile. Your Profile page displays.
Click the VPN URL link in the VPN Details section. Browsers may call the link unsafe since it is using a self-signed certificate. Proceed to it anyway.
Log in to the OpenVPN Access Server portal using the credentials from your Profile page.
Click on the OpenVPN Connect Recommended for your device link to install the OpenVPN Connect application on your local machine.
Click the link labeled Yourself (user-locked profile) to download your OpenVPN user profile.
Open the .ovpn file and click OK in the Import .ovpn profile dialog.
Click Connect. The OpenVPN user profile and client app are set up.
Integrate DuploCloud with OpenVPN by provisioning VPNs for users
DuploCloud integrates with OpenVPN by provisioning VPNs for users added through the DuploCloud Portal. The OpenVPN setup involves a two-step process: accepting the OpenVPN agreement in the GCP Marketplace, and Provisioning a VPN in the DuploCloud Portal.
Accept the OpenVPN Free Tier (Bring Your Own License) agreement in the GCP marketplace:
Log into your GCP account.
In the Google Cloud Console, navigate to the Marketplace.
Search for OpenVPN in the Marketplace.
Select the product (OpenVPN Free Tier) and accept the agreement.
In the DuploCloud Portal, navigate to Administrator -> System Settings.
Select the VPN tab.
Click Provision VPN. Behind the scenes, DuploCloud launches a cloud formation script to provision the OpenVPN. OpenVPN is ready to use.
You can find the OpenVPN admin password in the cloud formation stack in your GCP console.
In the DuploCloud Portal, navigate to Administrator -> Users.
Click Add. The Create User pane displays.
Enter the username in the Username field.
In the Roles field, select the appropriate role(s) for the user.
Select Provision VPN.
Click Submit.
See Deleting a VPN user. To delete VPN access, you must have administrator privileges.
By default, users connected to a VPN can SSH or RDP into virtual machines (VMs). Users can also connect to internal Load Balancers and application endpoints. However, you must open a VPN port to connect to other Services, such as databases and ElastiCach.
In the DuploCloud Portal, navigate to Administrator -> Tenants.
Select the Tenant in the NAME column.
Select the Security tab.
Click Add. The Add Tenant Security pane displays.
In the Source Type field, select Ip Address.
In the IP CIDR field, enter the VPN IP address range in CIDR notation, for example, 10.0.0.0/24
or 192.168.1.0/24
.
In the Protocol list box, select the protocol you wish to allow through the VPN port.
Enter the range in the Port Range field, specify the port or range of ports that need to be opened.
Enter a brief description of the security rule being added in the Description field.
Click Add. The VPN port is open.