简体   繁体   中英

Expose Service in Kubernetes using Ingress

I am new to Kubernetes. I have deployed a Node API in my local machine with the help of minikube. Below is the nodejs service: 在此处输入图片说明

Spec in node-service.yaml

spec:
 type: NodePort
 ports:
  - name: "8000"
    port: 8000
    targetPort: 8000

Even tried with LoadBalancer, no luck. I have created a basic ingress using the below file:

 apiVersion: extensions/v1beta1 kind: Ingress metadata: name: basic-ingress spec: rules: - http: paths: - path: / backend: serviceName: nodejs servicePort: 8000

But I am unable to expose this service. 在此处输入图片说明

ADDRESS is not bound. Please suggest a possible solution that works on my local machine. If there is any other solution to expose my api over http please point me to a resource where I can get more information about it.

GitHub Link: Basic Node Mongo Kubernetes Setup

Based in the documentation I enabled ingress on my minikube cluster by running the command minikube addons enable ingress . This solved my issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM