arrow-left

All pages
gitbookPowered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

Step 3: Create a Service

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.

hashtag
Prerequisites

Before creating a Service, verify that you accomplished the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:

  • An exist, both with the name that you chose.

  • The Infrastructure has .

  • A Tenant with the .

hashtag
Select the Tenant you created

In the Tenant list box, on the upper-left side of the DuploCloud Portal, select the Tenant that you created.

hashtag
Adding a Service

  1. In the DuploCloud Portal, navigate to Kubernetes -> Services. The Services page displays.

  2. Click Add. The Add Service page displays.

  3. In the Service Name field, enter a name for the service (in the example below, the name is "myservice").

  1. Click Next. The Advanced Options page is displayed.

  2. At the bottom of the Advanced Options page, click Create. Your Service is created and initialized.

circle-info

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.

hashtag
Checking your work

From the DuploCloud portal, navigate to Kubernetes -> Services, and verify that your DuploCloud Service has a Current status of Running.

In the Docker image field, enter the docker image (nginx:latest).

Infrastructure and Plan
GKE Enabled
name you chose has been created
The Kubernetes, Add Service page.
The Services page showing the running Service

Step 4: Create a Load Balancer

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.

hashtag
Prerequisites

Before creating a Load Balancer, verify that you accomplished the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:

  • An exist, both with the name you created.

  • The Infrastructure you created has .

  • A with the name you chose has been created.

hashtag
Select the Tenant you created

In the Tenant list box, on the upper-left side of the DuploCloud Portal, select the Tenant that you created.

hashtag
Creating a Load Balancer

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.

  1. In the DuploCloud Portal, navigate to Kubernetes -> Services. The Services page displays.

  2. From the Name column, click on the name of your Service

  3. Click the Load Balancers tab.

hashtag
Checking your work

  1. From the DuploCloud portal, navigate to Kubernetes -> Services.

  2. Click on the name of your Service.

  3. Verify that the Load Balancer has a status of Ready on the LB Status card.

A with the name you chose has been created.

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.

  • In the Health Check field, enter / (forward-slash) to indicate that Kubernetes should check the health of the service at the root of the application.

  • In the Backend Protocol list box, select HTTP. HTTP is used for this tutorial since we are not setting up SSL certificates. However, using HTTPS to encrypt data between the user and the server when configuring Load Balancers is highly recommended. If you decide to use HTTPS, you must .

  • Certificates: You can leave this field empty, as SSL certificates are not necessary for this tutorial. However, we recommend using SSL certificates with Load Balancers to ensure secure HTTPS connections. If you'd like to add SSL certificates for your domain later, follow the instructions .

  • 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.

  • Infrastructure and Plan
    GKE Enabled
    Tenant
    The Service details page with the LB Ready Status highlighted
    Service
    configure SSL certificates
    here
    The Add Load Balancer Listener pane

    Create a Service with GKE Autopilot

    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:

    • Creating a DuploCloud Service using GCE's GKE Standard.

    For a comparison of the benefits of GKE Autopilot vs. GKE Standard, consult this .

    Estimated time to complete remaining tutorial steps: 15-20 minutes

    hashtag
    Deploying a GKE Standard Service in DuploCloud

    For the remaining steps in this tutorial, you will:

    1. Create a Service and applications (webapp) using the premade Docker image nginx:latest.

    2. Expose the Service by creating and sharing a load balancer and DNS name.

    3. Test the application.

    Google Cloud articlearrow-up-right

    Step 5: Test the Application

    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.

    hashtag
    Prerequisites

    Before creating a Load Balancer, verify that you accomplished the tasks in the previous tutorial steps. Using the DuploCloud Portal, confirm that:

    • An exist, both with the name you created.

    • The Infrastructure you created has .

    • A with the name you chose has been created.

    • A with the name you chose has been created.

    • An has been created.

    hashtag
    Select the Tenant you created

    In the Tenant list box, on the upper-left side of the DuploCloud Portal, select the Tenant that you created.

    hashtag
    Testing the Application

    1. In the DuploCloud Portal, navigate to Kubernetes -> Services. The Services page displays.

    2. From the Name column, click on the Service you created.

    3. Click the Load Balancers tab. The Application Load Balancer configuration is displayed.

    1. Open a browser instance and Paste the IP Address in the URL field of your browser.

    2. Press ENTER. A web page with the text Welcome to nginx! is displayed.

    Congratulations! You have just launched your first web service on DuploCloud!

    In the LB Configuration card, click the Copy Icon ( ) to copy the IP Address to your clipboard.
    Infrastructure and Plan
    GKE Enabled
    Tenant
    Service
    Application Load Balancer