Skip to content

Revert "K8SPG-737: expose /pgdata mountpoint for node_exporter (#1113)" #1188

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

Merged
merged 1 commit into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions e2e-tests/tests/monitoring-pmm3/08-check-mountpoint-expose.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions e2e-tests/tests/monitoring/08-check-mountpoint-expose.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions internal/controller/postgrescluster/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -1365,9 +1365,6 @@ func generateInstanceStatefulSetIntent(_ context.Context,
// containers see each other's processes.
// - https://docs.k8s.io/tasks/configure-pod-container/share-process-namespace/
sts.Spec.Template.Spec.ShareProcessNamespace = initialize.Bool(true)
if cluster.CompareVersion("2.7.0") >= 0 {
sts.Spec.Template.Spec.ShareProcessNamespace = initialize.Bool(false) // K8SPG-737: should be false
}

// Patroni calls the Kubernetes API and pgBackRest may interact with a cloud
// storage provider. Use the instance ServiceAccount and automatically mount
Expand Down
30 changes: 7 additions & 23 deletions percona/pmm/pmm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"

"github.com/percona/percona-postgresql-operator/internal/postgres"
v2 "github.com/percona/percona-postgresql-operator/pkg/apis/pgv2.percona.com/v2"
)

Expand Down Expand Up @@ -43,21 +42,6 @@ func sidecarContainerV2(pgc *v2.PerconaPGCluster) corev1.Container {

pmmSpec := pgc.Spec.PMM

volumeMounts := []corev1.VolumeMount{
{
Name: "cert-volume",
MountPath: "/pgconf/tls",
ReadOnly: true,
},
}
if pgc.CompareVersion("2.7.0") >= 0 {
volumeMounts = append(volumeMounts, corev1.VolumeMount{
Name: postgres.DataVolumeMount().Name,
MountPath: postgres.DataVolumeMount().MountPath,
ReadOnly: true,
})
}

return corev1.Container{
Name: "pmm-client",
Image: pmmSpec.Image,
Expand Down Expand Up @@ -90,7 +74,13 @@ func sidecarContainerV2(pgc *v2.PerconaPGCluster) corev1.Container {
},
},
},
VolumeMounts: volumeMounts,
VolumeMounts: []corev1.VolumeMount{
{
Name: "cert-volume",
MountPath: "/pgconf/tls",
ReadOnly: true,
},
},
Env: []corev1.EnvVar{
{
Name: "POD_NAME",
Expand Down Expand Up @@ -293,13 +283,7 @@ func sidecarContainerV3(pgc *v2.PerconaPGCluster) corev1.Container {
MountPath: "/pgconf/tls",
ReadOnly: true,
},
{
Name: postgres.DataVolumeMount().Name,
MountPath: postgres.DataVolumeMount().MountPath,
ReadOnly: true,
},
},

Env: []corev1.EnvVar{
{
Name: "POD_NAME",
Expand Down
6 changes: 4 additions & 2 deletions percona/pmm/pmm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[goimports-reviser] reported by reviewdog 🐶

Suggested change

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down Expand Up @@ -135,6 +136,7 @@ func TestContainer(t *testing.T) {
assert.Contains(t, container.Env, tt.verificationEnvVar())
})
}

}

func TestSidecarContainerV2(t *testing.T) {
Expand Down Expand Up @@ -244,7 +246,7 @@ func TestSidecarContainerV2(t *testing.T) {
}
}

assert.Len(t, container.VolumeMounts, 2)
assert.Len(t, container.VolumeMounts, 1)
assert.Equal(t, "/pgconf/tls", container.VolumeMounts[0].MountPath)
assert.True(t, container.VolumeMounts[0].ReadOnly)
}
Expand Down Expand Up @@ -351,7 +353,7 @@ func TestSidecarContainerV3(t *testing.T) {
}
}

assert.Len(t, container.VolumeMounts, 2)
assert.Len(t, container.VolumeMounts, 1)
assert.Equal(t, "/pgconf/tls", container.VolumeMounts[0].MountPath)
assert.True(t, container.VolumeMounts[0].ReadOnly)
}
Loading