Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Fix ingress api checks #306

Merged
merged 2 commits into from
Sep 18, 2021
Merged

Fix ingress api checks #306

merged 2 commits into from
Sep 18, 2021

Conversation

rjkernick
Copy link
Contributor

fixes #305

Copy link
Contributor

@EvgeniGordeev EvgeniGordeev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed check on paths array.

@@ -1,9 +1,9 @@
{{- if .Values.ingress.enabled -}}
{{- $serviceName := include "sonarqube.fullname" . -}}
{{- $servicePort := .Values.service.externalPort -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" -}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same check on line 47 is required.

@@ -10,9 +10,9 @@
{{- $servicePort = .Values.nexusProxy.port -}}
{{- end }}

{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" -}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see line 43.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the catch. Fixed

@Mikaciu
Copy link

Mikaciu commented Sep 17, 2021

Hello,

Shouldn't line 47 of the SonarQube ingress have the $ context selector ?

{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}

Suggestion :

-             {{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
+            {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}

HTH

@rjkernick
Copy link
Contributor Author

@Mikaciu I do not believe you need the $

@rjkernick rjkernick merged commit d801666 into master Sep 18, 2021
@rjkernick rjkernick deleted the fix-ingress-checks branch September 18, 2021 17:18
@EvgeniGordeev
Copy link
Contributor

@Mikaciu I do not believe you need the $

Error: UPGRADE FAILED: template: sonar/charts/sonarqube/templates/ingress.yaml:47:32: executing "sonar/charts/sonarqube/templates/ingress.yaml" at <.Capabilities.APIVersions.Has>: nil pointer evaluating interface {}.APIVersions

it must be {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} as @Mikaciu pointed out.

@patsevanton
Copy link
Contributor

patsevanton commented Sep 20, 2021

After this commit broken ingress for kubernetes 1.18
#311

Please rollback

@patsevanton
Copy link
Contributor

kubectl version

Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.20",

helm install -f my-values.yaml sonatype-nexus oteemocharts/sonatype-nexus --version 5.3.3

Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Ingress" in version "networking.k8s.io/v1"

helm install --atomic -f my-values.yaml sonatype-nexus oteemocharts/sonatype-nexus --version 5.3.2

NAME: sonatype-nexus
LAST DEPLOYED: Mon Sep 20 17:17:45 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
- To access Nexus:

  NOTE: It may take a few minutes for the ingress load balancer to become available or the backends to become HEALTHY.
        You can watch the status of the backends by running:
        `kubectl get ingress -o jsonpath='{.items[*].metadata.annotations.ingress\.kubernetes\.io/backends}'`

  To access Nexus you can check:
   http://nexus.xxxxx.sslip.io

- Login with the following credentials

   username: admin
   password: xxxx
- Next steps in configuration

   Please follow the link below to the README for nexus configuration, usage, backups and DR info:
   https://github.com/Oteemo/charts/tree/master/charts/sonatype-nexus#after-installing-the-chart

@patsevanton
Copy link
Contributor

kubectl version

Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.10", 

helm install --atomic -f my-values.yaml sonatype-nexus oteemocharts/sonatype-nexus --version 5.3.3

NAME: sonatype-nexus
LAST DEPLOYED: Mon Sep 20 17:18:04 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
- To access Nexus:

  NOTE: It may take a few minutes for the ingress load balancer to become available or the backends to become HEALTHY.
        You can watch the status of the backends by running:
        `kubectl get ingress -o jsonpath='{.items[*].metadata.annotations.ingress\.kubernetes\.io/backends}'`

  To access Nexus you can check:
   http://nexus.xxxxxx.sslip.io

- Login with the following credentials

   username: admin
   password: xxxxx
- Next steps in configuration

   Please follow the link below to the README for nexus configuration, usage, backups and DR info:
   https://github.com/Oteemo/charts/tree/master/charts/sonatype-nexus#after-installing-the-chart

helm install --atomic -f my-values.yaml sonatype-nexus oteemocharts/sonatype-nexus --version 5.3.2

NAME: sonatype-nexus
LAST DEPLOYED: Mon Sep 20 17:22:38 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
- To access Nexus:

  NOTE: It may take a few minutes for the ingress load balancer to become available or the backends to become HEALTHY.
        You can watch the status of the backends by running:
        `kubectl get ingress -o jsonpath='{.items[*].metadata.annotations.ingress\.kubernetes\.io/backends}'`

  To access Nexus you can check:
   http://nexus.84-252-132-48.sslip.io

- Login with the following credentials

   username: admin
   password: admin123
- Next steps in configuration

   Please follow the link below to the README for nexus configuration, usage, backups and DR info:
   https://github.com/Oteemo/charts/tree/master/charts/sonatype-nexus#after-installing-the-chart

@jetersen
Copy link
Contributor

Be careful this applies only to ingress v1... sadly the Has condition would also apply to ingress v1alpha, so be aware.

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

Successfully merging this pull request may close these issues.

Incorrect check for Ingress APIversion for sonarqube 9.8.0 and 9.6.6
5 participants