Connect Kubernetes Cluster to Vinchin
This document provides detailed instructions on how to add a Kubernetes cluster to the Vinchin backup system. There are three ways to add a cluster, all of which ultimately require installing an agent client on the target host.
Please go to Resources -> Infrasturcture, select Kubernetes Cluster Management, Click Add button to add the Kubernetes Cluster.
Please choose one of the below methods to add Kubernetes.
Manual Add
Notice
1. Ensure that the Helm client is installed on the cluster's master node. 2. Ensure that the backup server's Helm repository address is accessible.
Add Vinchin repository
Please use below command to add your Vinchin as your Helm repository. Replace https://backup-server-ip/charts/ with your actual Vinchin backup server Helm repository address:
helm repo add vinchin https://backup-server-ip/charts/ --insecure-skip-tls-verify
helm search repo vinchin
helm repo update vinchin
Install client agnet
Use below command to install the Vinchin agent to your Kubernetes, Please choose one of the command to execute:
- In this mode, the Vinchin actively connects to the client. Execute the following command:
client agent will automatically register the cluster information after starting.helm install vinchin vinchin/client -n vinchin --create-namespace \ --set image.pullPolicy=Always \ --insecure-skip-tls-verify \ --set server.port=23100 \ #23000 for Vinchin server to connect --set server.net_model=1 #1:Vinchin connect to K8S
- In this mode, the client actively connects to the Vicnhin. Execute the following command:
manually enter the master node's IP address and client listening port in the Add Kubernetes Cluster -> Manul Add function page of the Vinchin web page.helm install vinchin vinchin/client -n vinchin --create-namespace \ --set server.host=backup-server-ip \ #Your Vinchin Server IP --set server.port=22710 \ #22710 for Vinchin server to connect --set image.pullPolicy=Always \ --insecure-skip-tls-verify \ --set server.net_model=2 #2:K8S connect to Vinchin
Add via SSH for remote client deployment
Notice
1. Ensure that the SSH user has root privileges. 2. Ensure that the client and server networks are interconnected.
After you clieck the Add button, please select the Add Method as Add via SSH for remote client deployment.
Enter the SSH connection information of the cluster master node(such as IP address, username, password, or key). Click OK, Vinchin will automatically execute the installation command on the target node and deploy the client agent.
After deployment, check the status of the client agent using the following command on your Kubernetes master node:
kubectl get pods -n vinchin
When all Pods are in the Running state, it indicates that the client agent has been successfully deployed and started.
Add via cluster connection configuration file for remote client deployment
Notice
1. Ensure that you have obtained the
kubeconfigfile of the target cluster. 2. Ensure that the backup server can access the API server of the target cluster.
After you clieck the Add button, please select the Add Method as Add via cluster connection configuration file for remote client deployment.
Upload the kubeconfig file (supports .yaml or .txt format), or directly paste the file content. Vinchin will use Helm commands to remotely install the client agent.
The kubeconfig file is usually located in the ~/.kube/config file on the Kubernetes master node. Use the following command to view the content:
cat ~/.kube/config
If the config file is not found, please refer to the Kubernetes official documentation to generate or obtain it.
Uninstall cliecnt agent
If you need to uninstall the client agent in the cluster, execute the following command:
helm uninstall vinchin -n vinchin
Use the following command to monitor the uninstallation progress in real-time:
watch -n 1 kubectl get pods -n vinchin
When there are no running Pods in the target namespace, it indicates that the uninstallation is successful.