All Products
Search
Document Center

Container Service for Kubernetes:Deploy a web application using NGINX on ACK Serverless

Last Updated:Mar 17, 2026

ACK Serverless clusters remove the need to provision or manage nodes. You can deploy containerized workloads without handling node security patches, capacity planning, or infrastructure maintenance — the cluster manages the underlying compute for you.

Important

The resources created in this guide cost approximately USD 0.05 for 30 minutes of use. Delete the resources when you finish to avoid ongoing charges.

Prerequisites

Before you begin, complete the following setup steps in order:

Step 1: Deploy the NGINX application

Choose the deployment method that matches your workflow. Both methods produce the same result: a running NGINX Deployment exposed by a LoadBalancer Service.

Option A: Deploy using the ACK console

1.1 Create the Deployment

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Workloads > Deployments.

  3. On the Deployments page, click Create from Image in the upper-right corner.

  4. On the Basic Information page, set the following parameters, then click Next. Leave all other parameters at their default values.

    Parameter

    Value

    Application Name

    nginx-deploy

    Replicas

    1

  5. On the Container page, set the following parameters, then click Next. Leave all other parameters at their default values.

    Parameter

    Value

    Image Name

    anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/nginx:1.14.1-8.6

    CPU

    1 Core

    Memory

    2 GB

    Port Name

    example-port

    Container Port

    80

    Protocol

    TCP

    Note

    This image is an Anolis OS-based NGINX build optimized for Alibaba Cloud environments. It is functionally equivalent to the standard NGINX image for this tutorial.

1.2 Create and attach a Service

  1. On the Advanced page, click Create next to Service. In the panel that appears, set the following parameters and click OK. Leave all other parameters at their default values.

    Parameter

    Value

    Name

    nginx-deploy-svc-test

    Service Type

    SLB

    SLB Type

    NLB

    Select Resource

    Create Resource

    Port Mapping Name

    example-map

    Service Port

    80

    Container Port

    80

    Protocol

    TCP

  2. Click Create, then click View Details.

1.3 Confirm the Pod is running and get the public IP address

  1. On the details page of the Deployment, click the Pods tab and wait until the Pod status shows Running.

  2. Click the Access Method tab. Copy the public IP address or URL from the External Endpoint field — you will use this to verify the deployment in Step 2.

Option B: Deploy using kubectl

Note

You can run kubectl commands from your local machine or from Alibaba Cloud Shell. If you use Cloud Shell, you do not need to configure a kubeconfig file manually.

1.1 Connect to the cluster

  1. Connect to your ACK Serverless cluster using kubectl. See Connect to a Kubernetes cluster using kubectl.

1.2 Create the manifest

  1. Create a file named nginx.yaml with the following content:

    apiVersion: v1
    kind: Service
    metadata:
      name: nginx-deploy-svc
    spec:
      ports:
      - port: 80
        protocol: TCP
      selector:
        app: nginx
      type: LoadBalancer
    ---
    apiVersion: apps/v1  # Use the API version that corresponds to your Kubernetes version.
    kind: Deployment
    metadata:
      name: nginx-deploy
      labels:
        app: nginx
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: nginx
      template:
        metadata:
          labels:
            app: nginx
        spec:
          containers:
          - name: nginx
            image: anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/nginx:1.14.1-8.6
            ports:
            - containerPort: 80
            resources:
              requests:
                cpu: "1"
                memory: "2Gi"
    Note

    The image anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/nginx:1.14.1-8.6 is an Anolis OS-based NGINX build optimized for Alibaba Cloud environments. It is functionally equivalent to the standard NGINX image for this tutorial.

1.3 Apply the manifest

  1. Run the following command to create the Deployment and Service:

    kubectl apply -f nginx.yaml

    Expected output:

    service/nginx-deploy-svc created
    deployment.apps/nginx-deploy created

1.4 Verify the Deployment is ready

  1. Run the following command to check that the Deployment is fully available:

    kubectl get deploy

    Expected output:

    NAME           READY   UP-TO-DATE   AVAILABLE   AGE
    nginx-deploy   1/1     1            1           9m32s

    The READY column shows 1/1, meaning one of one replicas is running.

1.5 Get the public IP address

  1. Run the following command to list Services and record the external IP address of nginx-deploy-svc:

    kubectl get svc

    Expected output:

    NAME               TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
    kubernetes         ClusterIP      172.XX.X.X     <none>        443/TCP        10d
    nginx-deploy-svc   LoadBalancer   172.19.X.XXX   47.57.XX.XX   80:32278/TCP   39s

    Note the value in the EXTERNAL-IP column for nginx-deploy-svc. The LoadBalancer may take a minute to provision — re-run the command if the field shows <pending>.

Step 2: Verify access to the NGINX application

Open a browser and navigate to the public IP address or URL you recorded in Step 1.

If the NGINX welcome page appears, your application and Service are working correctly.

nginx

Troubleshooting: If the page does not load, check the following:

  • Confirm the Pod status is Running (console) or READY: 1/1 (kubectl).

  • Confirm the EXTERNAL-IP is a routable public address, not <pending>.

  • Verify that the Internet NAT Gateway SNAT entries are correctly configured in your VPC.

What you built

You deployed a single-replica NGINX application on ACK Serverless and exposed it to the internet using a Network Load Balancer (NLB) Service. The cluster provisioned the underlying compute automatically — no nodes were created or managed manually.

This setup is suitable for evaluation and learning. For production workloads, consider adding TLS termination, resource limits, liveness/readiness probes, and Horizontal Pod Autoscaling (HPA).

Next steps

Configure auto scaling — See Configure auto scaling policies for a cluster.

If you do not want to configure auto scaling, you can perform the following steps to release the resources that you created:

Delete the application and Service

  1. In the ACK console, go to the Clusters page and click the name of your cluster.

  2. In the left navigation pane, choose Workloads > Deployments. Select the NGINX application you created, click Batch Delete, and follow the on-screen instructions to confirm.

Delete Clusters

ACK serverless clusters do not incur cluster management fees. However, you are charged for other Alibaba Cloud product resources used with ACK serverless clusters, such as ECI, based on each product’s billing rules. Each product bills separately. After completing the tutorial, handle your clusters as follows:

  • If you no longer need the cluster, go to the Container Service Management Console and open the Clusters page. Locate the target cluster and click More > Delete. In the pop-up panel, read the prompt, select the associated cloud service resources to delete, click Delete, and follow the on-screen instructions to complete the process. For more information, see Delete a cluster.

  • To continue using the cluster, recharge your Alibaba Cloud account promptly to maintain a sufficient balance. To review billing details for other Alibaba Cloud product resources used with ACK serverless clusters Pro Edition, see Billing for cloud product resources.