Skip to content

Latest commit

 

History

History
651 lines (510 loc) · 17.9 KB

maven-container.md

File metadata and controls

651 lines (510 loc) · 17.9 KB

maven-container reference

Below is the schema reference for the maven-container module type. For an introduction to configuring Garden modules, please look at our Configuration guide.

The reference is divided into two sections. The first section lists and describes the available schema keys. The second section contains the complete YAML schema.

Configuration keys

module

Configuration for a container module.

Type Required
object No

module.build

module > build

Specify how to build the module. Note that plugins may define additional keys on this object.

Type Required
object No

module.build.dependencies[]

module > build > dependencies

A list of modules that must be built before this module is built.

Type Required
array[object] No

Example:

module:
  ...
  build:
    ...
    dependencies:
      - name: some-other-module-name

module.build.dependencies[].name

module > build > dependencies > name

Module name to build ahead of this module.

Type Required
string Yes

module.build.dependencies[].copy[]

module > build > dependencies > copy

Specify one or more files or directories to copy from the built dependency to this module.

Type Required
array[object] No

module.build.dependencies[].copy[].source

module > build > dependencies > copy > source

POSIX-style path or filename of the directory or file(s) to copy to the target.

Type Required
string Yes

module.build.dependencies[].copy[].target

module > build > dependencies > copy > target

POSIX-style path or filename to copy the directory or file(s) to (defaults to same as source path).

Type Required
string No

module.build.targetImage

module > build > targetImage

For multi-stage Dockerfiles, specify which image to build (see https://docs.docker.com/engine/reference/commandline/build/#specifying-target-build-stage---target for details).

Type Required
string No

module.buildArgs

module > buildArgs

Specify build arguments to use when building the container image.

Type Required
object No

module.image

module > image

Specify the image name for the container. Should be a valid Docker image identifier. If specified and the module does not contain a Dockerfile, this image will be used to deploy services for this module. If specified and the module does contain a Dockerfile, this identifier is used when pushing the built image.

Type Required
string No

module.hotReload

module > hotReload

Specifies which files or directories to sync to which paths inside the running containers of hot reload-enabled services when those files or directories are modified. Applies to this module's services, and to services with this module as their sourceModule.

Type Required
object No

module.hotReload.sync[]

module > hotReload > sync

Specify one or more source files or directories to automatically sync into the running container.

Type Required
array[object] Yes

module.hotReload.sync[].source

module > hotReload > sync > source

POSIX-style path of the directory to sync to the target, relative to the module's top-level directory. Must be a relative path if provided. Defaults to the module's top-level directory if no value is provided.

Type Required
string No

Example:

module:
  ...
  hotReload:
    ...
    sync:
      - source: "src"

module.hotReload.sync[].target

module > hotReload > sync > target

POSIX-style absolute path to sync the directory to inside the container. The root path (i.e. "/") is not allowed.

Type Required
string Yes

Example:

module:
  ...
  hotReload:
    ...
    sync:
      - target: "/app/src"

module.dockerfile

module > dockerfile

POSIX-style name of Dockerfile, relative to project root. Defaults to $MODULE_ROOT/Dockerfile.

Type Required
string No

module.services[]

module > services

The list of services to deploy from this container module.

Type Required
array[object] No

module.services[].name

module > services > name

Valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes, must start with a letter, and cannot end with a dash), cannot contain consecutive dashes or start with garden, or be longer than 63 characters.

Type Required
string Yes

module.services[].dependencies[]

module > services > dependencies

The names of any services that this service depends on at runtime, and the names of any tasks that should be executed before this service is deployed.

Type Required
array[string] No

module.services[].annotations

module > services > annotations

Annotations to attach to the service (Note: May not be applicable to all providers)

Type Required
object No

module.services[].args[]

module > services > args

The arguments to run the container with when starting the service.

Type Required
array[string] No

module.services[].daemon

module > services > daemon

Whether to run the service as a daemon (to ensure only one runs per node).

Type Required
boolean No

module.services[].ingresses[]

module > services > ingresses

List of ingress endpoints that the service exposes.

Type Required
array[object] No

Example:

module:
  ...
  services:
    - ingresses:
      - path: /api
        port: http

module.services[].ingresses[].annotations

module > services > ingresses > annotations

Annotations to attach to the ingress (Note: May not be applicable to all providers)

Type Required
object No

module.services[].ingresses[].hostname

module > services > ingresses > hostname

The hostname that should route to this service. Defaults to the default hostname configured in the provider configuration.

Note that if you're developing locally you may need to add this hostname to your hosts file.

Type Required
string No

module.services[].ingresses[].path

module > services > ingresses > path

The path which should be routed to the service.

Type Required
string No

module.services[].ingresses[].port

module > services > ingresses > port

The name of the container port where the specified paths should be routed.

Type Required
string Yes

module.services[].env

module > services > env

Key/value map of environment variables. Keys must be valid POSIX environment variable names (must not start with GARDEN) and values must be primitives.

Type Required
object No

module.services[].healthCheck

module > services > healthCheck

Specify how the service's health should be checked after deploying.

Type Required
object No

module.services[].healthCheck.httpGet

module > services > healthCheck > httpGet

Set this to check the service's health by making an HTTP request.

Type Required
object No

module.services[].healthCheck.httpGet.path

module > services > healthCheck > httpGet > path

The path of the service's health check endpoint.

Type Required
string Yes

module.services[].healthCheck.httpGet.port

module > services > healthCheck > httpGet > port

