跳到主要内容
版本:v2.5

Service Discovery

For every workload created, a complementing Service Discovery entry is created. This Service Discovery entry enables DNS resolution for the workload's pods using the following naming convention: <workload>.<namespace>.svc.cluster.local.

However, you also have the option of creating additional Service Discovery records. You can use these additional records so that a given namespace resolves with one or more external IP addresses, an external hostname, an alias to another DNS record, other workloads, or a set of pods that match a selector that you create.

  1. From the Global view, open the project that you want to add a DNS record to.

  2. Click Resources in the main navigation bar. Click the Service Discovery tab. Then click Add Record.

  3. Enter a Name for the DNS record. This name is used for DNS resolution.

  4. Select a Namespace from the drop-down list. Alternatively, you can create a new namespace on the fly by clicking Add to a new namespace.

  5. Select one of the Resolves To options to route requests to the DNS record.

    1. One or more external IP addresses

      Enter an IP address in the Target IP Addresses field. Add more IP addresses by clicking Add Target IP.

    2. An external hostname

      Enter a Target Hostname.

    3. Alias of another DNS record's value

      Click Add Target Record and select another DNS record from the Value drop-down.

    4. One or more workloads

      Click Add Target Workload and select another workload from the Value drop-down.

    5. The set of pods which match a selector

      Enter key value pairs of label selectors to create a record for all pods that match your parameters.

  6. Click Create

Result: A new DNS record is created.

  • You can view the record by from the project's Service Discovery tab.
  • When you visit the new DNS name for the new record that you created (<recordname>.<namespace>.svc.cluster.local), it resolves the chosen namespace.