Professional Documents
Culture Documents
Now we can update our cluster-demo.yaml file to map our pods by their labels to
the ClusterIP service.
apiVersion: v1
kind: Service
metadata:
name: Backend
spec:
type: ClusterIP
ports:
- targerPort: 80
port: 80
selector:
name: demo-pod
type: frontend-app
Now that the pods are running inside our cluster, we will expose it to external traffic
using Kubernetes proxy.
Start the Kubernetes proxy using the following command:
kubernetes proxy --port=8080
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea comCreate a file named pod-demo.yaml with the following:
apiVersion: v1
kind: Pod
metadata:
name: demo-pod
labels:
app: demo-pod
type: frontend-app
spec:
containers:
- name: nginx-container
image: nginx
Now we can update our cluster-demo.yaml file to map our pods by their labels to
the ClusterIP service.
apiVersion: v1
kind: Service
metadata:
name: Backend
spec:
type: ClusterIP
ports:
- targerPort: 80
port: 80
selector:
name: demo-pod
type: frontend-app
Now that the pods are running inside our cluster, we will expose it to external traffic
using Kubernetes proxy.
Start the Kubernetes proxy using the following command:
kubernetes proxy --port=8080
modo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.