I am using docker desktop and Kubernetes from Docker DesktopI have created a deployment and a service as given in the below code snippet:Deployment.yaml:
kind: Deploymentmetadata: labels: app: rhap name: deploymentspec: replicas: 1 selector: matchLabels: app: rhap template: metadata: labels: app: rhap spec: containers: - image: image:release1 name: rhap
Service.yaml:
apiVersion: v1kind: Servicemetadata: name: rhap-servicespec: selector: app: rhap ports: - name: cport port: 8444 nodePort: 30080 - name: iport port: 3041 nodePort: 30081 - name: bport port: 4031 nodePort: 30082 - name: uport port: 31002 nodePort: 31002 type: NodePort
I am able to access the port 30080 from the host machine system(Ubuntu VM) as https://localhost:30080 and it opens my application.But when I try https://:30080, from my local laptop, it is not opening the application.I am able to ping the machine.
I am not able to access https://:30080 within my Ubuntu VM as well.
How can I map IPAddress to localhost for accessing my pods from outside the VM?