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 Chart - Global configuration in Helm values.yaml creates CrashLoopBackoff #1103

Closed
bruxillensis opened this issue Aug 20, 2020 · 3 comments · Fixed by #1105
Closed

Helm Chart - Global configuration in Helm values.yaml creates CrashLoopBackoff #1103

bruxillensis opened this issue Aug 20, 2020 · 3 comments · Fixed by #1105
Labels
bug An issue reporting a potential bug

Comments

@bruxillensis
Copy link

Describe the bug
When using the globalConfiguration option in the Helm configuration file (i.e. values.yaml) in a more or less vanilla deployment of NGINX results in crashloop backoff.

To Reproduce
Steps to reproduce the behavior:

  1. helm install cashew nginx-stable/nginx-ingress -f values.yaml -n default
  2. kubectl get pods
NAME                                                     READY   STATUS             RESTARTS   AGE
cashew-nginx-ingress-5fc9bf67b-gfzjh                     0/1     CrashLoopBackOff   1          12s
  1. kubectl logs <pod-name>
I0820 22:53:47.214446       1 main.go:214] Starting NGINX Ingress controller Version=1.8.1 GitCommit=2c9e223b
F0820 22:53:47.237979       1 main.go:385] Error when getting default/cashew-nginx-ingress: globalconfigurations.k8s.nginx.org "nginx" not found

Content of values.yaml

controller:
    globalConfiguration:
        create: true
        spec:
            listeners:
            - name: redis-tcp
              port: 6379
              protocol: TCP

Expected behavior
Launch and open port 6379 for TransportServers

Your environment

  • Version of the Ingress Controller - 1.8.1
  • Version of Kubernetes
kubectl version

Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.6", GitCommit:"dff82dc0de47299ab66c83c626e08b245ab19037", GitTreeState:"clean", BuildDate:"2020-07-15T16:58:53Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.6", GitCommit:"dff82dc0de47299ab66c83c626e08b245ab19037", GitTreeState:"clean", BuildDate:"2020-07-15T16:51:04Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
  • Kubernetes platform (e.g. Mini-kube or GCP) - microk8s
microk8s ctr version

Client:
  Version:  v1.2.5
  Revision: bb71b10fd8f58240ca47fbb579b9d1028eea7c84

Server:
  Version:  v1.2.5
  Revision: bb71b10fd8f58240ca47fbb579b9d1028eea7c84
  • Using NGINX or NGINX Plus - NGINX

Additional context
I am unsure if this is a template issue or my configuration of k8s.

@bruxillensis bruxillensis changed the title Helm Chart - Global configuration naming mismatch Helm Chart - Global configuration in Helm values.yaml creates CrashLoopBackoff Aug 20, 2020
@bruxillensis
Copy link
Author

There is a mistake in the above error log. The real error log is this:

I0820 23:21:10.322653       1 main.go:214] Starting NGINX Ingress controller Version=1.8.1 GitCommit=2c9e223b
F0820 23:21:10.344992       1 main.go:385] Error when getting default/cashew: globalconfigurations.k8s.nginx.org "cashew" not found

The output of kubectl get globalconfigurations is

NAME                   AGE
cashew-nginx-ingress   109s

The NGINX instance seems to be looking for the incorrect resource name.

@pleshakov pleshakov added the bug An issue reporting a potential bug label Aug 20, 2020
@pleshakov
Copy link
Contributor

Hi @bpoulse

It's a bug in our helm chart. Thanks for reporting. We will fix it.

In the meantime, you can try the following workarounds:

if you install the helm chart from the sources.

(1) Modify the following file to fix the issue:

diff --git a/deployments/helm-chart/templates/controller-deployment.yaml b/deployments/helm-chart/templates/controller-deployment.yaml
index 4349141f..6b952d25 100644
--- a/deployments/helm-chart/templates/controller-deployment.yaml
+++ b/deployments/helm-chart/templates/controller-deployment.yaml
@@ -141,7 +141,7 @@ spec:
           - -enable-tls-passthrough={{ .Values.controller.enableTLSPassthrough }}
           - -enable-snippets={{ .Values.controller.enableSnippets }}
 {{- if .Values.controller.globalConfiguration.create }}
-          - -global-configuration=$(POD_NAMESPACE)/{{ .Release.Name }}
+          - -global-configuration=$(POD_NAMESPACE)/{{ include "nginx-ingress.name" . }}
 {{- end }}
 {{- end }}
           - -ready-status={{ .Values.controller.readyStatus.enable }}

(2) Install the chart using the modified sources:

$ cd deployments/helm-chart
$ helm install cashew  -f values.yaml -n default .

Or alternatively, deploy a GlobalConfiguration resource without helm with the name cashew

@bruxillensis
Copy link
Author

Thanks for the reply and fix! Both options indeed work for the interim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue reporting a potential bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants