From the course: Spring on Kubernetes: Deploying and Managing Cloud-Native Applications

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Adding ingress

Adding ingress

- [Instructor] Now let's expose our service to the outside world. I want you to start in the deployment directory and create a new file called ingress.yaml. And we're going to leverage an ingress called nginx. We actually have already been doing that when we've accessed our database because it was already exposed through the ingress itself. However, this one's a little bit different. We're going to start with an API version of networking.k8s.io/v1. And the kind will be an ingress. Now, some metadata associated with this. The name will be wisdom-api-ingress. The namespace will be wisdom. And now for some annotations. All right, nginx.ingress.kubernetes.io/use. RegX will be set equal to true. and nginx.ingress.kubernetes.io rewrite target will be /$2. Now, what this is saying is it will take the path, it will translate it to our service and then rewrite it so that the full path doesn't go to the service, only the things after what we were going to specify below. And that's really…

Contents