Skip to main content
Deploy image from Container Registry
Last update:

Deploy image from Container Registry

If you store Docker images in the Container Registry You can deploy underneath in a Managed Kubernetes cluster.

  1. Load the image into the Container Registry.
  2. Configure Container Registry integration with the cluster.
  3. Deploy the application from the image.

Upload image to Container Registry

  1. Authorize the registry.

  2. Enter username and password.

  3. Assign a tag to the image:

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

    Specify:

    • <image> — image name, can be viewed with docker image list;
    • <registry> — name of the registry where you want to load the image;
    • <tag> — Tag.
  4. Load the image into the registry:

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

Configure Container Registry integration with the cluster

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

  1. In control panel go to Cloud platformKubernetes.

  2. Open the cluster page → tab Settings.

  3. In the block Integration with Container Registry click Customize integration.

  4. Select the registries to be accessed from the cluster.

  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 Registries accessed from the cluster is displayed on the Cluster page → tab Settings → block Integration with Container Registry.

Deploy an application from an image

  1. Create a deployment.yaml file:

    nano deployment.yaml
  2. Copy the contents into the file:

    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

    Specify:

    • <registry> — registry name;
    • <image_name> — image name.
  3. Deploy the application:

    kubectl apply -f deployment.yaml
  4. Check the status of the pods — they should be in status running:

    kubectl get pods