17. Spring Cloud Deployer for Kubernetes Properties

The Spring Cloud Deployer for Kubernetes has several properties you can use to configure the apps that it deploys. The configuration is controlled by configuration properties under the spring.cloud.deployer.kubernetes prefix.

17.1 Using Deployments

The deployer uses Replication Controllers by default. To use Deployments instead you can set the following option as part of the container env section in a deployment YAML file. This is now the preferred setting and will be the default in future releases of the deployer.

        env:
        - name: SPRING_CLOUD_DEPLOYER_KUBERNETES_CREATE_DEPLOYMENT
          value: 'true'

17.2 CPU and Memory Limits

You can control the default values to set the cpu and memory requirements for the pods that are created as part of app deployments. You can declare the following as part of the container env section in a deployment YAML file:

        env:
        - name: SPRING_CLOUD_DEPLOYER_KUBERNETES_CPU
          value: 500m
        - name: SPRING_CLOUD_DEPLOYER_KUBERNETES_MEMORY
          value: 640Mi

17.3 Liveness and Rediness Probes Configurations

You can modify the settings used for the liveness and readiness probes. This might be necessary if your cluster is slower and the apps need more time to start up. Here is an example of setting the delay and period for the liveness probe:

        env:
        - name: SPRING_CLOUD_DEPLOYER_KUBERNETES_LIVENESS_PROBE_DELAY
          value: '120'
        - name: SPRING_CLOUD_DEPLOYER_KUBERNETES_LIVENESS_PROBE_PERIOD
          value: '45'

See KubernetesDeployerProperties for more of the supported options.

17.4 Using SPRING_APPLICATION_JSON

Data Flow Server properties that are common across all of the Data Flow Server implementations including the configuration of maven repository settings can be set in a similar manner although the latter might be easier to set using a SPRING_APPLICATION_JSON environment variable like:

        env:
        - name: SPRING_APPLICATION_JSON
          value: "{ \"maven\": { \"local-repository\": null, \"remote-repositories\": { \"repo1\": { \"url\": \"https://repo.spring.io/libs-snapshot\"} } } }"