def _PrepareDeployment(benchmark_spec):
  """Deploys MongoDB Operator and instance on the cluster."""
  cluster = benchmark_spec.container_cluster
  admin_password = ''.join(
      random.choice(string.ascii_letters + string.digits) for _ in range(20))
  storage_class = STORAGE_CLASS.value or cluster.GetDefaultStorageClass()
  cluster.ApplyManifest(
      'container/kubernetes_mongodb/kubernetes_mongodb_crd.yaml')
  cluster.ApplyManifest(
      'container/kubernetes_mongodb/kubernetes_mongodb_operator.yaml.j2',
      cpu_request=FLAGS.kubernetes_mongodb_cpu_request,
      cpu_limit=FLAGS.kubernetes_mongodb_cpu_limit,
      memory_request=FLAGS.kubernetes_mongodb_memory_request,
      memory_limit=FLAGS.kubernetes_mongodb_memory_limit,
      disk_size=FLAGS.kubernetes_mongodb_disk_size,
      storage_class=storage_class,
      admin_password=admin_password)
  time.sleep(60)

  benchmark_spec.container_cluster.WaitForResource('pod/mongodb-0', 'Ready')
  mongodb_cluster_ip = benchmark_spec.container_cluster.GetClusterIP(
      'mongodb-service')
  benchmark_spec.mongodb_url = 'mongodb://ycsb:{password}@{ip_address}:27017/ycsb?authSource=ycsb'.format(
      password=admin_password, ip_address=mongodb_cluster_ip)