If you use Alibaba Cloud Container Service for Kubernetes, you can use Cloud Toolkit to quickly deploy applications. This topic describes how to use Cloud Toolkit to deploy an application from IntelliJ IDEA to Container Service for Kubernetes.
Prerequisites
- You have installed and configured Cloud Toolkit. For more information, see Install and configure Cloud Toolkit in IntelliJ IDEA.
- You have created an image repository in the Container Registry console and an application from an image. For more information, see Create an image repository and Create an application from an image.
Set up the Docker environment
- In the top menu bar of IntelliJ IDEA, click .
- In the Settings dialog box, choose in the navigation pane on the left.
- On the Docker page, configure the Docker environment. You can connect to a local or remote environment. Then, click OK.
- Local Docker environment:
- If your local operating system is macOS or Linux, select Unix Socket. Then, in the Location text box, enter unix:///var/run/docker.sock.
- If your local operating system is Windows, select TCP Connection. Then, in the URI text box, enter the URI of your local Docker, such as http://127.0.0.1:2375.
- Remote Docker environment: Select TCP Connection. In the URI text box, enter the URI of the remote Docker environment, including the IP address and port, such as http://x.x.x.x:2375. Make sure that the HTTP service is enabled on the remote host.

- Local Docker environment:
Deploy the application to Container Service for Kubernetes
- Open your project in IntelliJ IDEA.
- In the top menu bar of IntelliJ IDEA, choose .
- In the Deploy to Kubernetes dialog box, configure the following parameters.
- On the Image tab, configure the Build Image and Image Repositories parameters.
Image tab.Parameter Description Name The name of the deployment. Use an English name. Build Image - Context Directory: The context folder.
- Dockerfile: The Dockerfile.
- Version: The image version number.
Image Repositories Select the region, namespace, and image repository of Container Registry. - Alibaba Cloud Container Registry: an Alibaba Cloud image repository. For more information, see Deploy an application to ACR.
- Custom Container Registry: a self-managed image repository. For more information, see Deploy an application to another image repository.
Note Context Directory and Dockerfile are usually detected and set automatically from your local application project. - On the Container tab, configure the Kubernetes Type, Controller Type, Controller, and Container parameters.
Container tab.Parameter Description Kubernetes Type Select Alibaba Cloud Kubernetes. This deploys the application to Alibaba Cloud Container Service for Kubernetes. Controller Type - Deployment: For stateless applications.
- StatefulSet: For stateful applications.
Controller Select the region, namespace, and corresponding application. Container Select the corresponding container.
- On the Image tab, configure the Build Image and Image Repositories parameters.
- Click Apply, and then click Run.
Verify the result
When the deployment starts, logs are displayed in the Console area of IntelliJ IDEA. Check the logs to verify the deployment result.
If you have any questions while using Cloud Toolkit, contact us.
该文章对您有帮助吗?