diff --git a/pkg/operator/ceph/test/containers.go b/pkg/operator/ceph/test/containers.go index 093ff0ddc..aa4181844 100644 --- a/pkg/operator/ceph/test/containers.go +++ b/pkg/operator/ceph/test/containers.go @@ -30,7 +30,7 @@ var requiredEnvVars = []string{ "CONTAINER_IMAGE", "POD_NAME", "POD_NAMESPACE", "NODE_NAME", "ROOK_CEPH_MON_HOST", "ROOK_CEPH_MON_INITIAL_MEMBERS", "POD_CPU_LIMIT", "POD_MEMORY_LIMIT", "POD_MEMORY_REQUEST", - "POD_CPU_REQUEST", + "POD_CPU_REQUEST", "CEPH_USE_RANDOM_NONCE", } // A ContainersTester is a helper exposing methods for testing required Ceph specifications common @@ -130,6 +130,9 @@ func (ct *ContainersTester) AssertEnvVarsContainCephRequirements() { case "POD_CPU_REQUEST": assert.Equal(ct.t, "requests.cpu", e.ValueFrom.ResourceFieldRef.Resource, "POD_CPU_REQUEST env var does not have the appropriate source:", e) + case "CEPH_USE_RANDOM_NONCE": + assert.Equal(ct.t, "true", e.Value, + "CEPH_USE_RANDOM_NONCE env var does not have the appropriate source:", e) } } vars := FindDuplicateEnvVars(c) diff --git a/pkg/operator/k8sutil/pod.go b/pkg/operator/k8sutil/pod.go index e13301c41..f533ec9b8 100644 --- a/pkg/operator/k8sutil/pod.go +++ b/pkg/operator/k8sutil/pod.go @@ -305,6 +305,9 @@ func ClusterDaemonEnvVars(image string) []v1.EnvVar { // If request.cpu is not set in the pod definition, Kubernetes will use the formula "requests.cpu = limits.cpu" during pods's scheduling // Kubernetes will set this variable to 0 or equal to limits.cpu if set {Name: "POD_CPU_REQUEST", ValueFrom: &v1.EnvVarSource{ResourceFieldRef: &v1.ResourceFieldSelector{Resource: "requests.cpu"}}}, + + // All ceph daemons using msgr in a containerized environment expect to set a random nonce at startup + {Name: "CEPH_USE_RANDOM_NONCE", Value: "true"}, } }