You need to enable JavaScript to run this app.
Volcengine Kubernetes Engine

Volcengine Kubernetes Engine

Copy page
Download PDF
Service
ExternalName
Copy page
Download PDF
ExternalName
ExternalName maps an internal service name to an external domain name within a cluster, allowing Pods in the cluster to access the external domain name using the Service name. This topic describes how to configure a service of the ExternalName type.​
Background​
When you create a Service of the ExternalName type in a cluster, Kubernetes does not assign a ClusterIP to the Service or create Endpoints. Instead, Kubernetes uses CoreDNS to return a CNAME record that maps the service name to an external DNS domain name. Workloads inside the cluster can access external services using the Service name (for example, service-demo.default.svc.cluster.local), without hardcoding the external domain name in the application.​
Procedure​
tip​
Before configuring an ExternalName Service using the kubectl command-line interface, ensure that the following conditions are met:​
  1. Create a YAML file for the service. The following external-service-demo.yaml file serves as an example:​
  • ​
    apiVersion: v1​
    kind: Service​
    metadata:​
    name: external-service-demo # The name of the service.​
    namespace: default # The namespace to which the service belongs.​
    spec:​
    type: ExternalName # The Service type is set to ExternalName.​
    externalName: volcengine.com # The external domain name to map to outside the cluster. It must be a valid DNS name. IP addresses are not allowed.​
    ​
  1. Run the following command to create a Service.​
  • ​
    kubectl apply -f external-service-demo.yaml​
    ​
Validate results​
Viewing services​
The service you created can be found in the service list.​
Testing the connections to services​
After the Service is created, you can access the external domain name using the Service name. You can run the following command inside the Pod to validate domain name resolution and connectivity.​
​
nslookup external-service-demo​
​
The expected resolution results include a CNAME record for volcengine.com, as well as the resolved real IP address, indicating that the ExternalName mapping has taken effect.​
​​​
Last updated: 2026.09.03 15:58:27