spring-cloud / spring-cloud-deployer

The Spring Cloud Deployer project defines an SPI for deploying long lived applications and short lived tasks
162 stars 87 forks source link

Update InitContainers Docs #477

Open Wordbe opened 1 month ago

Wordbe commented 1 month ago

Problem description: The options for initContainers described in the document https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#_init_containers differ from the options used in regular Kubernetes pods. This discrepancy causes confusion for users who are familiar with standard pod syntax.

Solution description: We request an enhancement of the documentation. Please introduce and explain the various options available for initContainers in the document. Specifically, clarify the following options:

Additionally, it would be helpful to provide an example of how to use these options in a YAML file, such as:

data:
  application.yaml: |-
    spring:
      cloud:
        dataflow:
          task:
            platform:
              kubernetes:
                accounts:
                  default:
                    initContainers:
                      - containerName: test
                        imageName: busybox:latest
                        commands: 
                          - sh
                          - -c
                          - echo hello
                      - containerName: test2
                        imageName: busybox:latest
                        commands:
                          - sh
                          - -c
                          - echo world

Furthermore, please include information about other possible options, such as:

ilayaperumalg commented 1 month ago

Hi @Wordbe , Thanks for reporting the issue.

Looking at the initContainers configuration, it doesn't look like a discrepancy with the document as the K8s deployer properties are set for the initContainers with containerName and imageName etc., from K8s deployer configuration - not as name and image.

In introspect, this was an unfortunate choice of property name as it would have been simpler to choose the actual K8s initContainer property names. In the upcoming release, we will try to see if we can find a way to consolidate with the actual K8s property keys for better property management.