Manage your Kubernetes cluster

Using the graphical Kubernetes Dashboard in Codefresh

Codefresh includes a built-in Kubernetes Dashboard that allows you to see the state of your cluster(s) and even make changes if you have the appropriate access privileges.

Accessing the Kubernetes Dashboard

After adding a cluster, you will be able to manage your Kubernetes assets via the Kubernetes tab on the left pane. Clicking on the Kubernetes icon will take you to your services dashboard.

Codefresh Kubernetes Dashboard

Codefresh Kubernetes Dashboard

With the graphical dashboard it is very easy to locate problematic services or deploy new ones quickly.

Viewing your Kubernetes services

If you have too many clusters you can choose the add filter button at the top of the window to hide specific clusters or namespaces.

You will be able to see the following parameters for each service:

  • Name
  • Cluster
  • Namespace
  • Replica count
  • Docker image
  • Selector
  • A status check

You can also switch to a Grid view if you prefer that over the default List view:

Kubernetes Dashboard grid view

Kubernetes Dashboard grid view

Work with your services

In this view, you will be able to perform the following actions:

  • Add new service
  • Edit/Update existing services
  • Remove service

Deploying a new service

The Kubernetes dashboard provides a GUI dialog to quickly deploy new services in your cluster.

Choose a Docker image

To add a service, click the “Add Service” button on the top or the “plus” button on a specific namespace. Then fill in the details for your new service.

You can add images built in Codefresh which were pushed to Codefresh registry or provide a name for Docker image that will be pulled from an external Docker registry. Notice that images which are not from Dockerhub must be mentioned with their full domain name.

Deploying with the quick GUI dialog

Deploying with the quick GUI dialog

Use the following steps in order to add Image and pull secrets from the internal Codefresh Registry:

  • Specify the image name in the format r.cfcr.io/<ACCOUNT>/<IMAGE>:<TAG>
  • Provide and image pull secret - this will be done for each namespace

Deploying from the private Codefresh registry

Deploying from the private Codefresh registry

From this screen you can also create Kubernetes image secrets without actually deploying anything.

Set Environment variables and resources

You can add extra environment variables that will passed to the deployment image.

Environment variables for the deployment

Environment variables for the deployment

You can also define resource limits for your pods. It is a good practice to place maximum limits so that your services do not experience resource starvation.

Adding a service with a manifest file

If you are an advance Kubernetes user, toggle the Deployment option button to the YAML position on the top right corner of the screen. In this mode you can define exactly the contents for the service and deployment Kubernetes resources.

Define a Kubernetes Service Resource

Define a Kubernetes Service Resource

You can type directly in the browser window or paste content from a text editor.

Define a Kubernetes Deployment Resource

Define a Kubernetes Deployment Resource

Congratulations! Your service is now deployed to your Kubernetes cluster.

You can update an existing service in a similar manner from your Kubernetes services window - Just hit the “edit” icon and update your service using the same steps as in “Add new service” section.

Automate your deployment

After your service is deployed to your Kubernetes cluster, you can automate image deployment using Codefresh pipelines.

Some of the possible options are:

  1. The dedicated deploy step in a pipeline.
  2. The cf-deploy-kubernetes step in a pipeline. This can also perform simple templating on Kubernetes manifests.

See more choices in the Deployment options page.