diff --git a/modules/otel-collector-components.adoc b/modules/otel-collector-components.adoc index 879b556fc5a9..677a5dcdf88d 100644 --- a/modules/otel-collector-components.adoc +++ b/modules/otel-collector-components.adoc @@ -172,6 +172,143 @@ The Kafka receiver receives traces, metrics, and logs from Kafka in the OTLP for <6> Disables verifying the server's certificate chain and host name. The default is `+false+`. <7> ServerName indicates the name of the server requested by the client to support virtual hosting. +[id="k8scluster-receiver_{context}"] +=== Kubernetes Cluster Receiver + +:FeatureName: The Kubernetes Cluster Receiver +include::snippets/technology-preview.adoc[] + +The Kubernetes Cluster Receiver gathers cluster metrics and entity events from the Kubernetes API server. It uses the Kubernetes API to receive information about updates. Authentication for this receiver is only supported through service accounts. + +.OpenTelemetry Collector custom resource with the enabled Kubernetes Cluster Receiver +[source,yaml] +---- +# ... + receivers: + k8s_cluster: + distribution: openshift + collection_interval: 10s + exporters: + debug: + service: + pipelines: + metrics: + receivers: [k8s_cluster] + exporters: [debug] + logs/entity_events: + receivers: [k8s_cluster] + exporters: [debug] +# ... +---- + +This receiver requires a configured service account, RBAC rules for the cluster role, and the cluster role binding that binds the RBAC with the service account. + +.`ServiceAccount` object +[source,yaml] +---- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app: otelcontribcol + name: otelcontribcol +---- + +.RBAC rules for the `ClusterRole` object +[source,yaml] +---- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: otelcontribcol + labels: + app: otelcontribcol +rules: +- apiGroups: + - quota.openshift.io + resources: + - clusterresourcequotas + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - events + - namespaces + - namespaces/status + - nodes + - nodes/spec + - pods + - pods/status + - replicationcontrollers + - replicationcontrollers/status + - resourcequotas + - services + verbs: + - get + - list + - watch +- apiGroups: + - apps + resources: + - daemonsets + - deployments + - replicasets + - statefulsets + verbs: + - get + - list + - watch +- apiGroups: + - extensions + resources: + - daemonsets + - deployments + - replicasets + verbs: + - get + - list + - watch +- apiGroups: + - batch + resources: + - jobs + - cronjobs + verbs: + - get + - list + - watch +- apiGroups: + - autoscaling + resources: + - horizontalpodautoscalers + verbs: + - get + - list + - watch +---- + +.`ClusterRoleBinding` object +[source,yaml] +---- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: otelcontribcol + labels: + app: otelcontribcol +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: otelcontribcol +subjects: +- kind: ServiceAccount + name: otelcontribcol + namespace: default +---- + [id="opencensus-receiver_{context}"] === OpenCensus receiver