Deploying to Kubernetes from a Codefresh pipeline
The Deploy step can be used as a step to deploy a pre-built Docker image to a cluster
This step allows to (re)deploy a Kubernetes application in your cluster
It has two modes:
- Using the
serviceoption. In this case it will redeploy to an existing service/deployment in your cluster . Codefresh will automatically update the service/deployment with the new docker image.
- Using the
file_pathoption. In this case you provide your own Kubernetes manifest and Codefresh deploys it as-is. It is your own responsibility to do custom replacements here (for example using awk, sed or yq). The
deploystep also uses the Codefresh templating mechanism behind the scenes if you want to take advantage of it. For a full templating solution we also suggest you look at Helm.
You need to define either one of these fields in the deploy step. If you define
service you also can select the exact Docker image
candidate field (otherwise Codefresh will just reuse the docker image defined in the existing deployment)
||The free-text display name of the step||Optional|
||A basic, free-text description of the step.||Optional|
||Parent group of this step. See using stages for more information.||Optional|
||Name of your K8s cluster as found in the dashboard||Required|
||Namespace where the deployment will take place||Required|
||Name of the existing service that will updated. You need to provide
||A deployment manifest. You need to provide
||Seconds to wait for the deployment to be completed. Default is 120 seconds||Default|
||Docker image that will be deployed. Only valid if
||If a step fails, and the process is halted. The default value is
||Define a set of conditions which need to be satisfied in order to execute this step.
You can find more information in the conditional execution of steps article.
||Define operations to perform upon step completion using a set of predefined post-step operations.||Optional|
||Define retry behavior as described in retrying a step.||Optional|
Update an existing service using the same Docker image (tagged with branch)
Update an existing service using a different Docker image (tagged with git hash)
Deploy a custom Kuberentes Manifest as is. (Only a deployment will be created)
Advanced Kubernetes deployments
If you find the deploy step limited, feel free to look at the other deployment options offered by Codefresh: