If you have a self-managed Kubernetes cluster, you can use Cloud Toolkit to quickly deploy applications. This topic describes how to use Cloud Toolkit in IntelliJ IDEA to deploy an application to your cluster.
Prerequisites
- Cloud Toolkit is installed and configured. For more information, see Install and configure Cloud Toolkit in IntelliJ IDEA.
- An image repository has been created in the Container Registry console, and an application has been created 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 IntelliJ IDEA toolbar, click .
- In the Settings dialog box, choose in the navigation pane on the left.
- On the Docker page, configure a local or remote Docker environment, and then click OK.
- Local Docker environment:
- If your local operating system is macOS or Linux, select the Unix Socket check box, and then enter unix:///var/run/docker.sock in the Location
- If your local operating system is Windows, select the TCP Connection check box, and then enter the URI of your local Docker environment in the URI text box, such as http://127.0.0.1:2375.
- Remote Docker environment: Select the TCP Connection check box, and enter the URI of the remote Docker environment in the URI text box, such as http://x.x.x.x:2375. Make sure that the HTTP service on the remote host is enabled.

- Local Docker environment:
Deploy an application to a self-managed Kubernetes cluster
- 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 directory.
- 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 parameters are typically detected and set automatically based on your local application project. - On the Container tab, configure the Kubernetes Type, Kubeconfig, Controller Type, Controller, and Container parameters.
Container tab.Parameter Description Kubernetes Type Select Custom Kubernetes to deploy the application to a self-managed Kubernetes cluster. Kubeconfig Select the custom deployment file. Controller Type - Deployment: For stateless applications.
- StatefulSet: for a stateful application.
Controller Select the region, namespace, and application. Container Select the 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.
该文章对您有帮助吗?