Flow provides common Kubernetes deployment capabilities. You can use the built-in kubectl tool to deploy Kubernetes YAML files to any cluster. In addition to the capabilities provided by the native kubectl, Flow provides built-in dynamic templates to help you quickly build and release applications in Kubernetes. This topic describes how to use Flow to add and configure a Kubernetes release job and how to view the logs after the deployment.
Solution overview
Add a deployment job
You can add a deployment job by using one of the following methods.
When you create a pipeline, select a template that contains Kubernetes apply.

Add an empty job to the pipeline and add the Kubectl Apply step.

Configure a deployment job
For the Kubectl Apply step, configure the following settings:
Select or create a Kubernetes cluster connection. For more information about how to create a Kubernetes cluster connection, see Manage Kubernetes clusters.

Specify the Namespace parameter for the release.
Specify the YAML PATH parameter for the current deployment, and add the required variables.
In the Kubernetes YAML file, use the ${IMAGE} placeholder to define the Docker image as a dynamic variable.

In the Kubectl Apply step, add variables to the YAML file. When you configure the Kubectl Apply step, click Add on the right side of Variables and specify the variable name and source. After you configure variables, you can use these variables to dynamically replace placeholders in the YAML file.
NoteFor use cases of YAML files in Kubernetes, see References to Kubernetes YAML specifications.
View deployment logs
After the configuration is complete, run the pipeline to run the deployment job. The YAML file in the source code is deployed to the specified Kubernetes cluster.
In the deployment process, click Logs.

View the log output and related records. The following figure shows an example. Logs contain all YAML files that are scanned, the standard output after the Kubectl Apply step is performed, and the overview information of all resources after the change.

References to Kubernetes YAML specifications
Workloads
Resource type | References |
Deployments | https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ |
StatefulSets | https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/ |
DaemonSet | https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ |
Service discovery and networks
Resource type | References |
Service | https://kubernetes.io/docs/concepts/services-networking/service/ |
Ingress | https://kubernetes.io/docs/concepts/services-networking/ingress/ |