From the course: Certified Kubernetes Administrator (CKA) Cert Prep (2024)

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Configuring application access

Configuring application access

- In our next assignment, we are going to configure application access. So the mission was to create a Deployment with the name lab126deploy with three instances of Nginx and configure it such that it can be accessed by external users on port 32567 on each of the cluster nodes. Let me show you. So this should be pretty easy. Kubectl create deploy to start with. Lab 126deploy --image is Nginx and replicas is three. Next, kubectl expose deploy lab126deploy --port is 80 Now, that will almost bring us there. Let me show you. Kubectl get all --selector app is lab126deploy is showing that we have a service, but the service is of the type ClusterIP. And if you want the application to be accessible by a specific port on each node, you need nodePort. So we need to change the service to nodePort, but we also need to include the nodePort in the service definition. Now, if you have a look at the kubectl edit on svc lab126deploy, there you can see in the spec that there's a ports item, and this…

Contents