Accessing the Apps
Discover how to access applications in Kubernetes by deploying service objects that provide network connectivity to pods. Learn to scale deployments both imperatively and declaratively, understanding the importance of syncing YAML manifests to ensure consistent cluster states and efficient application management.
We'll cover the following...
Let’s have a look at the deploy.yml file from the previous lesson. We’ll execute all these commands from the below terminal. Click the "Run" button to create a cluster.
apiVersion: v1
kind: Service
metadata:
name: lb-svc
labels:
app: hello-world
spec:
type: LoadBalancer
ports:
- port: 8080
protocol: TCP
selector:
app: hello-worldThe Deployment is running, and we’ve got 10 replicas. However, we need a Kubernetes Service object to be able to connect to the app. We’ll cover Services in a later chapter, but for now, it’s enough to know that they provide network access to Pods.
The following YAML is from the lb.yml file. It defines a Service ...