kyverno icon indicating copy to clipboard operation
kyverno copied to clipboard

[Bug] [Helm]: Migration job fails with undefined KYVERNO_NAMESPACE environment variable

Open iusergii opened this issue 1 year ago • 5 comments

Kyverno Version

1.12.5

Description

Migration Job fails with error:

2024-08-01T18:44:13Z	INFO	setup.version	version/version.go:49	version	{"version": "v1.12.5", "hash": "b7fb616a6db3081a7c6d1d72d375819e777064ee", "time": "2024-07-12T09:06:59Z"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"add_dir_header": "false"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"admissionReports": "true"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"allowInsecureRegistry": "false"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"alsologtostderr": "false"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"autoUpdateWebhooks": "true"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"backgroundServiceAccountName": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"caSecretName": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"cleanupServerPort": "9443"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"clientRateLimitBurst": "50"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"clientRateLimitQPS": "20"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"disableMetrics": "false"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"dumpPayload": "false"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"enableConfigMapCaching": "true"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"enableDeferredLoading": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"enablePolicyException": "true"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"enableTracing": "false"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"enableTuf": "false"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"eventsRateLimitBurst": "2000"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"eventsRateLimitQPS": "1000"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"exceptionNamespace": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"forceFailurePolicyIgnore": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"generateValidatingAdmissionPolicy": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"imagePullSecrets": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"imageVerifyCacheEnabled": "true"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"imageVerifyCacheMaxSize": "1000"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"imageVerifyCacheTTLDuration": "1h0m0s"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"kubeconfig": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"leaderElectionRetryPeriod": "2s"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"log_backtrace_at": ":0"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"log_dir": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"log_file": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"log_file_max_size": "1800"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"loggingFormat": "text"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"loggingtsFormat": "default"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"logtostderr": "true"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"maxAPICallResponseLength": "10000000"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"maxAdmissionReports": "10000"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"maxAuditCapacity": "1000"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"maxAuditWorkers": "8"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"maxQueuedEvents": "1000"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"metricsPort": "8000"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"omitEvents": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"one_output": "false"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"otelCollector": "opentelemetrycollector.kyverno.svc.cluster.local"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"otelConfig": "prometheus"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"profile": "false"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"profileAddress": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"profilePort": "6060"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"protectManagedResources": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"registryCredentialHelpers": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"renewBefore": "360h0m0s"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"serverIP": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"servicePort": "443"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"skip_headers": "false"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"skip_log_headers": "false"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"stderrthreshold": "2"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"tlsSecretName": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"tracingAddress": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"tracingCreds": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"tracingPort": "4317"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"transportCreds": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"tufMirror": "https://tuf-repo-cdn.sigstore.dev"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"tufRoot": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"v": "2"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"vmodule": ""}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"webhookRegistrationTimeout": "2m0s"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"webhookServerPort": "9443"}
2024-08-01T18:44:13Z	INFO	setup.flag	internal/flag.go:260		{"webhookTimeout": "10"}
2024-08-01T18:44:13Z	ERROR	setup	internal/error.go:19	please define the environment variable	{"name": "KYVERNO_NAMESPACE", "error": "environment variable must be defined"}

Do we need to add directly to Job object config aka?

Slack discussion

No response

Troubleshooting

  • [X] I have read and followed the documentation AND the troubleshooting guide.
  • [X] I have searched other issues in this repository and mine is not recorded.

iusergii avatar Aug 01 '24 19:08 iusergii

Do we need to add directly to Job object config aka?

No need to. How did you upgrade Kyverno?

realshuting avatar Aug 02 '24 14:08 realshuting

@realshuting argocd / helm chart.

iusergii avatar Aug 05 '24 08:08 iusergii

Were you upgraded from 1.11.x? I don't recall seeing such an issue while upgrading with Helm.

Did you custom Kyverno installation? Can you please provide full steps for reproduction?

realshuting avatar Aug 05 '24 14:08 realshuting

App version 1.10.3 -> 1.12.5 Helm Chart 3.0.5 -> 3.2.6

With enabled crd migration.

iusergii avatar Aug 05 '24 14:08 iusergii

@realshuting could you please review https://github.com/kyverno/kyverno/pull/11460

iusergii avatar Oct 23 '24 11:10 iusergii

We found an issue from our side. We replaced the image to the local registry and migration job one was set to kyverno instead kyverno-cli Closing.

iusergii avatar Oct 25 '24 17:10 iusergii