Creating Ingress Resources Based on Paths
Explore how to create and manage Kubernetes Ingress resources that route requests based on URL paths. This lesson helps you understand annotations, path rules, and service configuration to enable external access through port 80, ensuring applications respond correctly via Ingress controllers.
Defining an Ingress resource
We’ll try to make our go-demo-2-api Service available through port 80. We’ll do that by defining an Ingress resource with the rule to forward all requests with the path starting with /demo to the Service go-demo-2-api.
Looking into the definition
Let’s look at the Ingress’ YAML definition go-demo-2-ingress.yml:
- Line 5: This time,
metadatacontains a field we haven’t used before. Theannotationssection allows us to provide additional information to the Ingress controller. As you’ll see soon, the Ingress API specification is concise and limited. That is done on purpose. The specification API defines only the fields that are mandatory for all Ingress controllers. All the additional information an Ingress controller needs is specified throughannotations. That way, the community behind the controllers can progress at great speed while still providing basic general compatibility and standards.
Note: The list of general annotations and the controllers that support them can be found on ...