From the course: Certified Kubernetes Application Developer (CKAD) Cert Prep

Unlock this course with a free trial

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

Lesson 11 lab solution: Managing incoming traffic

Lesson 11 lab solution: Managing incoming traffic - Kubernetes Tutorial

From the course: Certified Kubernetes Application Developer (CKAD) Cert Prep

Lesson 11 lab solution: Managing incoming traffic

- Alright, well we have just seen that we have no ingress controller. So shall we start by using minikube addon enable ingress. That should help. And now the ingress addon is enabled. So at least we can use the functionality. And then, we need to create a deployment, kubectl create deploy, lab11web, - -image is nginx - -replicas is 3. Nothing shocking about it. Then we are going to make the deployment accessible at the virtual host name. So virtual host name, that hints to ingress. But before we go ingress, we need to do something else and that will be the service. So kubectl expose, deploy, lab11web, - -port is 80. That's going to take care of the service. Then sudu vim /etc/hosts, because we need a hostname resolution, otherwise it's not going to work. So 192.168.49.2, lab11web.example.com. And the final component, we need an ingress. So kubectl create ing -h | les. Is it showing anything that looks useful? Well, I think what we have here is kind of useful. I don't need everything…

Contents