postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

operator installation thruoght helm does not work

Open houshym opened this issue 4 years ago • 12 comments

Hi I did: 1- git clone https://github.com/zalando/postgres-operator.git 2- helm install postgres-operator ./charts/postgres-operator

I got following error

helm install postgres-operator ./charts/postgres-operator
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(OperatorConfiguration.configuration.kubernetes): unknown field "enable_cross_namespace_secret" in do.zalan.acid.v1.OperatorConfiguration.configuration.kubernete

houshym avatar Aug 25 '21 17:08 houshym

See ##1346 and #1440. It's a new field (for v1.7.0, which isn't released yet) which does not exist in your CRD.

FxKu avatar Aug 26 '21 13:08 FxKu

Hi @houshym You should delete the old CustomResourceDefinitions

thedv91 avatar Aug 30 '21 05:08 thedv91

it is brand new cluster

houshym avatar Aug 30 '21 05:08 houshym

helm upgrade should update any custom CRDs, but:

manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
manifest_sorter.go:192: info: skipping unknown hook: "crd-install"
Error: UPGRADE FAILED: error validating "": error validating data: [ValidationError(OperatorConfiguration.configuration.kubernetes): unknown field "enable_cross_namespace_secret" in do.zalan.acid.v1.OperatorConfiguration.configuration.kubernetes, ValidationError(OperatorConfiguration.configuration.teams_api): unknown field "enable_team_member_deprecation" in do.zalan.acid.v1.OperatorConfiguration.configuration.teams_api, ValidationError(OperatorConfiguration.configuration.teams_api): unknown field "role_deletion_suffix" in do.zalan.acid.v1.OperatorConfiguration.configuration.teams_api]

taxilian avatar Oct 02 '21 21:10 taxilian

Im running into the same issue after upgrading from 1.6.2 to 1.7.0.

How am i supposed to update in an environment where there is existing Postgres "Clusters"? If i delete the crd, i need to basicly reinstall the operator via Helm. But that should AFAIK also delete the existing Postgres "clusters".

What is the right way to do this upgrade in a live environment?

yfoelling avatar Oct 08 '21 08:10 yfoelling

In general Helm does not yet have a recommended way to upgrade CRDs. In my case, after verifying that the new CRDs were compatible with my existing resources (no fields renamed, for example), I was able to simply kubectl apply -f path/to/new/crd.yaml each of the CRDs to update them. Requiring manual intervention via kubectl isn't ideal, especially if you're using some kind of GitOps-based workflow, but since Helm doesn't yet have a solution this may be your best option.

wlritchi avatar Oct 16 '21 00:10 wlritchi

Thanks for the input, i will try that

yfoelling avatar Oct 21 '21 08:10 yfoelling

I have the same issue, trying to install helm chart for the first time into k8s cluster, i.e. there are no CRDs yet:

Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: [ValidationError(OperatorConfiguration.configuration.load_balancer): unknown field "enable_master_pooler_load_balancer" in do.zalan.acid.v1.OperatorConfiguration.configuration.load_balancer, ValidationError(OperatorConfiguration.configuration.load_balancer): unknown field "enable_replica_pooler_load_balancer" in do.zalan.acid.v1.OperatorConfiguration.configuration.load_balancer]

Using latest helm repo

$ helm repo add postgres-operator https://opensource.zalando.com/postgres-operator/charts/postgres-operator/
$ helm repo update postgres-operator

$ helm show chart postgres-operator/postgres-operator
apiVersion: v1
appVersion: 1.7.1
version: 1.7.1
.....

Using custom helm values ( postgres-operator-helm-values.yaml, adopted from latest values.yaml ):

configLoadBalancer:
  # DNS zone for cluster DNS name when load balancer is configured for cluster
  #db_hosted_zone: db.example.com
  # toggles service type load balancer pointing to the master pod of the cluster
  enable_master_load_balancer: true
  # toggles service type load balancer pointing to the master pooler pod of the cluster
  enable_master_pooler_load_balancer: true
  # toggles service type load balancer pointing to the replica pod of the cluster
  enable_replica_load_balancer: true
  # toggles service type load balancer pointing to the replica pooler pod of the cluster
  enable_replica_pooler_load_balancer: true

Installing with

helm upgrade --wait --install --namespace postgres-operator \
             --values postgres-operator-helm-values.yaml \
             postgres-operator postgres-operator/postgres-operator

After the helm install failed, I see the following CRDs in my k8s cluster:

  • operatorconfigurations.acid.zalan.do
  • postgresqls.acid.zalan.do
  • postgresteams.acid.zalan.do

manuel-koch avatar Apr 01 '22 10:04 manuel-koch

Looks like the latest values.yaml doesn't match the latest Chart.yaml. I.e. although the values.yaml has breaking changes, the Chart.yaml still claims to be version 1.7.1.

manuel-koch avatar Apr 01 '22 11:04 manuel-koch

I'm having this issue also, the chart version hasn't been upgraded but the chart has been modified

yevon avatar Apr 19 '22 20:04 yevon

Fixed by deleting uninstalling the operator, deleting the zalando operator CRD and installing again

yevon avatar Apr 19 '22 20:04 yevon

Like @yevon said, after uninstalling the operator and running these commands, it worked:

kubectl delete crd operatorconfigurations.acid.zalan.do
kubectl delete crd postgresqls.acid.zalan.do
kubectl delete crd postgresteams.acid.zalan.do

Tim-herbie avatar Oct 20 '24 08:10 Tim-herbie