- Documentation
Volcengine Kubernetes Engine
Volcengine Kubernetes Engine
User guide
Networking
Ingress
APIG Ingress
Configuring HTTPS for the APIG Ingress
APIG Ingress
Configuring HTTPS for the APIG Ingress
Configuring HTTPS for the APIG Ingress
To ensure communication security in public networks, HTTPS is typically used for communication when services are exposed to public networks through Ingresses. This topic describes how to configure HTTPS for an APIG Ingress.
- You have already purchased a Secure Sockets Layer (SSL) certificate and key in Volcano Engine SSL Certificate Service or created an SSL certificate and key by using OpenSSL.
Step 1: Configure a Secret
- The SSL certificate and key have been obtained. This topic takes tls.key and tls.crt as an example.
- Run the following command to create a Secret named ingress-secret of type kubernetes.io/tls.
Step 2: Deploy an application and service
- Create the YAML file of a workload. The code of the sample file deployment-demo.yaml is as follows:
- Run the following command to create the workload.
- Create a YAML file for the Service. The following code is the content of a sample YAML file named service-demo.yaml.
- Execute the following command to create a service.
Step 3: Configure the APIG Ingress
Creating through the console
Creating through kubectl
- In the left navigation bar, click Cluster. Click the name of the target cluster to go to the cluster management page.
- In the left navigation bar, click Services and Ingresses > Ingress, and click Create Ingress.
- Select Automatically create or Use existing for the Gateway specifications parameter. This topic uses an existing APIG instance as an example.
- Select HTTPS for the Protocol parameter and select the configured Secret for the Certificate parameter.
- In the Forwarding rules section, specify the domain name, path, and back-end service related to forwarding.
- Create a YAML file for an APIG Ingress. The following is an example named apig-ingress.yaml.
tip
You need to ensure the DNS resolution relationship between the custom domain name and the IP address that corresponds to the APIG Ingress in your network environment.
- Execute the following command to create an APIG Ingress.
- Run the following command to view the APIG Ingress configurations.
- If the response is similar to the following one, the APIG Ingress has been created. The address 180.xxx.xxx.xxx is the IP address of the APIG Ingress access endpoint.
Testing the connections to services
Run the following command to access the service by using the domain name.
warning
- When you use a self-signed certificate, you can use the -k or --insecure parameter to ignore certificate verification.
- If you need to use a TLS certificate in production, we recommend that you use a trusted one. Using self-signed certificates and ignoring certificate verification may expose you to man-in-the-middle attacks.
If the response is similar to the following one, the back-end service is accessible through the domain name.
Operation and maintenance configuration
Using OpenSSL to create a self-signed certificate
- Download OpenSSL from the OpenSSL website to your local environment and install it.
- Execute the following command to generate a 4096-bit RSA private key.
- The expected result is as follows:
- Execute the following command to use the RSA private key to create a certificate.
- The expected response is that you need to provide information such as the country, region, organization name, domain, and email address.
- Execute the following command to use the private key to sign the certificate and set the validity period to 365 days.
- At this point, the private key tls.key and certificate tls.crt required for HTTPS encryption have been created.
Replacing an HTTPS certificate
You need to perform the following steps to replace the HTTPS certificate for the APIG Ingress.
- In the left navigation bar, click Cluster. On the page that appears, click the name of the target cluster to go to the management page of the cluster.
- In the left navigation bar, click Configurations > Secret. On the Secret page, click Create Secret to create a Secret and upload a new certificate and key.
- In the left navigation bar, click Services and Ingresses > Ingress. In the Ingress list, find the Ingress for which you need to update the HTTPS certificate and click Update in the Actions column.
- In the Listener configuration section, select the new Secret.
- Click Confirm. The certificate update is complete. After the update is complete, click the Event tab on the Ingress details page to view the successful reconciliation events for the Ingress.
- Log in to the APIG console to view certificate information.
- In the left navigation bar, click Instance management. In the instance list, find the target APIG instance, and click its name to view its details.
- In the left navigation bar, click Service list (Domain name). Click the name of the target service to go to the service overview page.
- Click the Domain name management tab. You can view the certificate information that corresponds to the domain name in the Custom domain name section.
Last updated: 2026.09.21 10:20:45