Help Center> Software Repository for Container> Getting Started> Pulling an Image to Deploy an Application in a CCE Cluster
Updated on 2024-06-18 GMT+08:00

Pulling an Image to Deploy an Application in a CCE Cluster

You can use an image to quickly deploy a single-pod workload that can be accessed from the public network. This section describes how to use an image to deploy Nginx in a CCE cluster.

Prerequisites

You have a CCE cluster that contains at least one node with 4 vCPUs and 8 GiB memory. The node is bound with an EIP.

Deploying an Application

  1. Log in to the CCE console.
  2. Click the name of the target cluster to access the cluster console.
  3. In the navigation pane, choose Workloads. Then, click Create Workload.
  4. Configure the following parameters and retain the default value for other parameters:

    Basic Info

    • Workload Type: Select Deployment.
    • Workload Name: Set it to nginx.
    • Namespace: Select default.
    • Pods: Set the quantity of pods to 1.

    Container Settings

    In the Container Information area, click Basic Info and click Select Image. In the dialog box displayed, click the Open Source Images tab, search for nginx, and select the nginx image.

    Figure 1 Selecting the nginx image

    Service Settings

    Click the plus sign (+) to create a Service for accessing the workload from an external network. This example shows how to create a LoadBalancer. Configure the following parameters in the window that slides out from the right:

    • Service Name: Enter nginx. The name of the Service is exposed to external networks.
    • Service Type: Select LoadBalancer.
    • Service Affinity: Retain the default value.
    • Load Balancer: If a load balancer is available, select an existing load balancer. If not, select Auto create to create one.
    • Ports:
      • Protocol: Select TCP.
      • Service Port: Set this parameter to 8080, which is mapped to the container port.
      • Container Port: port on which the application listens. For containers created using the nginx image, set this parameter to 80. For other applications, set this parameter to the port of the application.
    Figure 2 Creating a Service

  5. Click Create Workload.

    Wait until the workload is created.

    The created Deployment will be displayed on the Deployments tab.

    Figure 3 Workload created successfully