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

pgv2.percona.com/v2 PerconaPGCluster doesnt handle the replicaCertCopy sidecar resources #706

Open
mgialelis-pm opened this issue Apr 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mgialelis-pm
Copy link

Report

When attempting to create a PerconaPGCluster we need to set the resource and limits on all pods/containers, I can see the that postgresclusters.postgres-operator.crunchydata.com has the ability to set the ReplicaCertCopy resources and seems to be documented https://github.com/percona/percona-postgresql-operator/blob/main/docs/content/tutorial/resize-cluster.md

Tho when attempting to add this to the PerconaPGCluster resource i seem to get errors of the below 2 variants depending how i try to add this in.

W0409 16:26:37.388986   40652 warnings.go:70] unknown field "spec.instances[0].sidecars.replicaCertCopy"
Error: UPGRADE FAILED: failed to replace object: PerconaPGCluster.pgv2.percona.com "svc-db01" is invalid: spec.instances[0].sidecars: Invalid value: "object": spec.instances[0].sidecars in body must be of type array: "object"

Or

"error": "failed to create typed patch object (dev-01/svc-db01-cluster-7429; apps/v1, Kind=StatefulSet): .spec.template.spec.containers: duplicate entries for key [name=\"replication-cert-copy\"]",

Ive checked the CRD for the PerconaPGCluster and there isnt a way that this can be set at any levels at the moment within the yaml files.

I can see the the Crunchy data operators have the
https://github.com/percona/percona-postgresql-operator/blob/main/pkg/apis/postgres-operator.crunchydata.com/v1beta1/postgrescluster_types.go#L534

While the PerconaPGCLuster only implements the core.Container type from the k8s client library's
https://github.com/percona/percona-postgresql-operator/blob/main/pkg/apis/pgv2.percona.com/v2/perconapgcluster_types.go#L524

There also doesnt appear to be any methods on the
https://github.com/percona/percona-postgresql-operator/blob/main/pkg/apis/postgres-operator.crunchydata.com/v1beta1/postgrescluster_types.go#L534

to have similar functionality exposed

More about the problem

See above

Steps to reproduce


# Source: vortex-postgres-cluster/templates/cluster.yaml
apiVersion: pgv2.percona.com/v2
kind: PerconaPGCluster
metadata:
  namespace: dev-01
  annotations:
    current-primary: scheduler-svc-db01
    rollme: "vslEs"
  labels:
    crunchy-pgha-scope: scheduler-svc-db01
    deployment-name: scheduler-svc-db01
    name: scheduler-svc-db01
    pg-cluster: scheduler-svc-db01
    pgo-version: 2.3.1
    pgouser: admin
    helm.sh/chart: vortex-postgres-cluster-0.0.10
    app.kubernetes.io/name: vortex-postgres-cluster
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/version: "2.3.1"
    app.kubernetes.io/managed-by: Helm
  finalizers:
    null
  name: scheduler-svc-db01
spec:
  crVersion: 2.3.1
  image: percona/percona-postgresql-operator:2.3.1-ppg16-postgres
  imagePullPolicy: Always
  port: 5432
  postgresVersion: 16
  standby:
    enabled: false

  openshift: false
  users:
    - name: test
      databases:
        - testdb
      options: SUPERUSER
      password:
        type: ASCII
      secretName: test-credentials

  pause: false
  unmanaged: false

  instances:
    - name: cluster
      sidecars:
        replicaCertCopy:
          resources:
            limits:
              cpu: 200m
              memory: 128Mi
            requests:
              cpu: 200m
              memory: 128Mi
      replicas: 3
      resources:
        limits:
          cpu: 2
          memory: 4Gi
        requests:
          cpu: 2
          memory: 4Gi
      dataVolumeClaimSpec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 5Gi

  proxy:
    pgBouncer:
      image: percona/percona-postgresql-operator:2.3.1-ppg16-pgbouncer
      replicas: 3
      exposeSuperusers: true
      resources:
        requests:
          cpu: 200m
          memory: 128Mi
        limits:
          cpu: 200m
          memory: 128Mi

  pmm:
    enabled: false
    image: percona/pmm-client:2.41.0
    serverHost: monitoring-service
    secret: scheduler-svc-db01-pmm-secret

  backups:
    pgbackrest:
      image: percona/percona-postgresql-operator:2.3.1-ppg16-pgbackrest
      configuration:
        - secret:
            name: scheduler-service-db-backup
      sidecars:
        pgbackrest:
          resources:
            limits:
              cpu: 200m
              memory: 128Mi
            requests:
              cpu: 200m
              memory: 128Mi
        pgbackrestConfig:
          resources:
            limits:
              cpu: 200m
              memory: 128Mi
            requests:
              cpu: 200m
              memory: 128Mi
      jobs:
        priorityClassName: high-priority
        resources:
          limits:
            cpu: 200m
            memory: 128Mi
          requests:
            cpu: 200m
            memory: 128Mi
      manual:
        repoName: repo1
        options:
         - --type=full
      repos:
      - name: repo1
        schedules:
          full: 0 0 * * 6
        volume:
          volumeClaimSpec:
            accessModes:
            - ReadWriteOnce
            resources:
              requests:
                storage: 1Gi

Versions

  1. Kubernetes: 1.28.0
  2. Operator: Percona Pgsql 2.3.4
  3. Database: PerconaPGCluster

Anything else?

No response

@mgialelis-pm mgialelis-pm added the bug Something isn't working label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant