---
title: "Deploy an image from Container Registry to a Managed Kubernetes cluster"
sidebar_label: "Deploy an image from Container Registry"
description: "How to upload an image to Container Registry, configure integration, and deploy an application in Managed Kubernetes from an image"
sidebar_position: 11
toc_max_heading_level: 2
---

import Formbricks from '@theme/MDXComponents/Formbricks';

# Deploy an image from Container Registry to a Managed Kubernetes cluster

If you store Docker images in [Container Registry](/craas/about/about-craas.mdx), you can deploy a pod in a Managed Kubernetes cluster.

1. [Upload an image to the Container Registry](#upload-image).
2. [Configure the integration of Container Registry with the cluster](#configure-registry-integration-with-cluster).
3. [Deploy an application from the image](#deploy-application-from-image).

## Upload an image to Container Registry \{#upload-image}

1. [Log in to the registry](/craas/images/use-docker.mdx).

2. Enter your username and password.

3. Assign a tag to the image:

   ```bash
   docker tag <image> cr.selcloud.ru/<registry>/<image>:<tag>
   ```

   Specify:

   * `<image>` — the image name, which can be viewed using `docker image list`;
   * `<registry>` — the name of the registry to which you want to upload the image;
   * `<tag>` — the tag.

4. Upload the image to the registry:

   ```bash
   docker push cr.selcloud.ru/<registry>/<image>:<tag>
   ```

## Configure integration of the Container Registry with the cluster \{#configure-registry-integration-with-cluster}

You can configure integration from a Managed Kubernetes cluster with one or more Container Registry registries.

1. In the [Control panel](https://my.selectel.ru/mks/), on the top menu, click **Products** and select **Managed Kubernetes**.

2. In the **Clusters** section, open the cluster page → **Settings** tab.

3. In the **Integration with Container Registry** block, click **Configure integration**.

4. Select the registries you want the cluster to access.

5. If you are setting up the integration for the first time, click **Integrate**.

6. If you are changing the integration settings, click **Save**.

   Information about Container Registry registries accessible from the cluster is displayed on the cluster page → **Settings** tab → **Integration with Container Registry** block.

## Deploy an application from an image \{#deploy-application-from-image}

1. Create a deployment.yaml file:

   ```bash
   nano deployment.yaml
   ```

2. Copy the content into the file:

   ```yaml
   apiVersion: apps/v1
   kind: Deployment
   metadata:
     name: example-deployment
     labels:
       app: example-deployment
   spec:
     replicas: 2
     selector:
       matchLabels:
         app: example-deployment
     template:
       metadata:
         labels:
           app: example-deployment
       spec:
         containers:
         - name: <image_name>
           image: cr.selcloud.ru/<registry>/<image>:latest
         imagePullSecrets:
         - name: craas-auth
   ```

   Specify:

   * `<registry>` — registry name;
   * `<image_name>` — image name.

3. Deploy the application:

   ```bash
   kubectl apply -f deployment.yaml
   ```

4. Check the pod status — they must be in the `running` status:

   ```bash
   kubectl get pods
   ```

<Formbricks />
