Comments (2)
Hello,
I have the same isssue i've created: cloudnative-pg/charts#287, here is the details of the ticket:
Hello,
When creating a cluster and specifying the access mode type, the type is appended to a hardcoded value which is the ReadWriteOnce:
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: yacine-rwm
namespace: source
spec:
instances: 1
storage:
pvcTemplate:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: sc-cus
volumeMode: Filesystem
walStorage:
pvcTemplate:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: sc-cus
volumeMode: Filesystem
The auto created pvcs have the following specs:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: yacine-rwm-1
namespace: source
spec:
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: sc-cus
volumeMode: Filesystem
volumeName: pvc-xx-xxxx-xxxxxx-xxxxxxxxxx-xxxxxxxxx-x
and
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: yacine-rwm-1-wal
namespace: source
spec:
accessModes:
- ReadWriteOnce
- ReadWriteOnce
resources:
requests:
storage: 1Gi
volumeName: pvc-xx-xxxx-xxxxxx-xxxxxxxxxx-xxxxxxxxx-x
storageClassName: sc-cus
volumeMode: Filesystem
The same thing happen if we create a cluster with ReadWriteOnce access mode:
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: yacine-rwo
namespace: source
spec:
instances: 1
storage:
pvcTemplate:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: sc-cus
volumeMode: Filesystem
walStorage:
pvcTemplate:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: sc-cus
volumeMode: Filesystem
The pvcs created have ReadWriteOnce access mode duplicated:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: yacine-rwo-1
namespace: source
spec:
accessModes:
- ReadWriteOnce
- ReadWriteOnce
resources:
requests:
storage: 1Gi
volumeName: pvc-xx-xxxx-xxxxxx-xxxxxxxxxx-xxxxxxxxx-x
storageClassName: sc-cus
volumeMode: Filesystem
and:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: yacine-rwo-1
namespace: source
spec:
accessModes:
- ReadWriteOnce
- ReadWriteOnce
resources:
requests:
storage: 1Gi
volumeName: pvc-xx-xxxx-xxxxxx-xxxxxxxxxx-xxxxxxxxx-x
storageClassName: sc-cus
volumeMode: Filesystem
The same result if we mix the types, meaning that if we use RWO for storage data and RWX for wals or vice-versa, the pvcs will always have the ReadWriteOnce value + the one we configure in our cluster definition.
we can find the definition of the funtion that generate the pvc here:
I think what should be done, is to check if the user don't define a value for AccessMode we keep the ReadWriteOnce as a default value, otherwise, use the defined value by the user. (https://github.com/cloudnative-pg/cloudnative-pg/blob/267e7cc1416241453c3e0a1d5ec257e806b184fd/internal/cmd/plugin/fio/fio.go#L103C4-L103C74)
Thank you for fixing this issue :).
Regards,
from cloudnative-pg.
Hello,
if you can confirm that it's a trending that you observe also please.
Just to clarify the issue, it is also a problem with prometheus and alert PrometheusDuplicateTimestamps
.
Due to the fact that you fill twice with the same value, it creates from kube-state-metrics
the same metrics twice.
We have prometheus log filled with:
ts=2024-05-22T11:52:17.520Z caller=scrape.go:1738 level=warn component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Error on ingesting samples with different value but same timestamp" num_dropped=12
and with debug enabled:
ts=2024-05-22T11:52:17.486Z caller=scrape.go:1777 level=debug component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Duplicate sample for timestamp" series="kube_persistentvolumeclaim_access_mode{namespace=\"precious-dev\",persistentvolumeclaim=\"precious-1-wal\",access_mode=\"ReadWriteOnce\"}"
ts=2024-05-22T11:52:17.487Z caller=scrape.go:1777 level=debug component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Duplicate sample for timestamp" series="kube_persistentvolumeclaim_access_mode{namespace=\"precious-prod\",persistentvolumeclaim=\"precious-1-wal\",access_mode=\"ReadWriteOnce\"}"
ts=2024-05-22T11:52:17.487Z caller=scrape.go:1777 level=debug component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Duplicate sample for timestamp" series="kube_persistentvolumeclaim_access_mode{namespace=\"precious-pprod\",persistentvolumeclaim=\"precious-1\",access_mode=\"ReadWriteOnce\"}"
ts=2024-05-22T11:52:17.487Z caller=scrape.go:1777 level=debug component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Duplicate sample for timestamp" series="kube_persistentvolumeclaim_access_mode{namespace=\"precious-rct\",persistentvolumeclaim=\"precious-1\",access_mode=\"ReadWriteOnce\"}"
ts=2024-05-22T11:52:17.487Z caller=scrape.go:1777 level=debug component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Duplicate sample for timestamp" series="kube_persistentvolumeclaim_access_mode{namespace=\"precious-rcti\",persistentvolumeclaim=\"precious-1\",access_mode=\"ReadWriteOnce\"}"
ts=2024-05-22T11:52:17.487Z caller=scrape.go:1777 level=debug component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Duplicate sample for timestamp" series="kube_persistentvolumeclaim_access_mode{namespace=\"precious-dev\",persistentvolumeclaim=\"precious-1\",access_mode=\"ReadWriteOnce\"}"
ts=2024-05-22T11:52:17.487Z caller=scrape.go:1777 level=debug component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Duplicate sample for timestamp" series="kube_persistentvolumeclaim_access_mode{namespace=\"precious-pprod\",persistentvolumeclaim=\"precious-1-wal\",access_mode=\"ReadWriteOnce\"}"
ts=2024-05-22T11:52:17.487Z caller=scrape.go:1777 level=debug component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Duplicate sample for timestamp" series="kube_persistentvolumeclaim_access_mode{namespace=\"precious-prod\",persistentvolumeclaim=\"precious-3-wal\",access_mode=\"ReadWriteOnce\"}"
ts=2024-05-22T11:52:17.487Z caller=scrape.go:1777 level=debug component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Duplicate sample for timestamp" series="kube_persistentvolumeclaim_access_mode{namespace=\"precious-rcti\",persistentvolumeclaim=\"precious-1-wal\",access_mode=\"ReadWriteOnce\"}"
ts=2024-05-22T11:52:17.487Z caller=scrape.go:1777 level=debug component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Duplicate sample for timestamp" series="kube_persistentvolumeclaim_access_mode{namespace=\"precious-rct\",persistentvolumeclaim=\"precious-1-wal\",access_mode=\"ReadWriteOnce\"}"
ts=2024-05-22T11:52:17.487Z caller=scrape.go:1777 level=debug component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Duplicate sample for timestamp" series="kube_persistentvolumeclaim_access_mode{namespace=\"precious-prod\",persistentvolumeclaim=\"precious-1\",access_mode=\"ReadWriteOnce\"}"
ts=2024-05-22T11:52:17.487Z caller=scrape.go:1777 level=debug component="scrape manager" scrape_pool=serviceMonitor/monitoring/kube-prometheus-stack-kube-state-metrics/0 target=http://10.42.xx.yy:8080/metrics msg="Duplicate sample for timestamp" series="kube_persistentvolumeclaim_access_mode{namespace=\"precious-prod\",persistentvolumeclaim=\"precious-3\",access_mode=\"ReadWriteOnce\"}"
Problem is referenced here and here for example.
from cloudnative-pg.
Related Issues (20)
- [Bug]: conflict while updating phases after having changed the status
- [Bug]: Wrong credentials in application secret after promoting a Replica Cluster
- [Feature]: Ability to set timeouts for liveness probes on pods
- Backport failure for pull request 4622 HOT 1
- [Bug]: Request to delete unexisting volume [1.22.2] HOT 1
- [Bug]: Backup failure in Replica Mode E2Es
- [Bug]: CNPG Plugin displays wrong image version of POD when using ImageCatalogRef HOT 1
- Backport failure for pull request 4182 HOT 1
- [Bug]: instance manager quitting without a proper shutdown HOT 1
- Switchovers for replica clusters HOT 1
- Declarative database management
- Kubernetes' `VolumeGroupSnapshot` API support
- Remove Barman Cloud requirement for backup and recovery
- Declarative support for PostgreSQL major online upgrades
- Foreign data wrappers for Postgres
- Test PostgreSQL 17 rc, alpha, beta HOT 3
- PostgreSQL 17 support
- Chore: Separate API definitions and methods
- [Docs]: ImageCatalog installation example not working with a git softlink
- [Bug]: Wrong timezone used in timestamps received from barman-cloud-backup-list
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudnative-pg.