Skip to content

Commit 5bd96b4

Browse files
authored
Revert "K8SPG-737: expose /pgdata mountpoint for node_exporter (#1113)" (#1188)
1 parent 0232e28 commit 5bd96b4

File tree

6 files changed

+11
-68
lines changed

6 files changed

+11
-68
lines changed

e2e-tests/tests/monitoring-pmm3/08-check-mountpoint-expose.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

e2e-tests/tests/monitoring/08-check-mountpoint-expose.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

internal/controller/postgrescluster/instance.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,9 +1365,6 @@ func generateInstanceStatefulSetIntent(_ context.Context,
13651365
// containers see each other's processes.
13661366
// - https://docs.k8s.io/tasks/configure-pod-container/share-process-namespace/
13671367
sts.Spec.Template.Spec.ShareProcessNamespace = initialize.Bool(true)
1368-
if cluster.CompareVersion("2.7.0") >= 0 {
1369-
sts.Spec.Template.Spec.ShareProcessNamespace = initialize.Bool(false) // K8SPG-737: should be false
1370-
}
13711368

13721369
// Patroni calls the Kubernetes API and pgBackRest may interact with a cloud
13731370
// storage provider. Use the instance ServiceAccount and automatically mount

percona/pmm/pmm.go

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
corev1 "k8s.io/api/core/v1"
88
"k8s.io/apimachinery/pkg/util/intstr"
99

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

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

4443
pmmSpec := pgc.Spec.PMM
4544

46-
volumeMounts := []corev1.VolumeMount{
47-
{
48-
Name: "cert-volume",
49-
MountPath: "/pgconf/tls",
50-
ReadOnly: true,
51-
},
52-
}
53-
if pgc.CompareVersion("2.7.0") >= 0 {
54-
volumeMounts = append(volumeMounts, corev1.VolumeMount{
55-
Name: postgres.DataVolumeMount().Name,
56-
MountPath: postgres.DataVolumeMount().MountPath,
57-
ReadOnly: true,
58-
})
59-
}
60-
6145
return corev1.Container{
6246
Name: "pmm-client",
6347
Image: pmmSpec.Image,
@@ -90,7 +74,13 @@ func sidecarContainerV2(pgc *v2.PerconaPGCluster) corev1.Container {
9074
},
9175
},
9276
},
93-
VolumeMounts: volumeMounts,
77+
VolumeMounts: []corev1.VolumeMount{
78+
{
79+
Name: "cert-volume",
80+
MountPath: "/pgconf/tls",
81+
ReadOnly: true,
82+
},
83+
},
9484
Env: []corev1.EnvVar{
9585
{
9686
Name: "POD_NAME",
@@ -293,13 +283,7 @@ func sidecarContainerV3(pgc *v2.PerconaPGCluster) corev1.Container {
293283
MountPath: "/pgconf/tls",
294284
ReadOnly: true,
295285
},
296-
{
297-
Name: postgres.DataVolumeMount().Name,
298-
MountPath: postgres.DataVolumeMount().MountPath,
299-
ReadOnly: true,
300-
},
301286
},
302-
303287
Env: []corev1.EnvVar{
304288
{
305289
Name: "POD_NAME",

percona/pmm/pmm_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/pkg/errors"
77
"github.com/stretchr/testify/assert"
88
"github.com/stretchr/testify/require"
9+
910
corev1 "k8s.io/api/core/v1"
1011
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1112

@@ -135,6 +136,7 @@ func TestContainer(t *testing.T) {
135136
assert.Contains(t, container.Env, tt.verificationEnvVar())
136137
})
137138
}
139+
138140
}
139141

140142
func TestSidecarContainerV2(t *testing.T) {
@@ -244,7 +246,7 @@ func TestSidecarContainerV2(t *testing.T) {
244246
}
245247
}
246248

247-
assert.Len(t, container.VolumeMounts, 2)
249+
assert.Len(t, container.VolumeMounts, 1)
248250
assert.Equal(t, "/pgconf/tls", container.VolumeMounts[0].MountPath)
249251
assert.True(t, container.VolumeMounts[0].ReadOnly)
250252
}
@@ -351,7 +353,7 @@ func TestSidecarContainerV3(t *testing.T) {
351353
}
352354
}
353355

354-
assert.Len(t, container.VolumeMounts, 2)
356+
assert.Len(t, container.VolumeMounts, 1)
355357
assert.Equal(t, "/pgconf/tls", container.VolumeMounts[0].MountPath)
356358
assert.True(t, container.VolumeMounts[0].ReadOnly)
357359
}

0 commit comments

Comments
 (0)