Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm ingress rules at centralledger/chart-service hardcode ingress values #870

Open
Tracked by #2459
lewisdaly opened this issue Jul 22, 2019 · 2 comments
Open
Tracked by #2459
Labels
oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it story

Comments

@lewisdaly
Copy link
Contributor

Summary:
In the helm charts at centralledger/chart-service/templates/ingress.yaml, the ingress hosts are hardcoded to refer to .Values.ingress.hosts.api:

...
spec:
  rules:
    - host: {{ .Values.ingress.hosts.api }}
      http:
        paths:
          - path: {{ .Values.ingress.externalPath.api }}
            backend:
              serviceName: {{ $serviceName }}
              servicePort: {{ .Values.containers.api.service.ports.api.externalPort }}
...

This makes it impossible to pass in a values file that specifies 2 or more hosts, for example:

central:
  centralledger:
    centralledger-service:
      ingress:
        hosts:
          api_local: central-ledger.local
          admin_local: central-ledger.local
          api: central-ledger.custom.domain
          admin: central-ledger.custom.domain

Which makes it difficult to configure the central-ledger on a custom domain while retaining the ability to reach the central-ledger using the central-ledger.local hostname.

Severity:
Low

Priority:
Low

Expected Behavior
The ingress hosts should be applied dynamically, such as in ml-api-adapter/chart-service/templates/ingress.yaml:

...
spec:
  rules:
    {{- range $host := .Values.ingress.hosts }}
    - host: {{ $host }}
      http:
        paths:
          - path: {{ $servicePath }}
            backend:
              serviceName: {{ $serviceName }}
              servicePort: {{ $servicePort }}
...

This would allow us to specify multiple hosts to create ingress rules for.

Steps to Reproduce

  1. Deploy the default helm charts
  2. Update the ingress values like so with the above snippet: helm upgrade -f ./ingress.values.yml --repo http://mojaloop.io/helm/repo dev mojaloop
  3. Observe the ingress rules override the central-ledger.local entry instead of adding a new rule:

(this snippet is taken from the dashboard)

...
"rules": [
      {
        "host": "central-ledger.custom.domain",
        "http": {
          "paths": [
            {
              "path": "/",
              "backend": {
                "serviceName": "dev-centralledger-service",
                "servicePort": 80
              }
            }
          ]
        }
      }
    ]
...

Specifications

  • Component (if known): mojaloop/helm
  • Version:
  • Platform:
  • Subsystem:
  • Type of testing:
  • Bug found/raised by: @lewisdaly

Notes:

  • Severity when opened:
  • Priority when opened:
@lewisdaly lewisdaly added the bug label Jul 22, 2019
@lewisdaly lewisdaly self-assigned this Aug 12, 2019
@lewisdaly lewisdaly removed their assignment Feb 10, 2020
@elnyry-sam-k elnyry-sam-k added oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it story labels Jul 5, 2021
@elnyry-sam-k
Copy link
Member

@lewisdaly , @mdebarros thoughts on this?

@lewisdaly
Copy link
Contributor Author

I'd say it's still a valid issue, but really, it's much easier for users to bring their own ingress than mess around with our 7,000 line long values.yml file

@mdebarros mdebarros mentioned this issue Sep 24, 2021
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it story
Projects
None yet
Development

No branches or pull requests

3 participants