Method 2: Opening a CCE Workload by Importing It
- Import a CCE workload.
- Go to the APIG console, and choose Gateways in the navigation pane.
- Choose API Management > API Groups.
- Choose Create API Group > Import CCE Workload.
- Enter information about the CCE workload to import.
Table 1 Workload information Parameter
Description
Group
Group to which the CCE workload belongs. Default: New group.
Cluster
Select the created cluster.
Namespace
Select a namespace in the cluster. In this example, select default.
Workload Type
Select Deployment. This parameter must be the same as the type of the created workload.
Service Label Key
Select the pod label app and its value deployment-demo of the created workload.
Service Label Value
Tag
Another pod label version=v1 of the workload is automatically selected.
- Configure API information.
Table 2 API information Parameter
Description
Protocol
API request protocol. HTTPS is selected by default.
Request Path
API request path for prefix match. Default: /. In this example, retain the default value.
Port
Enter 80. This must be the same as the container port in the workload.
Authentication Mode
Default: None. (None: Not recommended for actual services. All users will be granted access to the API.)
CORS
Disabled by default.
Timeout (ms)
Backend timeout. Default: 5000.
- Enter information about the CCE workload to import.
- Click OK. The CCE workload is imported, with an API group, API, and load balance channel generated.
- View the generated API and load balance channel.
- View the generated API.
- Click the API group name, and then view the API name, request method, and publishing status on the APIs tab.
- Click the Backend Configuration tab and view the bound load balance channel.
- View the generated load balance channel.
- Choose API Management > API Policies.
- On the Load Balance Channels tab, click the channel name to view details.
- Check that this load balance channel is the one bound to the API, and then go to the next step. If it is not, repeat 1.
- View the generated API.
- Open the API.
Since importing a CCE workload already creates an API group and API, you only need to publish the API in an environment.
- Debug the API.
On the APIs tab, click Debug. Click the Debug button in red background. If the status code 200 is returned in the response result, the debugging is successful. Then go to the next step. Otherwise, rectify the fault by following the instructions provided in Error Codes.
- Publish the API.
On the APIs tab, click Publish Latest Version, retain the default option RELEASE, and click OK. When the exclamation mark in the upper left of the Publish button disappears, the publishing is successful. Then go to the next step.
- Debug the API.
- Call the API.
- Bind independent domain names to the group of this API.
On the group details page, click the Group Information tab. The debugging domain name is only used for development and testing and can be accessed 1,000 times a day. Bind independent domain names to expose APIs in the group.
Click Bind Independent Domain Name to bind registered public domain names. For details about how to bind a domain name, see Binding a Domain Name.
- Copy the URL of the API.
On the APIs tab, copy the API URL. Open a browser and enter the URL. When the defined success response is displayed, the invocation is successful.
Figure 1 Copying the URLNow, the CCE workload has been opened by importing it.
- Bind independent domain names to the group of this API.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot