diff --git a/pkg/daemon/ceph/osd/encryption.go b/pkg/daemon/ceph/osd/encryption.go index 6d8f06c14..9eac72c08 100644 --- a/pkg/daemon/ceph/osd/encryption.go +++ b/pkg/daemon/ceph/osd/encryption.go @@ -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 diff --git a/pkg/operator/ceph/cluster/osd/envs.go b/pkg/operator/ceph/cluster/osd/envs.go index 33fede4db..c82edb060 100644 --- a/pkg/operator/ceph/cluster/osd/envs.go +++ b/pkg/operator/ceph/cluster/osd/envs.go @@ -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"}, diff --git a/pkg/operator/ceph/cluster/osd/provision_spec.go b/pkg/operator/ceph/cluster/osd/provision_spec.go index 81166ca95..4b15bc8c1 100644 --- a/pkg/operator/ceph/cluster/osd/provision_spec.go +++ b/pkg/operator/ceph/cluster/osd/provision_spec.go @@ -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 {