loki icon indicating copy to clipboard operation
loki copied to clipboard

loki/simple-scalable helm deployment fails

Open MDPolaris opened this issue 2 years ago • 5 comments

Describe the bug I am trying to use the grafana/loki-simple-scalable chart when following the guide: https://grafana.com/docs/loki/latest/installation/simple-scalable-helm/ When trying to deploy the cluster I get the following error:

helm upgrade --install loki --namespace=mikefreitas grafana/loki-simple-scalable Release "loki" does not exist. Installing it now. Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(GrafanaAgent.spec): unknown field "enableConfigReadAPI" in com.grafana.monitoring.v1alpha1.GrafanaAgent.spec I did not have this issue with the loki-stack chart.

helm version version.BuildInfo{Version:"v3.9.4", GitCommit:"dbc6d8e20fe1d58d50e6ed30f09a04a77e4c68db", GitTreeState:"clean", GoVersion:"go1.19"}

To Reproduce Steps to reproduce the behavior:

  1. Add grafana helm repo
  2. helm upgrade --install loki --namespace=mikefreitas grafana/loki-simple-scalable Release "loki" does not exist. Installing it now. Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(GrafanaAgent.spec): unknown field "enableConfigReadAPI" in com.grafana.monitoring.v1alpha1.GrafanaAgent.spec I did not have this issue with the loki-stack chart.

Expected behavior The simple-scalable deployment version of loki should be deployed into my kubernetes cluster.

Environment:

  • Infrastructure:kubernetes
  • Deployment tool: helm

Screenshots, Promtail config, or terminal output

DEBUG Output:

helm upgrade --install loki --namespace=mikefreitas grafana/loki-simple-scalable --debug
history.go:56: [debug] getting history for release loki
Release "loki" does not exist. Installing it now.
install.go:178: [debug] Original chart version: ""
install.go:195: [debug] CHART PATH: /Users/mike.freitas/Library/Caches/helm/repository/loki-simple-scalable-1.8.10.tgz

client.go:128: [debug] creating 1 resource(s)
install.go:151: [debug] CRD prometheusrules.monitoring.coreos.com is already present. Skipping.
client.go:128: [debug] creating 1 resource(s)
install.go:151: [debug] CRD servicemonitors.monitoring.coreos.com is already present. Skipping.
client.go:128: [debug] creating 1 resource(s)
install.go:151: [debug] CRD podmonitors.monitoring.coreos.com is already present. Skipping.
client.go:128: [debug] creating 1 resource(s)
install.go:151: [debug] CRD probes.monitoring.coreos.com is already present. Skipping.
client.go:128: [debug] creating 1 resource(s)
install.go:151: [debug] CRD servicemonitors.monitoring.coreos.com is already present. Skipping.
client.go:128: [debug] creating 1 resource(s)
install.go:151: [debug] CRD grafanaagents.monitoring.grafana.com is already present. Skipping.
client.go:128: [debug] creating 1 resource(s)
install.go:151: [debug] CRD integrations.monitoring.grafana.com is already present. Skipping.
client.go:128: [debug] creating 1 resource(s)
install.go:151: [debug] CRD logsinstances.monitoring.grafana.com is already present. Skipping.
client.go:128: [debug] creating 1 resource(s)
install.go:151: [debug] CRD metricsinstances.monitoring.grafana.com is already present. Skipping.
client.go:128: [debug] creating 1 resource(s)
install.go:151: [debug] CRD podlogs.monitoring.grafana.com is already present. Skipping.
Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(GrafanaAgent.spec): unknown field "enableConfigReadAPI" in com.grafana.monitoring.v1alpha1.GrafanaAgent.spec
helm.go:84: [debug] error validating "": error validating data: ValidationError(GrafanaAgent.spec): unknown field "enableConfigReadAPI" in com.grafana.monitoring.v1alpha1.GrafanaAgent.spec
helm.sh/helm/v3/pkg/kube.scrubValidationError
	helm.sh/helm/v3/pkg/kube/client.go:643
