Service does not have load balancer ingress IP - Devops

4/19/2021

I have a deployment configuration in my helm chart,

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "userapi.fullname" . }}
  labels:
    app: {{ template "userapi.name" . }}
    chart: {{ template "userapi.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app: {{ template "userapi.name" . }}
      release: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app: {{ template "userapi.name" . }}
        release: {{ .Release.Name }}
    spec:
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          ports:
            - name: http
              containerPort: {{ .Values.service.port }}
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /
              port: http
            initialDelaySeconds: 30
          readinessProbe:
            httpGet:
              path: /
              port: http
            initialDelaySeconds: 30

Also, I have configured my cluster, basically this is my configuration:

az group create --name demorg --location eastus

    az aks create \
    --resource-group demorg \
    --name democluster \
    --node-count 1 \
    --vm-set-type VirtualMachineScaleSets \
    --load-balancer-sku standard \
    --enable-cluster-autoscaler \
    --min-count 1 \
    --max-count 3
    
    az acr create --resource-group demorg --name acrdemo --sku Standard

But I'm getting this error:

history.go:53: debug getting history for release userapi 2021-04-19T07:24:14.7353557Z Release "userapi" does not exist. Installing it now. 2021-04-19T07:24:14.7354630Z install.go:172: debug Original chart version: "" 2021-04-19T07:24:14.7357809Z install.go:189: debug CHART PATH: /home/vsts/work/r1/a/_userapi-CI/dropuser/userapi-v0.4.0.tgz 2021-04-19T07:24:14.7360391Z 2021-04-19T07:24:14.7397152Z client.go:109: debug creating 2 resource(s) 2021-04-19T07:24:14.7397607Z wait.go:53: debug beginning wait for 2 resources with timeout of 2m0s 2021-04-19T07:24:14.7398121Z wait.go:206: debug Service does not have load balancer ingress IP address: demospace/userapi 2021-04-19T07:24:14.7398987Z wait.go:225: debug Deployment is not ready: demospace/userapi. 0 out of 2 expected pods are ready 2021-04-19T07:24:14.7441027Z Error: timed out waiting for the condition 2021-04-19T07:24:14.7441419Z helm.go:81: debug timed out waiting for the condition 2021-04-19T07:24:14.7468168Z ##errorhistory.go:53: debug getting history for release userapi

How I can solve it? I tried with several ways and I'm not finding a solution

-- Benjamin RD
azure-aks
kubernetes
kubernetes-helm

1 Answer

4/19/2021

debug Deployment is not ready: demospace/userapi. 0 out of 2 expected pods are ready

Check what is wrong with your app, e.g. check the application logs.

E.g. first list your pods with:

kubectl get pods

Then you get the names of your pods. Now you want to see the application logs, and hopefully you are logging why the application is not Ready (e.g. responding on the ReadinessProbe on path /). Check logs with:

kubectl logs <pod-name>
-- Jonas
Source: StackOverflow