Deploy an application to a self-managed Kubernetes cluster from Eclipse

更新时间:
复制 MD 格式

This topic describes how to use Cloud Toolkit in Eclipse to deploy an application to a self-managed 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 view, right-click your Docker application project and select Alibaba Cloud > Deploy to Registry/Kubernetes > Deploy to Kubernetes from the menu.
  2. In the Deploy to CS Kubernetes dialog box, on the Select a package method page, select the Context Directory and Dockerfile for your local application, and then click Next.
    ACR and ACK
    Note You can select the Use maven build check box to build the application project using Maven.
  3. In the Deploy to CS Kubernetes dialog box, on the Select a Repository page, select the Type, Region, Namespace, and Image Repository for Container Registry, and then click Next. For more information about how to deploy to an image repository, see Deploy an application to an image repository from Eclipse.
    eclipse deploy to kubernetes
    Note If you do not have an image repository, click Create a new repository in the upper-right corner of the dialog box to go to the Container Registry console and create one. For more information, see Container Registry.
  4. In the Deploy to CS Kubernetes dialog box, on the Deploy Project to CS Kubernetes page, configure the deployment parameters for the container service, and then click Finish.
    deploy to cs kubernetes

    The following table describes the container deployment parameters.

    Parameter Description
    Deployment Kubernetes Type Select Custom Kubernetes to deploy the application to a self-managed Kubernetes cluster.
    KubeConfig Select the KubeConfig file for the self-managed deployment.
    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.