You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/06/16 05:02:46 UTC
[GitHub] [skywalking-swck] dashanji commented on a diff in pull request #65: Add CRD, Controller, e2e for OAPServer's configuration
dashanji commented on code in PR #65:
URL: https://github.com/apache/skywalking-swck/pull/65#discussion_r898693832
##########
docs/oapserver-configuration.md:
##########
@@ -0,0 +1,284 @@
+## OAPSever Configuration Introduction
+
+To configure the OAP Sever, we propose two CRDs:
+
+- OAPServerConfig: The CRD holds all static configuration, including [environment variable](https://skywalking.apache.org/docs/main/latest/en/setup/backend/configuration-vocabulary/) and [file configuration](https://github.com/apache/skywalking/tree/master/oap-server/server-starter/src/main/resources).
+- OAPServerDynamicConfig: The CRD holds all [dynamic configuration](https://skywalking.apache.org/docs/main/latest/en/setup/backend/dynamic-config/).
+
+
+
+## Spec of OAPServerConfig
+
+| Field Name | Description |
+| ---------- | ------------------------------------------------------------ |
+| Version | The version of OAP server, the default value is 9.0.0 |
+| Env | The environment variable of OAP server |
+| File | The static file in OAP Server, which contains three fields`file.path`、`file.name` and `file.data`. The `file.path` plus the `file.name` is the real file that needs to be replaced in the container image, and the `file.data` is the final data in the specific file. |
+
+
+
+## Status of OAPServerConfig
+
+| Field Name | Description |
+| --------------------- | ---------------------------------------------------- |
+| ExpectedConfiguredNum | The number of oapserver that need to be configured |
+| RealConfiguredNum | The number of oapserver that configured successfully |
+| CreationTime | The time the OAPServerConfig was created. |
+| LastUpdateTime | The last time this condition was updated. |
+
+
+
+## Demo of OAPServerConfig
+
+> When using the `file`, please don't set the same name
+
+```yaml
+# static configuration of OAPServer
+apiVersion: operator.skywalking.apache.org/v1alpha1
+kind: OAPServerConfig
+metadata:
+ name: oapserverconfig-sample
+ namespace: skywalking-system
+spec:
+ # The version of OAPServer
+ version: 9.0.0
+ # The env configuration of OAPServer
+ env:
+ - name: JAVA_OPTS
+ value: -Xmx2048M
+ - name: SW_CLUSTER
+ value: kubernetes
+ - name: SW_CLUSTER_K8S_NAMESPACE
+ value: skywalking-system
+ # enable the dynamic configuration
+ - name: SW_CONFIGURATION
+ value: k8s-configmap
+ # set the labelselector of the dynamic configuration
+ - name: SW_CLUSTER_K8S_LABEL
+ value: app=collector,release=skywalking
+ - name: SW_TELEMETRY
+ value: prometheus
+ - name: SW_HEALTH_CHECKER
+ value: default
+ - name: SKYWALKING_COLLECTOR_UID
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.uid
+ - name: SW_LOG_LAL_FILES
+ value: test1
+ - name: SW_LOG_MAL_FILES
+ value: test2
+ # The file configuration of OAPServer
+ # we should avoid setting the same file name in the file
+ file:
+ - name: test1.yaml
+ path: /skywalking/config/lal
+ data: |
+ rules:
+ - name: example
+ dsl: |
+ filter {
+ text {
+ abortOnFailure false // for test purpose, we want to persist all logs
+ regexp $/(?s)(?<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}) \[TID:(?<tid>.+?)] \[(?<thread>.+?)] (?<level>\w{4,}) (?<logger>.{1,36}) (?<msg>.+)/$
+ }
+ extractor {
+ metrics {
+ timestamp log.timestamp as Long
+ labels level: parsed.level, service: log.service, instance: log.serviceInstance
+ name "log_count"
+ value 1
+ }
+ }
+ sink {
+ }
+ }
+ - name: test2.yaml
+ path: /skywalking/config/log-mal-rules
+ data: |
+ expSuffix: instance(['service'], ['instance'], Layer.GENERAL)
+ metricPrefix: log
+ metricsRules:
+ - name: count_info
+ exp: log_count.tagEqual('level', 'INFO').sum(['service', 'instance']).downsampling(SUM)
+
+```
+
+
+
+## Spec of OAPServerDynamicConfig
+
+| Field Name | Description |
+| ------------- | ------------------------------------------------------ |
+| Version | The version of the OAP server, the default value is 9.0.0 |
+| AllInOne | All configurations in one CR, the default value is `false` |
+| LabelSelector | The label selector of the specific configmap, the default value is "app=collector,release=skywalking" |
+| Data | All configurations' key and value |
+
+
+
+## Status of OAPServerDynamicConfig
+
+| Field Name | Description |
+| -------------- | ---------------------------------------------------------- |
+| State | The state of dynamic configuration, `running` or `stopped` |
+| CreationTime | All configurations in one CR, the default value is `false` |
+| LastUpdateTime | The last time this condition was updated |
+
+
+
+## Usage of OAPServerDynamicConfig
+
+There are two ways to configure the OAPServerDynamicConfig.
+
+- **Global configuration**. Put all the dynamic configurations in one CR, you need to set the field `allInOne` to true.
Review Comment:
Do you mean when users create an all-in-one CR, we need to split the CR's data into several CRs that only contain one configuration?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org