helm.sh/helm/v3/pkg/kube.(*Client).Build
	helm.sh/helm/v3/pkg/kube/client.go:215
helm.sh/helm/v3/pkg/action.(*Install).RunWithContext
	helm.sh/helm/v3/pkg/action/install.go:275
main.runInstall
	helm.sh/helm/v3/cmd/helm/install.go:264
main.newUpgradeCmd.func2
	helm.sh/helm/v3/cmd/helm/upgrade.go:121
github.com/spf13/cobra.(*Command).execute
	github.com/spf13/[email protected]/command.go:856
github.com/spf13/cobra.(*Command).ExecuteC
	github.com/spf13/[email protected]/command.go:974
github.com/spf13/cobra.(*Command).Execute
	github.com/spf13/[email protected]/command.go:902
main.main
	helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
	runtime/proc.go:250
runtime.goexit
	runtime/asm_arm64.s:1165
unable to build kubernetes objects from release manifest
helm.sh/helm/v3/pkg/action.(*Install).RunWithContext
	helm.sh/helm/v3/pkg/action/install.go:277
main.runInstall
	helm.sh/helm/v3/cmd/helm/install.go:264
main.newUpgradeCmd.func2
	helm.sh/helm/v3/cmd/helm/upgrade.go:121
github.com/spf13/cobra.(*Command).execute
	github.com/spf13/[email protected]/command.go:856
github.com/spf13/cobra.(*Command).ExecuteC
	github.com/spf13/[email protected]/command.go:974
github.com/spf13/cobra.(*Command).Execute
	github.com/spf13/[email protected]/command.go:902
main.main
	helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
	runtime/proc.go:250
runtime.goexit
	runtime/asm_arm64.s:1165

MDPolaris avatar Sep 07 '22 01:09 MDPolaris

Could you try the latest Helm release Loki 3.0.0?

jeschkies avatar Sep 07 '22 07:09 jeschkies

Got a similar problem while trying to get a simple deployment without monitoring

fabriziopandini avatar Sep 07 '22 13:09 fabriziopandini

I guess we need the ability not to deploy Prometheus operator CRDs. In my case it also already exists in my clusters

sergeyshevch avatar Sep 12 '22 07:09 sergeyshevch

we need the ability not to deploy Prometheus operator CRDs. In my case it also already exists in my clusters

I've just talked with @trevorwhitney about this. I think you can disable them with serviceMonitoring.enable = false.

jeschkies avatar Sep 12 '22 16:09 jeschkies

@majid-akbari @jeschkies Most of the time, charts that provide the ability to include SerivceMonitor in the deployments do not include CRD itself. I guess it's good practice.

Now I'm locked with the same CRD version that Loki uses. I guess it's a bad solution.

The better solution will be:

  1. Remove CRD from Loki chart OR
  2. the Add ability to disable CRD (coverint to IF section)

sergeyshevch avatar Sep 15 '22 17:09 sergeyshevch

yeah, I think we could revisit this, since the agent will deploy the CRDs itself when deployed, we may be able to remove them. I think the problem we ran into was while helm will automatically deploy CRDs in a crd folder before deploying templates (as is necessary if those CRDs are used in the templates), it does not do that for subcharts. I need to revisit this to confirm.

trevorwhitney avatar Sep 26 '22 15:09 trevorwhitney

Hi!

I ran into this problem too while installing the grafana/loki helm chart.

I already had a grafana-agent running inside of my cluster, so the GrafanaAgent CRD was already installed.

Deploying the chart with

     monitoring:
       selfMonitoring:
        enabled: true
         grafanaAgent:
           installOperator: false

would fail with

unknown field "enableConfigReadAPI" in com.grafana.monitoring.v1alpha1.GrafanaAgent.spec

The workaround for me was to delete the existing CRD, uninstall loki chart:

kubectl delete crd grafanaagents.monitoring.grafana.com
helm uninstall loki -n MY_NAMESPACE

and then reinstall the chart.

nicoche avatar Sep 26 '23 15:09 nicoche