<p>I'm a beginner to Kubernetes, Helm and Yaml. I'm trying to access the QuestDB Console via Kubernetes Ingress Controller setup in my minikube, but i'm getting the below error when running a helm upgrade. Could anyone advice how I can correct this?</p>
<pre><code>Error: UPGRADE FAILED: failed to create resource: Ingress.extensions &quot;questdb&quot; is invalid: spec: Invalid value: []networking.IngressRule(nil): either `defaultBackend` or `rules` must be specified
</code></pre>
<p>Here's my overriding value.yaml</p>
<pre><code>ingress:
  enabled: true
  rules:
    - host: localhost
      http:
        paths:
          - path: /questdb
            backend:
              serviceName: questdb-headless
              servicePort: 9000
          - path: /influxdb
            backend:
              serviceName: questdb-headless
              servicePort: 9009     
</code></pre>
<p>I've installed the QuestDB helm chart using a local version which has only slightly modified the original ingress.yaml to reference networking.k8s.io/v1 instead of networking.k8s.io/v1beta1. Here's what it is locally:</p>
<pre><code>{{- if .Values.ingress.enabled -}}
{{- $fullName := include &quot;questdb.fullname&quot; . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare &quot;&gt;=1.14-0&quot; .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else -}}
apiVersion: extensions/v1
{{- end }}
kind: Ingress
metadata:
  name: {{ $fullName }}
  labels:
    {{- include &quot;questdb.labels&quot; . | nindent 4 }}
  {{- with .Values.ingress.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  {{- if .Values.ingress.tls }}
  tls:
    {{- range .Values.ingress.tls }}
    - hosts:
        {{- range .hosts }}
        - {{ . | quote }}
        {{- end }}
      secretName: {{ .secretName }}
    {{- end }}
  {{- end }}
  rules:
    {{- range .Values.ingress.hosts }}
    - host: {{ .host | quote }}
      http:
        paths:
          {{- range .paths }}
          - path: {{ . }}
            backend:
              serviceName: {{ $fullName }}
              servicePort: {{ $svcPort }}
          {{- end }}
    {{- end }}
  {{- end }}
</code></pre>
<p>I'm running on these versions:</p>
<pre><code>- helm : v3.6.0
- Kubernetes : 
Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;19&quot;, GitVersion:&quot;v1.19.7&quot;, GitCommit:&quot;1dd5338295409edcfff11505e7bb246f0d325d15&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2021-01-13T13:23:52Z&quot;, GoVersion:&quot;go1.15.5&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;20&quot;, GitVersion:&quot;v1.20.2&quot;, GitCommit:&quot;faecb196815e248d3ecfb03c680a4507229c2a56&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2021-01-13T13:20:00Z&quot;, GoVersion:&quot;go1.15.5&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}

NAME                    NAMESPACE       CHART                           APP VERSION
kubernetes-ingress      default         kubernetes-ingress-1.15.2       1.6.2
questdb                 default         questdb-0.8.0                   6.0.3
</code></pre>
<p>More details on the original chart and templates can be found here: <a href="https://github.com/questdb/questdb-kubernetes/tree/master/charts/questdb" rel="nofollow noreferrer">https://github.com/questdb/questdb-kubernetes/tree/master/charts/questdb</a></p>

louis xie
<p>The Ingress template expects things to stay under <code>.Values.ingress.hosts</code> but in your values are under <code>.Values.ingress.rules</code>.</p>
<p>Additionally, paths needs to stay directly under hosts items, not under http, because the ingress is using it with a</p>
<pre><code>{{- range .paths }}
</code></pre>
<p>under <code>.Values.ingress.hosts</code> items. And, paths are just strings, as the service name and port are directly taken from the <code>fullname</code> and the <code>.Values.service.port</code></p>
<hr />
<p>I would try changing your values to something like:</p>
<pre><code>ingress:
  enabled: true
  hosts:
    - host: localhost
      paths:
        - &quot;/questdb&quot;
        - &quot;/influxdb&quot;
</code></pre>
<p>or something close to this.</p>
<p>Additionally, you can try and see what is the output of an helm upgrade or install command if you add the parameters <code>--debug --dry-run</code> which could greatly help you identify problems like those, showing the definitions as they will be created (if there's no error while building the template, of course)</p>
<hr />
<p><strong>Update</strong>: since you also changed the Ingress template to use <code>networking.k8s.io/v1</code>, you need to also change how the template is created, because the new kind of Ingress expects things in a different way, as you can see in the documentation: <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/</a></p>
<p>Rules could becomes something like this:</p>
<pre><code>rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
  http:
    paths:
      {{- range .paths }}
      - path: {{ .path }}
        backend:
          service:
            name: {{ .svc }}
            port:
              number: {{ .port }}
      {{- end }}
{{- end }}
</code></pre>
<p>and remove the declarations of</p>
<pre><code>{{- $fullName := include &quot;questdb.fullname&quot; . -}}
{{- $svcPort := .Values.service.port -}}
</code></pre>
<p>which are now useless. With this, you can change your values in the following:</p>
<pre><code>ingress:
  enabled: true
  hosts:
    - host: localhost
      paths:
        - path: &quot;/questdb&quot;
          svc: questdb-headless
          port: 9000
        - path: &quot;/influxdb&quot;
          svc: questdb-headless
          port: 9009
</code></pre>
<p>But the service taht you specify in the values must be created somehwere of course (by the ingress and it needs to expose the desired ports)</p>
