Deploy Application
Re-deploy an application to a Kubernetes cluster with the deploy step. Set the cluster, service, and image tag, and optionally filter the deploy by branch.
Deploy an application to Kubernetes.
To use this step, the application must already be deployed in the Kubernetes cluster. This step re-deploys your existing service.
Syntax
steps:
step-name:
type: deploy
target: kubernetes
cluster: my-kubernetes-cluster
service: my-app
tag: v0.1.0| 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
This example assumes an application named my-app is already deployed in the Kubernetes cluster named my-cluster. To learn how to create and deploy applications, see Applications.
The pipeline below deploys an application on Kubernetes with an image tag that was previously built and pushed to a remote Docker registry.
steps:
Clone:
type: git-clone
PushDockerImage:
type: docker-push
image_name: "microtica/my-app"
tag: "{{MIC_PIPELINE_EXECUTION_ID}}"
Deploy:
type: deploy
target: kubernetes
cluster: my-cluster
service: my-app
tag: "{{MIC_PIPELINE_EXECUTION_ID}}"To deploy the image that was just built, you use MIC_PIPELINE_EXECUTION_ID as the reference value when pushing the image to the remote registry, and the same value when deploying the application.
Trigger a deploy for a specific branch
To trigger a deploy only when the pipeline was triggered by a push on a specific branch, use the branch_filter parameter.
If you set develop as the value, the deployment is triggered only when a push is made on the develop branch.
If branch_filter is not specified, the deploy is triggered on every pipeline execution.
steps:
Clone:
type: git-clone
PushDockerImage:
type: docker-push
image_name: "microtica/my-app"
tag: "{{MIC_PIPELINE_EXECUTION_ID}}"
Deploy:
type: deploy
target: kubernetes
cluster: my-cluster
service: my-app
tag: "{{MIC_PIPELINE_EXECUTION_ID}}"
branch_filter: developNext steps
Deploy Environment
Start a deployment for a Microtica environment with the deploy step. Run it on every execution, filter by branch, or deploy specific resources partially.
Trigger Pipeline
Start another pipeline from within a pipeline using the trigger-pipeline step. Split your automation across pipelines and filter triggers by branch or tag.