Services
Pod configuration is managed by Deployments, StatefulSets and Daemonsets, whereas services direct traffic to pods using selectors.
For every workload (with at least one port configured) 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
.
You can create additional services 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.
- In the upper left corner, click ☰ > Cluster Management.
- Go to the cluster where you want to add a service and click Explore.
- Click Service Discovery > Services.
- Click Create.
- Choose the type of service you want to create.
- Select a Namespace from the drop-down list.
- Enter a Name for the service. This name is used for DNS resolution.
- Fill out the rest of the form. For help, refer to the upstream Kubernetes documentation about services.
- Click Create.
Result: A new service 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.