diff --git a/incubator/opentelemetry-operator/Chart.yaml b/incubator/opentelemetry-operator/Chart.yaml index bb74737..67fa88d 100644 --- a/incubator/opentelemetry-operator/Chart.yaml +++ b/incubator/opentelemetry-operator/Chart.yaml @@ -1,16 +1,16 @@ apiVersion: v2 -name: opentelemetry-operator -version: 0.39.0 +name: tencent-opentelemetry-operator +version: 0.85.0 description: OpenTelemetry Operator Helm chart for Kubernetes type: application home: https://opentelemetry.io/ sources: - https://github.com/open-telemetry/opentelemetry-operator maintainers: - - name: jeffreyhlhe + - name: erichchen icon: https://cloudcache.tencent-cloud.com/qcloud/ui/static/Industry_tke/80444e53-c142-4896-bc8a-ef4ecf75c682.png appVersion: 0.85.0 -kubeVersion: '>= 1.19.0-0, <= 1.28.0-0 ' +kubeVersion: '>= 1.19.0-0, < 1.28.1-0' dependencies: - name: cert-manager version: v1.9.2 diff --git a/incubator/opentelemetry-operator/README.md b/incubator/opentelemetry-operator/README.md index 5820932..447996d 100644 --- a/incubator/opentelemetry-operator/README.md +++ b/incubator/opentelemetry-operator/README.md @@ -1,20 +1,26 @@ ## 简介 -opentelemetry-operator是由腾讯云监控团队基于开源opentelemetry-operator,对TKE的容器环境进行单独适配,用以支持在 Kubernetes 集群上快捷部署组件,为集群中的pod自动添加特定的标签,开启探针注入能力。 +tencent-opentelemetry-operator 由腾讯云可观测团队在社区 opentelemetry-operator 基础上构建,用于部署在 TKE 的应用快速接入[腾讯云应用性能监控 APM](https://cloud.tencent.com/product/apm)。目前 tencent-opentelemetry-operator 支持的编程语言包括 Java, Python, Node.js 和 .Net -在部署完成之后,用户可以在腾讯云控制台应用性能监控页面查看监控采集数据。 +*当前版本的 tencent-opentelemetry-operator 依赖 Kubernetes v1.19+ -*当前版本的 opentelemetry-operator 依赖 Kubernetes v1.19 to v1.28 +## 配置项说明 -## 部署 +tencent-opentelemetry-operator 通过 Helm 部署安装,所有的配置项都集中于 `values.yaml`。 -在通过 Helm 部署的过程中,所有的配置项都集中于 `values.yaml`。 +下述为安装 tencent-opentelemetry-operator 的必填字段: -下面是部分需要自定义的字段: +| 参数 | 描述 | +|----------------------|--------------------------------------| +| `env.TKE_CLUSTER_ID` | TKE 集群 ID | +| `env.TKE_REGION` | TKE 集群所在地域 | +| `env.ENDPOINT` | APM 内网接入点,每个集群必须指定唯一的 APM 内网接入点 | +| `env.APM_TOKEN` | 默认的 APM 业务系统 token,可以在工作负载级别指定其他业务系统 | +| `env.INTL_SITE` | 仅国际站用户需设置为"true" | + + +由于配置项的填写比较复杂,强烈建议您前往[APM控制台](https://console.cloud.tencent.com/monitor/apm)安装 tencent-opentelemetry-operator,以简化安装步骤。点击**接入应用**,选择对应的语言,选择 OpenTelemetry 接入方式,点击**一键安装 Operator**,即可快速完成安装,无需手工填写参数。 + +安装完成以后,tencent-opentelemetry-operator 会创建 `opentelemetry-operator-system`命名空间,并创建相关 Kubernetes 资源。在需要接入 APM 的工作负载中添加相关 annotation,就可以实现探针自动注入,并向 APM 上报监控数据,请参考 APM 控制台**接入应用**对话框获取需要添加的 annotation 详细信息。在同一个 TKE 集群中,只能安装最多一个 tencent-opentelemetry-operator 。 -| 参数 | 描述 | -| ------- | -------- | -| `env.CLUSTER_ID` | 准备安装此应用的Kubernetes 集群ID | -| `env.TKE_REGION` | 准备安装此应用的Kubernetes 集群所在地域 | -| `env.APM_TOKEN` | 您的tapm实例对应的上报token | diff --git a/incubator/opentelemetry-operator/templates/_helpers.tpl b/incubator/opentelemetry-operator/templates/_helpers.tpl index 5855f35..884129d 100644 --- a/incubator/opentelemetry-operator/templates/_helpers.tpl +++ b/incubator/opentelemetry-operator/templates/_helpers.tpl @@ -80,18 +80,9 @@ Create an ordered name of the MutatingWebhookConfiguration {{- printf "%s-%s" (.Values.admissionWebhooks.namePrefix | toString) (include "opentelemetry-operator.fullname" .) | trimPrefix "-" }} {{- end }} -{{/* -根据地域确定上报地址 -*/}} -{{- define "opentelemetry-operator.endpoint" -}} -{{if eq .Values.env.TKE_REGION "ap-guangzhou"}}http://pl.ap-guangzhou.apm.tencentcs.com{{ -else if eq .Values.env.TKE_REGION "ap-shanghai"}}http://pl.ap-shanghai.apm.tencentcs.com{{ -else if eq .Values.env.TKE_REGION "ap-beijing"}}http://pl.ap-beijing.apm.tencentcs.com{{ -else if eq .Values.env.TKE_REGION "ap-hongkong"}}http://pl.ap-hongkong.apm.tencentcs.com{{ -else if eq .Values.env.TKE_REGION "ap-shanghai-fsi"}}http://pl.ap-shanghai-fsi.apm.tencentcs.com{{ -else if eq .Values.env.TKE_REGION "ap-beijing-fsi"}}http://pl.ap-beijing-fsi.apm.tencentcs.com{{ -else if eq .Values.env.TKE_REGION "ap-singapore"}}http://pl.ap-singapore.apm.tencentcs.com{{ -else if eq .Values.env.TKE_REGION "na-siliconvalley"}}http://pl.na-siliconvalley.apm.tencentcs.com{{ -else}}http://pl.ap-guangzhou.apm.tencentcs.com{{end}}{{end}} - +{{- define "opentelemetry-operator.host" -}} +{{- $endpoint :=.Values.env.ENDPOINT}} +{{- $ss := $endpoint | split ":" -}} +{{- printf "%s:%s" (index $ss "_0") (index $ss "_1") -}} +{{end}} diff --git a/incubator/opentelemetry-operator/templates/deployment.yaml b/incubator/opentelemetry-operator/templates/deployment.yaml index 32c65a1..ca5ecce 100644 --- a/incubator/opentelemetry-operator/templates/deployment.yaml +++ b/incubator/opentelemetry-operator/templates/deployment.yaml @@ -78,12 +78,32 @@ spec: - name: {{ $name }} value: {{ $value | quote -}} {{- end }} - - name: CLUSTER_ID - value: {{ .Values.env.CLUSTER_ID | quote }} + - name: TKE_CLUSTER_ID + value: {{ .Values.env.TKE_CLUSTER_ID | quote }} - name: TKE_REGION value: {{ .Values.env.TKE_REGION | quote }} - name: APM_TOKEN value: {{ .Values.env.APM_TOKEN | quote }} + - name: ENDPOINT + value: {{ .Values.env.ENDPOINT | quote }} + - name: JAVA_INSTR_VERSION + value: {{ .Values.env.JAVA_INSTR_VERSION | quote }} + - name: PYTHON_INSTR_VERSION + value: {{ .Values.env.PYTHON_INSTR_VERSION | quote }} + - name: DOTNET_INSTR_VERSION + value: {{ .Values.env.DOTNET_INSTR_VERSION | quote }} + - name: NODEJS_INSTR_VERSION + value: {{ .Values.env.NODEJS_INSTR_VERSION | quote }} + - name: INTL_SITE + value: {{ .Values.env.INTL_SITE | quote }} + - name: SECRET_ID + value: {{ .Values.api.sID | quote }} + - name: SECRET_KEY + value: {{ .Values.api.sKey | quote }} + - name: SECRET_ID_I18N + value: {{ .Values.api.sIDI18n | quote }} + - name: SECRET_KEY_I18N + value: {{ .Values.api.sKeyI18n | quote }} {{- end }} image: "{{ .Values.manager.image.repository }}:{{ .Values.manager.image.tag }}" name: manager diff --git a/incubator/opentelemetry-operator/templates/instrumentation.yaml b/incubator/opentelemetry-operator/templates/instrumentation.yaml index fec52ab..5498d56 100644 --- a/incubator/opentelemetry-operator/templates/instrumentation.yaml +++ b/incubator/opentelemetry-operator/templates/instrumentation.yaml @@ -5,7 +5,7 @@ metadata: namespace: opentelemetry-operator-system spec: exporter: - endpoint: {{printf "%s:4317" (include "opentelemetry-operator.endpoint" . ) | quote | trim}} + endpoint: {{printf "%s:4317" (include "opentelemetry-operator.host" . ) | quote | trim}} propagators: - tracecontext - baggage @@ -14,18 +14,18 @@ spec: resourceAttributes: token: {{.Values.env.APM_TOKEN}} java: - image: ccr.ccs.tencentyun.com/tapm/opentelemetry-java-agent:20231218 + image: nodejs: - image: ccr.ccs.tencentyun.com/tapm/autoinstrumentation-nodejs:0.44.0 + image: python: - image: ccr.ccs.tencentyun.com/tapm/autoinstrumentation-python:0.41b0 + image: env: - name: OTEL_EXPORTER_OTLP_ENDPOINT - value: {{printf "%s:55681" (include "opentelemetry-operator.endpoint" . ) | quote | trim}} + value: {{printf "%s:55681" (include "opentelemetry-operator.host" . ) | quote | trim}} dotnet: - image: ccr.ccs.tencentyun.com/tapm/autoinstrumentation-dotnet:1.2.0 + image: env: - name: OTEL_EXPORTER_OTLP_ENDPOINT - value: {{printf "%s:55681" (include "opentelemetry-operator.endpoint" . ) | quote | trim}} + value: {{printf "%s:55681" (include "opentelemetry-operator.host" . ) | quote | trim}} go: image: ccr.ccs.tencentyun.com/tapm/autoinstrumentation-go:v0.8.0-alpha diff --git a/incubator/opentelemetry-operator/values.yaml b/incubator/opentelemetry-operator/values.yaml index f7255a9..4300f72 100644 --- a/incubator/opentelemetry-operator/values.yaml +++ b/incubator/opentelemetry-operator/values.yaml @@ -29,7 +29,7 @@ pdb: manager: image: repository: ccr.ccs.tencentyun.com/tke-market/opentelemetry-operator - tag: 20231225-1936_apm_version_0.85.0_da2c3b53-amd64 + tag: 20240422-1926_apm_0.85.0_auto_a87de5ae-amd64 collectorImage: repository: ccr.ccs.tencentyun.com/tke-market/opentelemetry-collector-contrib tag: 0.85.0 @@ -65,11 +65,11 @@ manager: healthzPort: 8081 resources: limits: - cpu: 100m - memory: 128Mi + cpu: 500m + memory: 512Mi requests: - cpu: 100m - memory: 64Mi + cpu: 200m + memory: 128Mi ## Adds additional environment variables ## e.g ENV_VAR: env_value env: @@ -267,6 +267,25 @@ testFramework: tag: latest env: - CLUSTER_ID: "" + ## Required, obtained from the tke console + TKE_CLUSTER_ID: "" TKE_REGION: "" + ## Required, obtained from the apm console APM_TOKEN: "" + ENDPOINT: "" + + + ## Optional, default latest; If you want to specify the version, you can get it from the apm documentation + JAVA_INSTR_VERSION: "latest" + PYTHON_INSTR_VERSION: "latest" + DOTNET_INSTR_VERSION: "latest" + NODEJS_INSTR_VERSION: "latest" + + ## Optional, default "false"; Set to "true" for international users + INTL_SITE: "false" + +api: + sID: "bwiefeunq4+28k5omTkgc3XQLHjDEh4aylntxj4NiVRsibnL5n4Kk0EHTYJPoXHe" + sKey: "4jIDAZIsW4/kuFgKHgcZwjQo31drB4bfliBsaNdflQuak7EXJvmx+aoQ4s3bQjxd" + sIDI18n: "6/U0Gb1SHpaaUl0YwK40PKFd6tBckngcpqe2LCxnp/lMCD0q0XOxLkmY1UAS4L8t" + sKeyI18n: "Rb+Igu4pvBox8cxM1ZjcL1LpAzq7EDRS/NBRPOUQ6cC5+hPYlYDFps2GgZMWmzhb" \ No newline at end of file