The name of the port where the service's health check endpoint should be available.

Type Required
string Yes

module.services[].healthCheck.httpGet.scheme

module > services > healthCheck > httpGet > scheme

Type Required
string No

module.services[].healthCheck.command[]

module > services > healthCheck > command

Set this to check the service's health by running a command in its container.

Type Required
array[string] No

module.services[].healthCheck.tcpPort

module > services > healthCheck > tcpPort

Set this to check the service's health by checking if this TCP port is accepting connections.

Type Required
string No

module.services[].hotReloadArgs[]

module > services > hotReloadArgs

If this module uses the hotReload field, the container will be run with these arguments instead of those in args when the service is deployed with hot reloading enabled.

Type Required
array[string] No

module.services[].ports[]

module > services > ports

List of ports that the service container exposes.

Type Required
array[object] No

module.services[].ports[].name

module > services > ports > name

The name of the port (used when referencing the port elsewhere in the service configuration).

Type Required
string Yes

module.services[].ports[].protocol

module > services > ports > protocol

The protocol of the port.

Type Required
string No

module.services[].ports[].containerPort

module > services > ports > containerPort

The port exposed on the container by the running process. This will also be the default value for servicePort. servicePort:80 -> containerPort:8080 -> process:8080

Type Required
number Yes

Example:

module:
  ...
  services:
    - ports:
        - containerPort: "8080"

module.services[].ports[].servicePort

module > services > ports > servicePort

The port exposed on the service. Defaults to containerPort if not specified. servicePort:80 -> containerPort:8080 -> process:8080

Type Required
number No

Example:

module:
  ...
  services:
    - ports:
        - servicePort: "80"

module.services[].ports[].hostPort

module > services > ports > hostPort

Type Required
number No

module.services[].ports[].nodePort

module > services > ports > nodePort

Set this to expose the service on the specified port on the host node (may not be supported by all providers).

Type Required
number No

module.services[].volumes[]

module > services > volumes

List of volumes that should be mounted when deploying the container.

Type Required
array[object] No

module.services[].volumes[].name

module > services > volumes > name

The name of the allocated volume.

Type Required
string Yes

module.services[].volumes[].containerPath

module > services > volumes > containerPath

The path where the volume should be mounted in the container.

Type Required
string Yes

module.services[].volumes[].hostPath

module > services > volumes > hostPath

Type Required
string No

module.tests[]

module > tests

A list of tests to run in the module.

Type Required
array[object] No

module.tests[].name

module > tests > name

The name of the test.

Type Required
string Yes

module.tests[].dependencies[]

module > tests > dependencies

The names of any services that must be running, and the names of any tasks that must be executed, before the test is run.

Type Required
array[string] No

module.tests[].timeout

module > tests > timeout

Maximum duration (in seconds) of the test run.

Type Required
number No

module.tests[].args[]

module > tests > args

The arguments used to run the test inside the container.

Type Required
array[string] No

Example:

module:
  ...
  tests:
    - args:
      - npm
      - test

module.tests[].env

module > tests > env

Key/value map of environment variables. Keys must be valid POSIX environment variable names (must not start with GARDEN) and values must be primitives.

Type Required
object No

module.tasks[]

module > tasks

A list of tasks that can be run from this container module. These can be used as dependencies for services (executed before the service is deployed) or for other tasks.

Type Required
array[object] No

module.tasks[].name

module > tasks > name

The name of the task.

Type Required
string Yes

module.tasks[].description

module > tasks > description

A description of the task.

Type Required
string No

module.tasks[].dependencies[]

module > tasks > dependencies

The names of any tasks that must be executed, and the names of any services that must be running, before this task is executed.

Type Required
array[string] No

module.tasks[].timeout

module > tasks > timeout

Maximum duration (in seconds) of the task's execution.

Type Required
number No

module.tasks[].args[]

module > tasks > args

The arguments used to run the task inside the container.

Type Required
array[string] No

Example:

module:
  ...
  tasks:
    - args:
      - rake
      - 'db:migrate'

module.tasks[].env

module > tasks > env

Key/value map of environment variables. Keys must be valid POSIX environment variable names (must not start with GARDEN) and values must be primitives.

Type Required
object No

module.jarPath

module > jarPath

The path to the packaged JAR artifact, relative to the module directory.

Type Required
string Yes

Example:

module:
  ...
  jarPath: "target/my-module.jar"

module.jdkVersion

module > jdkVersion

The JDK version to use.

Type Required
number No

Complete YAML schema

module:
  build:
    dependencies:
      - name:
        copy:
          - source:
            target: ''
    targetImage:
  buildArgs: {}
  image:
  hotReload:
    sync:
      - source: .
        target:
  dockerfile:
  services:
    - name:
      dependencies: []
      annotations: {}
      args:
      daemon: false
      ingresses:
        - annotations: {}
          hostname:
          path: /
          port:
      env: {}
      healthCheck:
        httpGet:
          path:
          port:
          scheme: HTTP
        command:
        tcpPort:
      hotReloadArgs:
      ports:
        - name:
          protocol: TCP
          containerPort:
          servicePort: <containerPort>
          hostPort:
          nodePort:
      volumes:
        - name:
          containerPath:
          hostPath:
  tests:
    - name:
      dependencies: []
      timeout: null
      args:
      env: {}
  tasks:
    - name:
      description:
      dependencies: []
      timeout: null
      args:
      env: {}
  jarPath:
  jdkVersion: 8