Core Concepts
...
Pipelines
Steps

Deploy Application

4min

Deploy an application to Kubernetes.

To use this step, the application should already be deployed in the Kubernetes cluster. This step will re-deploy your existing service.

Syntax

microtica.yaml


Parameter

Description

Required

title

The display name of the step.

No

type

The type of the Microtica built-in step. Should always be deploy for this type of step.

Yes

target

Should always be kubernetes for this type of step.

Yes

cluster

The name of the existing Kubernetes cluster.

Yes

namespace

Deploy the application in a specific namespace. Default: microtica

No

service

The name of the existing application to be deployed.

Yes

tag

Docker image tag to be applied with the deployment. Default: latest

No

branch_filter

If specified, deployment will be executed only if the pipeline was triggered by push on the matched branch. Otherwise, deployment will be triggered on every pipeline execution.

No

Re-deploy an existing application

We assume that application with name my-app is already being deployed in the Kubernetes cluster with name my-cluster. You can read more about how to create and deploy applications here.

In the following example we deploy a application on Kubernetes with an image tag that’s previously been built and pushed to a remote Docker registry.

microtica.yaml


To dynamically deploy the image that’s just been built, we use MIC_PIPELINE_EXECUTION_ID as a reference value while pushing the image on a remote Docker registry and use the same value when deploying the application.

Trigger deploy for a specific branch

To trigger a deploy only if the pipeline was triggered by push on a specific branch, we can use the branch_filter parameter to achieve that.

Basically, if you specify develop as a value, the deployment will be triggered only if push was made on the develop branch.

If branch_filter is not specified, deploy will be triggered on each pipeline execution.

microtica.yaml