May 2018
Intermediate to advanced
554 pages
13h 51m
English
Frontend WebUI also uses the deployment and service, but it exposes the port (TCP port 30080) in order to access it from an external web browser:
$ cat my-frontend.yaml apiVersion: apps/v1kind: Deploymentmetadata: name: my-frontend-deployspec: replicas: 2 selector: matchLabels: run: my-frontend template: metadata: labels: run: my-frontend spec: containers: - name: my-frontend image: hidetosaito/my-frontend---apiVersion: v1kind: Servicemetadata: name: my-frontend-servicespec: ports: - protocol: TCP port: 5000 nodePort: 30080 type: NodePort selector: run: my-frontend$ kubectl create -f my-frontend.yaml deployment.apps "my-frontend-deploy" createdservice "my-frontend-service" created
Let's try to access my-frontend-service
Read now
Unlock full access