Deploy image from Container Registry
If you store Docker images in Container Registry, you can deploy under to a Managed Kubernetes cluster.
- Load the image into the Container Registry.
- Configure Container Registry integration with the cluster.
- Deploy the application from the image.
Upload image to Container Registry
-
Enter username and password.
-
Assign a tag to the image:
docker tag <image> cr.selcloud.ru/<registry>/<image>:<tag>Specify:
<image>— image name, can be viewed withdocker image list;<registry>— name of the registry where you want to load the image;<tag>— Tag.
-
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.
-
In the dashboard, on the top menu, click Products and select Managed Kubernetes.
-
Open the cluster page → Settings tab.
-
In the Container Registry Integration block, click Customize Integration.
-
Select the registries to be accessed from the cluster.
-
If you are setting up an integration for the first time, click Integrate.
-
If you are changing the integration settings, click Save.
Information about Container Registry registries accessed from the cluster is displayed on the Cluster page → Settings tab → Container Registry Integration block .
Deploy an application from an image
-
Create a deployment.yaml file:
nano deployment.yaml -
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>:latestSpecify:
<registry>— registry name;<image_name>— image name.
-
Deploy the application:
kubectl apply -f deployment.yaml -
Check the status of pods — they should be in
runningstatus:kubectl get pods