Finish the Quick Start Tutorial by creating a Service using GKE Autopilot
In this tutorial for DuploCloud AWS, you have so far created a VPC network with configuration templates (Infrastructure and Plan) and an isolated workspace (Tenant).
Now you need to create a DuploCloud Service on top of your Infrastructure and configure the Service to run and deploy your application. In this tutorial path, we'll deploy using Docker containers, leveraging Google Cloud Platform's (GCE) Google Kubernetes Engine (GKE) Autopilot.
Alternatively, you can finish this tutorial by:
For a comparison of the benefits of GKE Autopilot vs. GKE Standard, consult this Google Cloud article.
Estimated time to complete remaining tutorial steps: 15-20 minutes
For the remaining steps in this tutorial, you will:
Create a Service and applications (webapp) using the premade Docker image nginx:latest.
Expose the Service by creating and sharing a load balancer and DNS name.
Test the application.
Creating a Load Balancer to configure network ports to access the application
Now that your DuploCloud Service is running, you have a mechanism to expose the containers and images in which your application resides. But because your containers are running inside a private network, you also need a load balancer to listen on the correct ports in order to access the application.
In this step, we add a Load Balancer Listener to complete this network configuration.
Estimated time to complete Step 4: 10 minutes.
Before creating a Load Balancer, verify that you accomplished the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:
An Infrastructure and Plan exist, both with the name you created.
The Infrastructure you created has GKE Enabled.
A Tenant with the name you chose has been created.
A Service with the name you chose has been created.
In the Tenant list box, on the upper-left side of the DuploCloud Portal, select the Tenant that you created.
All containers are running inside a private network and cannot be accessed from an external network. To do so one can create a load balancer.
In the DuploCloud Portal, navigate to Kubernetes -> Services. The Services page displays.
From the Name column, click on the name of your Service
Click the Load Balancers tab.
Click the Configure Load Balancer link. The Add Load Balancer Listener pane displays.
From the Type list box, select Application LB.
In the Container Port field, enter 80. This is the configured port on which the application inside the Docker Container Image is running.
In the External Port field, enter 80. This is the port through which users will access the web application.
From the Visibility list box, select Public.
From the Application Mode list box, select Docker Mode.
Type / (forward-slash) in the Health Check field to indicate that the cluster we want Kubernetes to perform Health Checks on is located at the root
level.
In the Backend Protocol list box, select HTTP.
Click Add. The Load Balancer is created and initialized. In approximately 2-3 minutes you will see the load balancer details available in the portal. When the Load Balancer is ready for use the LB Status card displays Ready.
From the DuploCloud portal, navigate to Kubernetes -> Services.
Click on the name of your Service.
Verify that the Load Balancer has a status of Ready on the LB Status card.
Test the application to ensure you get the results you expect
You can test your application directly from the Services page.
Estimated time to complete Step 5 and finish tutorial: 10 minutes.
Before creating a Load Balancer, verify that you accomplished the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:
An Infrastructure and Plan exist, both with the name you created.
The Infrastructure you created has GKE Enabled.
A Tenant with the name you chose has been created.
A Service with the name you chose has been created.
An Application Load Balancer has been created.
In the Tenant list box, on the upper-left side of the DuploCloud Portal, select the Tenant that you created.
In the DuploCloud Portal, navigate to Kubernetes -> Services. The Services page displays.
From the Name column, click on the Service you created.
Click the Load Balancers tab. The Application Load Balancer configuration is displayed.
In the LB Configuration card, click the Copy Icon ( ) to copy the IP Address displayed to your clipboard.
Open a browser instance and Paste the IP Address in the URL field of your browser.
Press ENTER. A web page with the text Welcome to nginx! is displayed.
Congratulations! You have just launched your first web service on DuploCloud!
Creating a Kubernetes Service to run a Docker-containerized application
In this exercise, we will create a simple Google Cloud Nginx service. When you run the application, DuploCloud accesses Docker images in a preconfigured Docker Hub.
When you run your own applications, you will choose a public image or provide credentials to access your private repository. Before you deploy your own applications, configure your Docker Registry credentials in DuploCloud.
Estimated time to complete Step 3: 10 minutes.
Before creating a Service, verify that you accomplished the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:
An Infrastructure and Plan exist, both with the name that you chose.
The Infrastructure has GKE Enabled.
A Tenant with the name you chose has been created.
In the Tenant list box, on the upper-left side of the DuploCloud Portal, select the Tenant that you created.
In the DuploCloud Portal, navigate to Kubernetes -> Services. The Services page displays.
Click Add. The Add Service page displays.
In the Service Name field, enter a name for the service (in the example below, the name is "myservice").
In the Docker image field, enter the docker image (nginx:latest
).
Click Next. The Advanced Options page is displayed.
At the bottom of the Advanced Options page, click Create. Your Service is created and initialized.
It may take approximately five (5) minutes for the Service to initialize. Use the Containers page (Kubernetes -> Containers) to monitor the Service creation status, between Desired (Running) and Current.
From the DuploCloud portal, navigate to Kubernetes -> Services, and verify that your DuploCloud Service has a Current status of Running.