All Products
Search
Document Center

Simple Log Service:Use CRs to manage Logtail configurations

Last Updated:Oct 28, 2024

Simple Log Service defines CustomResourceDefinitions (CRDs) that allow you to create custom resources. You can create a CustomResource (CR) to create a Logtail configuration. For more information about CRDs, see Extend the Kubernetes API with CustomResourceDefinitions. This topic describes the capabilities of and differences between the AliyunPipelineConfig and AliyunLogConfig CRDs that are defined by Simple Log Service.

Background information

CRDs are Kubernetes API objects that allow you to create custom resources. For more information, see Extend the Kubernetes API with CustomResourceDefinitions. You can use CRDs to extend native Kubernetes API to meet the requirements of specific scenarios. You can create a CR from a CRD.

Simple Log Service-defined CRDs allow you to use CRs to manage Logtail configurations. You must connect to your Kubernetes cluster and complete Kubernetes-related authentication. Then, you can submit a YAML configuration file to the kube-apiserver component to create a CR that defines a Logtail configuration.

Warning

If you use a CR to create a Logtail configuration and modify the Logtail configuration in the Simple Log Service console, the modification is not synchronized to the CR. If you want to modify a Logtail configuration that is created by using a CR, you must modify the CR. Do not modify the configuration in the Simple Log Service console, because Logtail configuration inconsistency may occur.

Implementation of CR-based Logtail configuration management

image
  1. Simple Log Service creates a Deployment to install the alibaba-log-controller component. The component monitors the modifications in the AliyunLogConfig CRD.

  2. If you use kubectl or other Kubernetes management tools to create, update, or delete the AliyunLogConfig CRD, the alibaba-log-controller component monitors the modifications and submits related requests to Simple Log Service based on the CRD configuration file and the status of the Logtail configuration in Simple Log Service. For example, the component may request to update the Logtail configuration.

CRDs

To facilitate Logtail configuration management in cloud-native mode, Simple Log Service defines two CRDs: AliyunPipelineConfig and AliyunLogConfig. The following table describes the capabilities of and differences between the CRDs.

Important

To use AliyunPipelineConfig, the logtail components must be version 0.5.1 or later.

CRD

AliyunPipelineConfig (recommended)

AliyunLogConfig

ApiGroup

telemetry.alibabacloud.com/v1alpha1

log.alibabacloud.com/v1alpha1

CRD resource name

ClusterAliyunPipelineConfig

AliyunLogConfig

Scope

Cluster

Namespace

Logtail configuration format

Equivalent to LogtailPipelineConfig

Equivalent to LogtailConfig

Cross-region capability

Supported

Supported

Cross-account capability

Supported

Supported

Webhook-related parameter verification

Supported

Not supported

Configuration conflict detection

Supported

Not supported

Configuration difficulty

Relatively low

Relatively high

Observability configuration

The Status field contains the following information: error details, update time, Logtail configuration that was previously applied, and point in time at which the Logtail configuration was previously applied.

The Status field contains the error code and error message.