public Deployment initPodTemplateWithoutConfig(
      String image,
      String pullPolicy,
      int cpuLimit,
      String groupName,
      String resourceId,
      String startUpArgs,
      long memory,
      List<LocalObjectReference> imagePullSecretsList) {

    DeploymentBuilder deploymentBuilder =
        new DeploymentBuilder()
            .withNewMetadata()
            .withName(NAME_PREFIX + resourceId)
            .endMetadata()
            .withNewSpec()
            .withReplicas(1)
            .withNewTemplate()
            .withNewMetadata()
            .addToLabels("app", NAME_PREFIX + resourceId)
            .addToLabels("AmoroOptimizerGroup", groupName)
            .addToLabels("AmoroResourceId", resourceId)
            .endMetadata()
            .withNewSpec()
            .addNewContainer()
            .withName("optimizer")
            .withImage(image)
            .withImagePullPolicy(pullPolicy)
            .withCommand("sh", "-c", startUpArgs)
            .withResources(
                new ResourceRequirementsBuilder()
                    .withLimits(
                        ImmutableMap.of(
                            "memory",
                            new Quantity(memory + "Mi"),
                            "cpu",
                            new Quantity(cpuLimit + "")))
                    .withRequests(
                        ImmutableMap.of(
                            "memory",
                            new Quantity(memory + "Mi"),
                            "cpu",
                            new Quantity(cpuLimit + "")))
                    .build())
            .endContainer()
            .endSpec()
            .endTemplate()
            .withNewSelector()
            .addToMatchLabels("app", NAME_PREFIX + resourceId)
            .endSelector()
            .endSpec();
    if (!imagePullSecretsList.isEmpty()) {
      deploymentBuilder
          .editSpec()
          .editTemplate()
          .editSpec()
          .withImagePullSecrets(imagePullSecretsList)
          .endSpec()
          .endTemplate()
          .endSpec();
    }

    return deploymentBuilder.build();
  }
Kubernetes Optimizer Container with Standalone Optimizer
amoro-ams/src/main/java/org/apache/amoro/server/manager/KubernetesOptimizerContainer.java