Giter Site home page Giter Site logo

Comments (8)

yurymkomarov avatar yurymkomarov commented on May 18, 2024

@funkypenguin you are the project main maintainer as I understand. Do u have some ideas?

from k8s.

funkypenguin avatar funkypenguin commented on May 18, 2024

Hey @yurymkomarov!

Looking at the template (below), both hosts and paths seem to be interpreted using range:

  {{- range .Values.ingress.hosts }}
    - host: {{ .host | quote }}
      http:
        paths:
        {{- range .paths }}
          - path: {{ .path | default "/" }}
            backend:

Therefore I'd suggest that you try something like this?

    ingress = {
      enabled     = true
      annotations = { "kubernetes.io/ingress.class" = "nginx" }
      hosts = [{
        host  = "portainer.${local.tfstate["route53"]["internal"]["name"]}"
        paths = [{
          path = "/"
        }]
      }]
    }

If this works, then we probably have to update the README and values.yaml to more clearly indicate how to pass these arguments to the chart!

Cheers!
D

from k8s.

MarkLFT avatar MarkLFT commented on May 18, 2024

Not sure is related to the same thing, but the result is the same. I am using the example from the Portainer website.

helm install --create-namespace -n portainer portainer portainer/portainer \ --set service.type=ClusterIP \ --set ingress.enabled=true \ --set ingress.annotations='kubernetes.io/ingress.class: nginx' \ --set ingress.hosts.host=portainer.example.io

and I receive an error

coalesce.go:196: warning: cannot overwrite table with non table for annotations (map[])
coalesce.go:199: warning: destination for hosts is a table. Ignoring non-table value [map[host: paths:[]]]
Error: template: portainer/templates/ingress.yaml:31:15: executing "portainer/templates/ingress.yaml" at <.host>: can't evaluate field host in type interface {}

Can you please tell me what I am doing wrong.

Many thanks

from k8s.

deviantony avatar deviantony commented on May 18, 2024

@funkypenguin do you mind having a look at @MarkLFT problem?

from k8s.

MarkLFT avatar MarkLFT commented on May 18, 2024

Just to let you know I have got around this issue by using a value.yaml and put all the ingress values in there. So I think the issue here is just I cannot format the set values correctly.

from k8s.

0m1xa avatar 0m1xa commented on May 18, 2024

Hello @funkypenguin!
I had the same problem today and I solved this way.

My first attempt was to create the required structure in values.yaml or in my custom values.yaml file and then execute helm template/install with flag -f <path_to_my_values.yaml>.
I create the structure like this (my custom values.yaml)

ingress:
  enabled: true
  annotations: {}
  hosts:
    - host: 'portainer.minikube.local'
      paths:
      - path: '/'

And this is the structure of vaules.yaml (default)

ingress:
  enabled: false
  annotations: {}
  hosts:
    - host:
      paths: []

What can we see there? Right! There is no ingress.hosts[].paths[].path

My second attempt was to pass the right structure by --set flags.
helm template portainer/portainer --set ingress.hosts[0].host="portainer.minikube.local" --set ingress.hosts[0].paths[0].path="/"
After that templating was successfull

# Source: portainer/templates/ingress.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: RELEASE-NAME-portainer
  namespace: portainer1
  labels:
    helm.sh/chart: portainer-1.0.14
    app.kubernetes.io/name: portainer
    app.kubernetes.io/instance: RELEASE-NAME
    app.kubernetes.io/version: "ce-latest-ee-2.4.0"
    app.kubernetes.io/managed-by: Helm
spec:
  rules:
    - host: "portainer.minikube.local"
      http:
        paths:
          - path: /
            backend:
              serviceName: RELEASE-NAME-portainer
              servicePort: 9000

So, the problem is that there is no mention in the documentation about passing custom variables by array and not by map.

from k8s.

khooz avatar khooz commented on May 18, 2024

Dear @funkypenguin

This is caused because networking.k8s.io/v1beta1 is deprecated since 1.19.

Ingress

The extensions/v1beta1 and networking.k8s.io/v1beta1 API versions of Ingress is no longer served as of v1.22.

  • Migrate manifests and API clients to use the networking.k8s.io/v1 API version, available since v1.19.
  • All existing persisted objects are accessible via the new API
  • Notable changes:
    • spec.backend is renamed to spec.defaultBackend
    • The backend serviceName field is renamed to service.name
    • Numeric backend servicePort fields are renamed to service.port.number
    • String backend servicePort fields are renamed to service.port.name
    • pathType is now required for each specified path. Options are Prefix, Exact, and ImplementationSpecific. To match the undefined v1beta1 behavior, use ImplementationSpecific.

IngressClass

The networking.k8s.io/v1beta1 API version of IngressClass is no longer served as of v1.22.

  • Migrate manifests and API clients to use the networking.k8s.io/v1 API version, available since v1.19.
  • All existing persisted objects are accessible via the new API
  • No notable changes
    __Deprecated API Migration Guide

In file: ingress.yml

Thanks

from k8s.

swarnat avatar swarnat commented on May 18, 2024

Any Updates for this topic? Because we currently cannot update Portainer because of this.
There are pending Merge Requests, which will solve this topic: #91 or #89

from k8s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.