Kubernetes Integration

How Codefresh supports Kubernetes clusters

Codefresh is one of the few CI/CD solutions that has native support for Kubernetes clusters, not only for deploying applications to them, but also running pipelines on Kubernetes.

Codefresh has native support for Kubernetes in the following areas:

Connecting a Kubernetes cluster to Codefresh

Like all other Codefresh integrations, Kubernetes clusters are connected once on an Account level. You can add a cluster from a specific cloud provider or a “generic” cluster for any compliant cluster:

Global Kubernetes integrations

Global Kubernetes integrations

Once you connect a cluster it gets a unique name inside your account that is important when it comes to using this cluster inside a pipeline. From the same screen you can also connect internal clusters that are behind your firewall .

Viewing the Codefresh cluster dashboard

After you connect a cluster, several graphical dashboards are automatically populated. The first one is the Codefresh Kubernetes dashboard.

Integrated Kubernetes Dashboard

Integrated Kubernetes Dashboard

You can use this Dashboard to get basic information for your cluster such such as services, pods, deployments etc.

Changing a Kubernetes Manifest

Changing a Kubernetes Manifest

From the same dashboard you can also add/change configmaps and even edit directly the manifest of a resource.

Viewing the environment dashboard

The second dashboard that is enabled after you connect a cluster (but not automatically populated) is the environment dashboard.

Codefresh Environment Dashboard

Codefresh Environment Dashboard

This dashboard shows a live view of a Kubernetes application along with the status of the latest builds that affected this environment. You can define such environments either directly from the GUI or programmatically in a pipeline.

Ad-hoc deployments with the Codefresh GUI

One of the easiest ways to deploy to Kubernetes is to use the Codefresh GUI and manually deploy a docker image:

Deploying with the quick GUI dialog

Deploying with the quick GUI dialog

You can also create a Pull Secret from the GUI.

Automated deployments with Codefresh pipelines

You can also deploy to a cluster in a pipeline. Codefresh offers several ways for Kubernetes deployments. The important point here is that all connected clusters are automatically available to all pipelines with their unique name as a kubectl context.

Kubernetes deployment in a pipeline

Kubernetes deployment in a pipeline

You can use the integrated Codefresh deployment methods or even run custom kubectl commands directly on your cluster.

Codefresh also offers a simple solution for templating but you can use another templating methods such as kustomize.

Using a cluster for running CI/CD pipelines

Finally you can also use the Codefresh Runner to run pipelines in your cluster.