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

Using an umbrella chart with an alias or setting nameOverride to anything except cloudnative-pg results in a broken deploy #351

Open
brinnjoyce opened this issue Aug 20, 2024 · 0 comments
Labels
chart( operator ) Related to the operator (cloudnative-pg) chart

Comments

@brinnjoyce
Copy link
Contributor

As per title, because of this issue cloudnative-pg/cloudnative-pg#2466 if you try to deploy cloudnative-pg with an umbrella chart like this:

apiVersion: v2
name: cnpg-operator
description: Install cloudnative-pg-operator
type: application
version: 0.1.0
appVersion: "HEAD"
dependencies:
  - name: cloudnative-pg
    alias: cnpg-operator
    repository: https://cloudnative-pg.io/charts/
    version: 0.21.6

Or otherwise change the value of nameOverride to be anything other than cloudnative-pg the deployment will fail with errors like this:

{
  "level": "error",
  "ts": "2024-08-20T21:00:06Z",
  "msg": "no operator deployment found with the filter",
  "filter": "app.kubernetes.io/name=cloudnative-pg",
  "error": "no operator deployment found",
  "stacktrace": "github.com/cloudnative-pg/cloudnative-pg/pkg/management/log.(*logger).Error\n\tpkg/management/log/log.go:125\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/certs.findOperatorDeploymentByFilter\n\tpkg/certs/operator_deployment.go:122\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/certs.GetOperatorDeployment\n\tpkg/certs/operator_deployment.go:68\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/certs.SetAsOwnedByOperatorDeployment\n\tpkg/certs/operator_deployment.go:41\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/certs.(*PublicKeyInfrastructure).ensureRootCACertificate\n\tpkg/certs/k8s.go:184\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/certs.PublicKeyInfrastructure.ensureCertificatesAreUpToDate\n\tpkg/certs/k8s.go:238\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/certs.(*PublicKeyInfrastructure).Setup.func2\n\tpkg/certs/k8s.go:143\nk8s.io/client-go/util/retry.OnError.func1\n\tpkg/mod/k8s.io/client-go@v0.30.3/util/retry/util.go:51\nk8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtection\n\tpkg/mod/k8s.io/apimachinery@v0.30.3/pkg/util/wait/wait.go:145\nk8s.io/apimachinery/pkg/util/wait.ExponentialBackoff\n\tpkg/mod/k8s.io/apimachinery@v0.30.3/pkg/util/wait/backoff.go:461\nk8s.io/client-go/util/retry.OnError\n\tpkg/mod/k8s.io/client-go@v0.30.3/util/retry/util.go:50\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/certs.(*PublicKeyInfrastructure).Setup\n\tpkg/certs/k8s.go:140\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/controller.ensurePKI\n\tinternal/cmd/manager/controller/controller.go:378\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/controller.RunController\n\tinternal/cmd/manager/controller/controller.go:222\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/controller.NewCmd.func1\n\tinternal/cmd/manager/controller/cmd.go:40\ngithub.com/spf13/cobra.(*Command).execute\n\tpkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tpkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117\ngithub.com/spf13/cobra.(*Command).Execute\n\tpkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041\nmain.main\n\tcmd/manager/main.go:66\nruntime.main\n\t/opt/hostedtoolcache/go/1.22.5/x64/src/runtime/proc.go:271"
}
{
  "level": "error",
  "ts": "2024-08-20T21:00:06Z",
  "logger": "setup",
  "msg": "unable to setup PKI infrastructure",
  "error": "no operator deployment found",
  "stacktrace": "github.com/cloudnative-pg/cloudnative-pg/pkg/management/log.(*logger).Error\n\tpkg/management/log/log.go:125\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/controller.ensurePKI\n\tinternal/cmd/manager/controller/controller.go:380\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/controller.RunController\n\tinternal/cmd/manager/controller/controller.go:222\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/controller.NewCmd.func1\n\tinternal/cmd/manager/controller/cmd.go:40\ngithub.com/spf13/cobra.(*Command).execute\n\tpkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tpkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117\ngithub.com/spf13/cobra.(*Command).Execute\n\tpkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041\nmain.main\n\tcmd/manager/main.go:66\nruntime.main\n\t/opt/hostedtoolcache/go/1.22.5/x64/src/runtime/proc.go:271"
}

Short of the issue in the operator being fixed it should be documented that changing the name will not work and/or remove the ability to change it until the labelSelector is configurable and uses the value set by the helm chart.

This is the same issue as #256 hit.

@itay-grudev itay-grudev added the chart( operator ) Related to the operator (cloudnative-pg) chart label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chart( operator ) Related to the operator (cloudnative-pg) chart
Projects
None yet
Development

No branches or pull requests

2 participants