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

[Bug]: Cannot create Pooler with nodePort specified in "serviceTemplate" #4517

Open
4 tasks done
hashmap-kz opened this issue May 12, 2024 · 0 comments
Open
4 tasks done
Assignees
Labels
triage Pending triage

Comments

@hashmap-kz
Copy link

Is there an existing issue already for this bug?

  • I have searched for an existing issue, and could not find anything. I believe this is a new bug.

I have read the troubleshooting guide

  • I have read the troubleshooting guide and I think this is a new bug.

I am running a supported version of CloudNativePG

  • I have read the troubleshooting guide and I think this is a new bug.

Contact Details

[email protected]

Version

1.23.0

What version of Kubernetes are you using?

1.30 (unsuppprted)

What is your Kubernetes environment?

Self-managed: kind (evaluation)

How did you install the operator?

Helm

What happened?

Hello. I'm trying to create a Pooler with a nodePort, specified in serviceTemplate.

I tried to set only a name of a port, trying not to set a port at all. But I cannot achieve the result.

Thank you.

Cluster resource

apiVersion: postgresql.cnpg.io/v1
kind: Pooler
metadata:
  name: pooler-example-rw
  namespace: cnpg-tmp

spec:
  cluster:
    name: cluster-example

  # TODO: how to set exact port?
  serviceTemplate:
    spec:
      type: NodePort
      ports:
        - name: pgbouncer-np
          nodePort: 30852
          port: 5432
          protocol: TCP
          targetPort: pgbouncer

  instances: 3
  type: rw
  pgbouncer:
    poolMode: session
    parameters:
      max_client_conn: "1000"
      default_pool_size: "10"

Relevant log output

{
  "level": "error",
  "ts": "2024-05-12T08:03:32Z",
  "msg": "Reconciler error",
  "controller": "pooler",
  "controllerGroup": "postgresql.cnpg.io",
  "controllerKind": "Pooler",
  "Pooler": { "name": "pooler-example-rw", "namespace": "cnpg-tmp" },
  "namespace": "cnpg-tmp",
  "name": "pooler-example-rw",
  "reconcileID": "0c3b93f1-b6cb-4c1e-ba79-2066fbfb8845",
  "error": 'Service "pooler-example-rw" is invalid: [spec.ports[1].nodePort: Duplicate value: 30852, spec.ports[1]: Duplicate value: core.ServicePort{Name:"", Protocol:"TCP", AppProtocol:(*string)(nil), Port:5432, TargetPort:intstr.IntOrString{Type:0, IntVal:0, StrVal:""}, NodePort:0}]',
  "stacktrace": "sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tpkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:329\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tpkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tpkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227",
}

Code of Conduct

  • I agree to follow this project's Code of Conduct
@hashmap-kz hashmap-kz added the triage Pending triage label May 12, 2024
@armru armru self-assigned this May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Pending triage
Projects
None yet
Development

No branches or pull requests

3 participants