Deploy applications to Container Service for Kubernetes using Eclipse

更新时间:
复制 MD 格式

You can use Cloud Toolkit to quickly deploy applications to Container Service for Kubernetes. This topic describes how to deploy an application from Eclipse to a Container Service for Kubernetes cluster.

Prerequisites

Set up the Docker environment

  1. In the Eclipse toolbar, click the Cloud Toolkit icon and select Preference from the drop-down menu.
  2. In the Preference (Filtered) dialog box, choose Docker > Server from the navigation pane on the left.
  3. On the Server page, configure a connectable Docker environment and click Apply.
    • Local Docker environment:
      • If your local operating system is macOS or Linux, select the Unix Socket check box, click Browse, and select the local Docker installation folder.
      • If your local operating system is Windows, select the TCP Connection check box. In the URI text box, enter the URI of your local Docker, such as http://127.0.0.1:2375.
    • Remote Docker environment: Select the TCP Connection check box. In the URI text box, enter the URI of the remote Docker environment, including the IP address and port. For example, http://x.x.x.x:2375. Make sure that the HTTP service is enabled on the remote host.
    docker

Deploy the application to Container Service for Kubernetes

  1. In the Package Explorer pane on the left side of the Eclipse interface, right-click your Docker application project. From the shortcut menu, choose Alibaba Cloud > Deploy to Registry/Kubernetes > Deploy to Kubernetes.
  2. In the Deploy to CS Kubernetes dialog box, under Select a package method, select the Context Directory and Dockerfile for your local application. These are usually detected and set automatically. Then, click Next.
    ACR and ACK
    Note If needed, select the Use maven build check box to build the application project with Maven.
  3. In the Deploy to CS Kubernetes dialog box, under Select a Repository, select the Type, Region, Namespace, and Image Repository for Container Registry, and then click Next. For more information about image repository deployment, see Deploy an application to an image repository using Eclipse.
    eclipse deploy to kubernetes
    Note If you do not have an image repository, click Create a new repositories in the upper-right corner of the dialog box to go to the Container Registry console and create one. For more information about how to create an image repository, see Container Registry.
  4. In the Deploy to CS Kubernetes dialog box, under Deploy Project to CS Kubernetes, configure the parameters for the container service deployment and click Finish.
    deploy to cs kubernetes

    The following table describes the container deployment parameters.

    Parameter Description
    Deployment Kubernetes Type Select Alibaba Cloud Kubernetes to deploy to Alibaba Cloud Container Service for Kubernetes.
    Region Select a region.
    Cluster Select a cluster.
    Namespace Select a namespace.
    Note If you do not have a container service, click Create a new Kubernetes deployment in the upper-right corner of the dialog box to go to the Container Service console and create one. For more information, see Create an ACK managed cluster.

Verify the results

After the deployment starts, deployment logs are displayed in the Console area of Eclipse. You can check the deployment result in the logs.

If you have questions while using Cloud Toolkit, contact us.