Ingress-gateway has no ingress IP or hostname

Hi

I’m trying to deploy an IngressGateway using this page Ingress Gateways - Kubernetes | Consul by HashiCorp

When I run the command

k logs consul-ingress-gateway-9db66bf9c-bx97l -c service-init

I got the following message error

2021-10-19T12:44:22.181Z [ERROR] service consul-ingress-gateway has no ingress IP or hostname

I don’t understand why.
I’m using Consul v1.9.0 and my microk8s version is

Client Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.5-3+83e2bb7ee39726", GitCommit:"83e2bb7ee3972654beca02a12a94777da22d6669", GitTreeState:"clean", BuildDate:"2021-09-28T16:03:11Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.5-3+83e2bb7ee39726", GitCommit:"83e2bb7ee3972654beca02a12a94777da22d6669", GitTreeState:"clean", BuildDate:"2021-09-28T15:36:44Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}

My Consul values file:

global:
  name: consul
  datacenter: demo
  image: "consul:1.9.0"

server:
  replicas: 1
  bootstrapExpect: 1
  disruptionBudget:
    enabled: true
    maxUnavailable: 0

client:
  enabled: true
  grpc: true

ui:
  enabled: true

connectInject:
  enabled: true
  default: true
  centralConfig:
    enabled: true
    defaultProtocol: "http"

ingressGateways:
  enabled: true
  gateways:
    - name: ingress-gateway
      service:
        type: LoadBalancer

ACL and RBAC are not enabled in my case.

Anyone can help me please?

Hi, if you run kubectl get svc you’ll see that the LoadBalancer service isn’t getting an external IP. kubectl describe svc should hopefully tell you why.

Hi

Here the result of the command k describe svc consul-ingress-gateway

Name: consul-ingress-gateway
Namespace: default
Labels: app=consul
app.kubernetes.io/managed-by=Helm
chart=consul-helm
component=ingress-gateway
heritage=Helm
ingress-gateway-name=consul-ingress-gateway
release=consul
Annotations: meta.helm.sh/release-name: consul
meta.helm.sh/release-namespace: default
Selector: app=consul,component=ingress-gateway,ingress-gateway-name=consul-ingress-gateway,release=consul
Type: LoadBalancer
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.152.183.138
IPs: 10.152.183.138
Port: gateway-0 8080/TCP
TargetPort: 8080/TCP
NodePort: gateway-0 32496/TCP
Endpoints:
Port: gateway-1 8443/TCP
TargetPort: 8443/TCP
NodePort: gateway-1 32682/TCP
Endpoints:
Session Affinity: None
External Traffic Policy: Cluster
Events:

Do you see something wrong?

Can you do kubectl get svc consul-ingress-gateway -o yaml? It’s missing the status section where an IP is assignd.

For example:

apiVersion: v1
kind: Service
metadata:
  annotations:
    meta.helm.sh/release-name: test-e2wcla
    meta.helm.sh/release-namespace: default
  creationTimestamp: "2020-12-10T21:56:38Z"
  finalizers:
  - service.kubernetes.io/load-balancer-cleanup
  labels:
    app: consul
    app.kubernetes.io/managed-by: Helm
    chart: consul-helm
    component: mesh-gateway
    heritage: Helm
    release: test-e2wcla
  name: test-e2wcla-consul-mesh-gateway
  namespace: default
  resourceVersion: "7553"
  selfLink: /api/v1/namespaces/default/services/test-e2wcla-consul-mesh-gateway
  uid: 864d07c7-5c08-4b06-8905-6b53ff8fe44e
spec:
  clusterIP: 10.100.163.248
  externalTrafficPolicy: Cluster
  ports:
  - name: gateway
    nodePort: 30514
    port: 443
    protocol: TCP
    targetPort: 8443
  selector:
    app: consul
    component: mesh-gateway
    release: test-e2wcla
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer:
    ingress:
    - hostname: a864d07c75c084b0689056b53ff8fe44-2076826337.us-west-2.elb.amazonaws.com

Here the result of the command

apiVersion: v1
kind: Service
metadata:
  annotations:
    meta.helm.sh/release-name: consul
    meta.helm.sh/release-namespace: default
  creationTimestamp: "2021-10-21T07:56:12Z"
  labels:
    app: consul
    app.kubernetes.io/managed-by: Helm
    chart: consul-helm
    component: ingress-gateway
    heritage: Helm
    ingress-gateway-name: consul-ingress-gateway
    release: consul
  name: consul-ingress-gateway
  namespace: default
  resourceVersion: "2746515"
  selfLink: /api/v1/namespaces/default/services/consul-ingress-gateway
  uid: cc111b39-67d2-45c0-b00e-6ee0383e0427
spec:
  clusterIP: 10.152.183.16
  clusterIPs:
  - 10.152.183.16
  externalTrafficPolicy: Cluster
  ipFamilies:
  - IPv4
  ipFamilyPolicy: SingleStack
  ports:
  - name: gateway-0
    nodePort: 30104
    port: 8080
    protocol: TCP
    targetPort: 8080
  - name: gateway-1
    nodePort: 30681
    port: 8443
    protocol: TCP
    targetPort: 8443
  selector:
    app: consul
    component: ingress-gateway
    ingress-gateway-name: consul-ingress-gateway
    release: consul
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer: {}

For some reason microk8s isn’t giving your LB service an IP. Do you need an LB service?

Yes I need it :confused:
I’m going to search a solution with microk8s in order to have an IP for the LB service

Thanks for your help

I follow this solution https://www.reddit.com/r/kubernetes/comments/mnbhjn/microk8s_service_externalip_stuck_on_pending/

I enable metallb on microk8s and it solves the problem

Thanks a lot lkysow

1 Like