Create Sync Rule
Synchronization rule refers to a resource mapping relationship from a Git repository to a specific cluster in the platform. By storing the configuration files of the application in the Git repository and creating synchronization rules in the platform, automatic batch deployment and status synchronization of the application can be achieved.
Prerequisites
You need to deploy the ArgoCD Operator in the global environment. Please refer to.
Note:
-
The Kubernetes (K8s) ecosystem is rapidly evolving, with new technologies and concepts emerging regularly. It is important to stay up-to-date with the latest developments in order to effectively navigate and utilize the K8s infrastructure.
-
Cloud-native technologies, such as containers and microservices, are becoming increasingly popular in the industry. These technologies enable organizations to build and deploy applications that are scalable, resilient, and portable across different cloud environments.
-
Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. It provides a robust and flexible infrastructure for running and managing applications in a distributed environment.
-
The K8s ecosystem consists of various components and tools that work together to provide a comprehensive solution for container orchestration. These include the Kubernetes API server, etcd, kubelet, kube-proxy, and various controllers and operators.
-
Kubernetes provides a declarative approach to application deployment and management. Users define the desired state of their applications using YAML or JSON manifests, and Kubernetes ensures that the actual state matches the desired state.
-
Kubernetes supports various deployment strategies, including rolling updates, blue-green deployments, and canary deployments. These strategies enable organizations to update their applications with minimal downtime and risk.
-
Kubernetes provides a rich set of features for managing and monitoring applications, including service discovery and load balancing, automatic scaling, health checks, and logging and monitoring capabilities.
-
The K8s ecosystem is supported by a vibrant community of developers and contributors, who actively contribute to the development and improvement of the platform. This community-driven approach ensures that Kubernetes remains a cutting-edge and innovative solution for container orchestration.
-
As the adoption of Kubernetes continues to grow, it is important for organizations to invest in training and education to build the necessary skills and expertise. This will enable them to effectively leverage the power of Kubernetes and cloud-native technologies to drive innovation and business growth.
-
If your configuration file contains compliance management related policies, please install the Gatekeeper plugin in the cluster where compliance policies need to be enforced.
-
ArgoCD currently does not support synchronizing resources to IPv6-only clusters.
Create Sync Rule
-
On the left navigation bar, click Clusters > Cluster Configuration Management.
-
Click Create Sync Rule and configure the relevant parameters according to the following instructions.
Parameter Description Integration Name The name of the integration when integrating with a code repository. Project Name The name of the project in the code repository. Code Repository The name of the code repository under the specified project. Branch The branch of the code repository where the configuration files are stored. File Path The directory of the configuration files. After selecting a directory, all YAML, YML, and JSON files in that directory and its subdirectories will be synchronized to the target cluster. Cluster of clusters Select one or more target clusters. After creating a synchronization rule, the configuration files in the code repository will be automatically synchronized to the target clusters and corresponding resources will be created.
Note: When selecting All Clusters or All Clusters Except Global, the configuration resources will be automatically synchronized to newly added clusters. -
Click Create. You can determine the synchronization status of the resource synchronization rule based on the relevant status.
-
After creating the synchronization rule, the platform will automatically generate a synchronization ID, which corresponds to a cluster. Click on the synchronization ID to view the specific resource names, synchronization status, and resource types of the recent task resource synchronization.
Sync Status
Synchronization status refers to the synchronization status of resources based on the current synchronization rules.
| Sync Status | Description |
|---|---|
| Pending Sync | The resource status defined in the Git repository is inconsistent with the resource status in the environment, but the synchronization has not started yet. |
| Sync Failed | Failed to synchronize any configuration files to the target cluster. |
| Syncing | Any configuration file is currently being synchronized to the target cluster, and there are no file synchronization failures. |
| Synced | All configuration files have been synchronized to the target cluster. |
Health Status
Health status for the ArgoCD component’s health status.
| Health Status | Description |
|---|---|
| Unknown | Unknown, there are issues with the YAML configuration file, the directory does not exist, or there are issues with the code repository. |
| Progressing | Progressing, the resource has been successfully created, but the Pod is not in a Ready state. |
| Healthy | Healthy, the Pod is in a Ready state. |
| Suspended | Suspended, the spec.paused of the Deployment is set to true. |
| Degraded | Degraded, the time from Progressing state to Healthy state exceeds the default 10 minutes. |
| Missing | Missing, the resources in the YAML configuration file were not successfully created. |
Relevant operations
You can click on the
on the right side of the list page or click on the Actions in the upper right corner of the details page to update the configuration under the synchronization rule as needed, or delete the synchronization rule that is no longer in use.
| Operation | Description |
|---|---|
| Update Sync Rules | Only supports updating the branch and file path information of the code repository. Note: After adding or modifying the corresponding configuration, the changes will take effect immediately and start synchronizing resources. If you delete the corresponding configuration or uncheck the target cluster for synchronization, the existing resources in the target cluster will be deleted together. |
| Update Configuration File | After updating the configuration file in the code repository, wait a moment, and the resources of the corresponding cluster will be synchronized according to the expected modifications. |
| Delete | After deleting the synchronization rule, the synchronized resources in the target cluster will be deleted together. |