Merge pull request #15910 from rook/mergify/bp/release-1.17/pr-15907

osd: don't set dmcrypt env in prepare pod job spec (backport #15907)
This commit is contained in:
mergify[bot] authored and GitHub committed 2025-05-29 15:52:11 +00:00
commit 650973d07b
3 files changed
-25

No files matched your search

-7
View File
@@ -70,13 +70,6 @@ func setKEKinEnv(context *clusterd.Context, clusterInfo *cephclient.ClusterInfo)
// pick it up
clusterSpec := &v1.ClusterSpec{Security: v1.SecuritySpec{KeyManagementService: v1.KeyManagementServiceSpec{ConnectionDetails: kms.ConfigEnvsToMapString()}}}
// If KMS is not enabled this code does not need to run since we attach the KEK value from the
// Kubernetes Secret in the provision pod spec (mounted as an environment variable)
if !clusterSpec.Security.KeyManagementService.IsEnabled() {
logger.Debug("cluster-wide encryption is enabled with kubernetes secrets and the kek is attached to the provision env spec")
return nil
}
// The ibm key protect library does not read any environment variables, so we must set the
// service api key (coming from the secret mounted as environment variable) in the KMS
// connection details. These details are used to build the client connection
-15
View File
@@ -20,7 +20,6 @@ import (
"strconv"
"github.com/rook/rook/pkg/daemon/ceph/client"
kms "github.com/rook/rook/pkg/daemon/ceph/osd/kms"
opmon "github.com/rook/rook/pkg/operator/ceph/cluster/mon"
"github.com/rook/rook/pkg/operator/k8sutil"
"gopkg.in/ini.v1"
@@ -190,20 +189,6 @@ func pvcNameEnvVar(pvcName string) v1.EnvVar {
return v1.EnvVar{Name: PVCNameEnvVarName, Value: pvcName}
}
func cephVolumeRawEncryptedEnvVarFromSecret(osdProps osdProperties) v1.EnvVar {
return v1.EnvVar{
Name: CephVolumeEncryptedKeyEnvVarName,
ValueFrom: &v1.EnvVarSource{
SecretKeyRef: &v1.SecretKeySelector{
LocalObjectReference: v1.LocalObjectReference{
Name: kms.GenerateOSDEncryptionSecretName(osdProps.pvc.ClaimName),
},
Key: kms.OsdEncryptionSecretNameKeyName,
},
},
}
}
func cephVolumeEnvVar() []v1.EnvVar {
return []v1.EnvVar{
{Name: "CEPH_VOLUME_DEBUG", Value: "1"},
@@ -294,12 +294,9 @@ func (c *Cluster) provisionOSDContainer(osdProps osdProperties, copyBinariesMoun
}
envVars = append(envVars, kms.ConfigToEnvVar(c.spec)...)
if c.spec.Security.KeyManagementService.IsKMIPKMS() {
envVars = append(envVars, cephVolumeRawEncryptedEnvVarFromSecret(osdProps))
_, volmeMountsKMIP := kms.KMIPVolumeAndMount(c.spec.Security.KeyManagementService.TokenSecretName)
volumeMounts = append(volumeMounts, volmeMountsKMIP)
}
} else {
envVars = append(envVars, cephVolumeRawEncryptedEnvVarFromSecret(osdProps))
}
}
} else {