First you need a Docker image to deploy to the cluster.
If you don’t have one already you can use a Codefresh pipeline to build one.
Build and push your image
Here is a basic Codefresh pipeline scenario to build and push your image to the DockerHub registry.
YAML
Using this YAML example, we’ll add an additional step to deploy the image in Dockerhub to Kubernetes.
Add a Deployment step
So now you have deployed your image manually, which is great.
But, how can you trigger the deployment within your pipeline? For that you will need to add a step of type Deploy type to the Codefresh YAML manifest file:
YAML
The full Codefresh YAML looks like this:
YAML
You can now run the whole pipeline, that builds your application from source to a Docker image, pushes the image to a Docker registry, and deploys the image to your Kubernetes cluster.