Skip to main content
Version: 13.x (Current)

deploy Command

The deploy command deploys the specified files in a given namespace of a Kubernetes cluster.


  • --filename or -f: file and/or folder paths containing data to interpolate
  • --deploy-type (default to deploy_all): set the deployment type (accepted values: deploy_all, smart_deploy)
  • --force-deploy-when-no-semver: flag used to force deploy of services that are not following semantic versioning.
  • --ensure-namespace (default to true): set if the namespace existence should be ensured. By default it is set to true so that the namespace existence is checked and, if it not exists, created. If set to false, it throws if namespace not already exists.

To make the command work, also the following flags described in options are required:

  • --namespace: to specify the namespace in which the resources are deployed
  • The set of flags required to connect to the Kubernetes cluster

Resources application order

By default resources to be deployed are applied in a default order based on their Kind. It can be overridden by annotating the target resource with
This annotation takes a comma-separated list of kinds for which the resource must be applied before. If some of the specified kinds is not managed in the default order listing they are ignored. Any resource having this annotation falls outside the kind-based sorting logic and therefore cannot be applied after other resources having in their annotation its kind. Below there is an example of a resource that must be applied before Pods and Deployments:

apiVersion: batch/v1
kind: Job
name: example-job
annotations: Pod, Deployment
- name: busybox
image: busybox
- sleep
- 30s

Await resources completion

During the deploy phase resources are applied sequentially one after the other. mlp allows to wait for the completion of a resource using the annotation on the specific resource to be awaited. The annotation value should be a duration string as expected by the time.ParseDuration (e.g. 100ms, 10s, 1m) function that specifies the time to wait for completion before a timeout error is triggered.

The resources supported by this annotation:

  • Job: the resource will be applied by mlp then the tool will listen to cluster events until the job status becomes Completed
  • ExternalSecret: this CRD will be applied and then mlp will watch cluster events until the resource .status.refreshTime is updated

Delete resources before applying them

By annotating a resource with, having arbitrary value, the user can force mlp to delete the corresponding resource on the cluster before re-creating it. If the annotated resource is not already present on the cluster no additional operations will occur.