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

503 ingress when spec.service is defined #575

Open
thokra-nav opened this issue Nov 19, 2024 · 1 comment
Open

503 ingress when spec.service is defined #575

thokra-nav opened this issue Nov 19, 2024 · 1 comment

Comments

@thokra-nav
Copy link
Contributor

If you have an application with both ingresses and service defined, the generated ingress uses wrong port when referencing the service

app.yaml

apiVersion: nais.io/v1alpha1
kind: Application
metadata:
  name: some-name
spec:
  # ....
  ingresses:
  - https://some-name.dev.dev-nais.cloud.nais.io
  service:
    port: 8080
    protocol: http

It generates

Ingress:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  # ...
  name: some-name-nais-ingress-9a3064dc
spec:
  ingressClassName: nais-ingress
  rules:
  - host: some-name.dev.dev-nais.cloud.nais.io
    http:
      paths:
      - backend:
          service:
            name: some-name
            port:
              number: 80
        path: /
        pathType: ImplementationSpecific

Service:

apiVersion: v1
kind: Service
metadata:
  # ...
  name: some-name
spec:
  # ...
  ports:
  - name: http
    port: 8080
    protocol: TCP
    targetPort: http

As the port number is not 80 in the generated service, there's no port mapping that matches the ingress expectation.

Suggestions:

  • Switch the port in the ingress to the one defined in spec.service if provided
  • Use named ports insted of numbers
@thokra-nav
Copy link
Contributor Author

Per i dag ser det ut som at det i NAV er 3 instanser som bruker det, to er oss selv, og en er en redis. Ingen av disse har en ingress i tillegg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant