Skip to content

Commit 80b4e38

Browse files
rogercolleedugonmdbirnstiehltetianakravchenko
authored
Merge pull request #47 from elastic/main
* k8s-otel: cert-manager integration information added * initial paragraphs order switched * code block indentation fixed * small structure changes to the cert-manager procedure * small structure changes to the cert-manager procedure * small structure changes to the cert-manager procedure * small structure changes to the cert-manager procedure * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * Update docs/kubernetes/operator/README.md Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> * onboarding introduction change * split k8sattributes/ecs processor: do not add any extra metadata Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co> * add back name metadata Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co> --------- Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co> Co-authored-by: Edu González de la Herrán <25320357+eedugon@users.noreply.github.com> Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com> Co-authored-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
1 parent 4ccc57f commit 80b4e38

File tree

2 files changed

+80
-28
lines changed

2 files changed

+80
-28
lines changed

docs/kubernetes/operator/README.md

+57-27
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ This guide describes how to:
1515
- [Manual deployment of all components](#manual-deployment-of-all-components)
1616
- [Installation verification](#installation-verification)
1717
- [Instrumenting applications](#instrumenting-applications)
18-
- [Limitations](#limitations)
18+
- [Cert-manager integrated installation](#cert-manager)
1919

2020
## Prerequisites
2121

2222
- Elastic Stack (self-managed or [Elastic Cloud](https://www.elastic.co/cloud)) version 8.16.0 or higher, or an [Elasticsearch serverless](https://www.elastic.co/docs/current/serverless/elasticsearch/get-started) project.
2323

2424
- A Kubernetes version supported by the OpenTelemetry Operator (refer to the operator's [compatibility matrix](https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/compatibility.md#compatibility-matrix) for more details).
2525

26+
- If you opt for automatic certificate generation and renewal on the OpenTelemetry Operator, you need to install [cert-manager](https://cert-manager.io/docs/installation/) in the Kubernetes cluster. By default, the operator installation uses a self-signed certificate and **doesn't require** cert-manager.
27+
2628
## Compatibility Matrix
2729

2830
The minimum supported version of the Elastic Stack for OpenTelemetry-based monitoring on Kubernetes is `8.16.0`. Different Elastic Stack releases support specific versions of the [kube-stack Helm Chart](https://github.com/open-telemetry/opentelemetry-helm-charts/tree/main/charts/opentelemetry-kube-stack).
@@ -42,10 +44,10 @@ When [installing the release](#manual-deployment-of-all-components), ensure you
4244

4345
The OpenTelemetry Operator is a [Kubernetes Operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) implementation designed to manage OpenTelemetry resources in a Kubernetes environment. It defines and oversees the following Custom Resource Definitions (CRDs):
4446

45-
- [OpenTelemetry Collectors](https://github.com/open-telemetry/opentelemetry-collector): Agents responsible for receiving, processing and exporting telemetry data such as logs, metrics, and traces.
46-
- [Instrumentation](https://opentelemetry.io/docs/kubernetes/operator/automatic): Used for the atomatic instrumentation of workloads by leveraging OpenTelemetry instrumentation libraries.
47+
- [OpenTelemetry Collectors](https://github.com/open-telemetry/opentelemetry-collector): Agents responsible for receiving, processing, and exporting telemetry data such as logs, metrics, and traces.
48+
- [Instrumentation](https://opentelemetry.io/docs/kubernetes/operator/automatic): Leverages OpenTelemetry instrumentation libraries to automatically instrument workloads.
4749

48-
All signals including logs, metrics, traces are processed by the collectors and sent directly to Elasticsearch via the ES exporter. A collector's processor pipeline replaces the traditional APM server functionality for handling application traces.
50+
All signals including logs, metrics, and traces are processed by the collectors and sent directly to Elasticsearch using the ES exporter. A collector's processor pipeline replaces the traditional APM server functionality for handling application traces.
4951

5052
### Kube-stack Helm Chart
5153

@@ -83,17 +85,21 @@ The Helm Chart is configured to enable zero-code instrumentation using the [Oper
8385
- Python
8486
- .NET
8587

86-
## Deploying components using Kibana Onboarding UX
88+
## Deploy components using the guided onboarding
8789

88-
The preferred method for deploying all components is through the Kibana Onboarding UX. Follow these steps:
90+
The guided onboarding simplifies deploying your Kubernetes components by setting up an [API Key](https://www.elastic.co/guide/en/kibana/current/api-keys.html) and the needed [Integrations](https://www.elastic.co/docs/current/en/integrations) in the background. Follow these steps to use the guided onboarding:
8991

90-
1. Navigate in Kibana to **Observability** --> **Add data**
92+
1. In Kibana, navigate to **Observability** **Add data**.
9193
2. Select **Kubernetes**, then choose **Kubernetes monitoring with EDOT Collector**.
9294
3. Follow the on-screen instructions to install the OpenTelemetry Operator using the Helm Chart and the provided `values.yaml`.
9395

94-
Notes:
95-
- If the `elastic_endpoint` showed by the UI is not valid for your environment, replace it with the correct Elasticsearch endpoint.
96-
- The displayed `elastic_api_key` corresponds to an API key that is automatically generated when the onboarding process is initiated.
96+
Notes on installing the OpenTelemetry Operator:
97+
- Make sure the `elastic_endpoint` shown in the installation command is valid for your environment. If not, replace it with the correct Elasticsearch endpoint.
98+
- The `elastic_api_key` shown in the installation command corresponds to an API key created by Kibana when the onboarding process is initiated.
99+
100+
> [!NOTE]
101+
> The default installation deploys an OpenTelemetry Operator with a self-signed TLS certificate.
102+
> To automatically generate and renew publicly trusted certificates, refer to [cert-manager integrated installation](#cert-manager) for instructions on customizing the `values.yaml` file before running the `helm install` command.
97103
98104
## Manual deployment of all components
99105

@@ -173,28 +179,52 @@ where ``<LANGUAGE>`` is one of: `go` , `java`, `nodejs`, `python`, `dotnet`
173179

174180
For detailed instructions and examples on how to instrument applications in Kubernetes using the OpenTelemetry Operator, refer to [Instrumenting applications](/docs/kubernetes/operator/instrumenting-applications.md).
175181

176-
For troubleshooing details and verification steps, refer to [Troubleshooting auto-instrumentation](/docs/kubernetes/operator/troubleshoot-auto-instrumentation.md).
182+
For troubleshooting details and verification steps, refer to [Troubleshooting auto-instrumentation](/docs/kubernetes/operator/troubleshoot-auto-instrumentation.md).
177183

178-
## Limitations
184+
<!-- Do not change this anchor name as it's used by Kibana OTel+k8s Onboarding UX -->
185+
<a name="cert-manager"></a>
179186

180-
### Cert manager
187+
## Cert-manager integrated installation
181188

182-
In Kubernetes, in order for the API server to communicate with the webhook component (created by the Operator), the webhook requires a TLS certificate that the API server is configured to trust. The previous provided configurations sets the Helm Chart to auto generate the required TLS certificates with an expiration policy of 365 days. These certificates **won't be renewed** if the Helm Chart's release is not manually updated. For production environments, it is highly recommended to use a certificate manger like [cert-manager](https://cert-manager.io/docs/installation/).
189+
In Kubernetes, for the API server to communicate with the webhook component (created by the operator), the webhook requires a TLS certificate that the API server is configured to trust. The default provided configuration sets the Helm Chart to auto generate the required certificate as a self-signed certificate with an expiration policy of 365 days. These certificates **won't be renewed** if the Helm Chart's release is not manually updated. For production environments, we highly recommend using a certificate manager like [cert-manager](https://cert-manager.io/docs/installation/).
183190

184-
If `cert-manager` CRDs are already present in your Kubernetes environment, you can configure the Operator to use them with the following modifications in the values file:
191+
Integrating the operator with [cert-manager](https://cert-manager.io/) enables automatic generation and renewal of publicly trusted TLS certificates. This section assumes that cert-manager and its CRDs are already installed in your Kubernetes environment. If that's not the case, refer to the [cert-manager installation guide](https://cert-manager.io/docs/installation/) before continuing.
185192

193+
Follow any of the following options to install the OpenTelemetry Operator Helm Chart integrated with `cert-manager`:
186194

187-
```diff
188-
opentelemetry-operator:
189-
manager:
190-
extraArgs:
191-
- --enable-go-instrumentation
192-
admissionWebhooks:
193-
certManager:
194-
- enabled: false
195-
+ enabled: true
195+
* Add `--set opentelemetry-operator.admissionWebhooks.certManager.enabled=true --set opentelemetry-operator.autoGenerateCert=null` to the installation command. For example:
196196

197-
-autoGenerateCert:
198-
- enabled: true
199-
- recreate: true
197+
```bash
198+
helm upgrade --install --namespace opentelemetry-operator-system opentelemetry-kube-stack open-telemetry/opentelemetry-kube-stack \
199+
--values ./resources/kubernetes/operator/helm/values.yaml --version 0.3.3 \
200+
--set opentelemetry-operator.admissionWebhooks.certManager.enabled=true --set opentelemetry-operator.admissionWebhooks.autoGenerateCert=null
200201
```
202+
203+
* Keep an updated copy of the `values.yaml` file by following these steps:
204+
205+
1. **Update** the `values.yaml` file with the following changes:
206+
207+
- **Enable cert-manager integration for admission webhooks.**
208+
209+
```yaml
210+
opentelemetry-operator:
211+
admissionWebhooks:
212+
certManager:
213+
enabled: true # Change from `false` to `true`
214+
```
215+
216+
- **Remove the generation of a self-signed certificate.**
217+
218+
```yaml
219+
# Remove the following lines:
220+
autoGenerateCert:
221+
enabled: true
222+
recreate: true
223+
```
224+
225+
2. Run the installation (or upgrade) command pointing to the updated file. For example, assuming that the updated file has been saved as `values_cert-manager.yaml`:
226+
227+
```bash
228+
helm upgrade --install --namespace opentelemetry-operator-system opentelemetry-kube-stack open-telemetry/opentelemetry-kube-stack \
229+
--values ./resources/kubernetes/operator/helm/values_cert-manager.yaml --version 0.3.0
230+
```

resources/kubernetes/operator/helm/values.yaml

+23-1
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,28 @@ collectors:
682682
- tag_name: app.label.version
683683
key: app.kubernetes.io/version
684684
from: pod
685+
k8sattributes/ecs:
686+
filter:
687+
# Only retrieve pods running on the same node as the collector
688+
node_from_env_var: OTEL_K8S_NODE_NAME
689+
passthrough: false
690+
pod_association:
691+
# Below association takes a look at the k8s.pod.ip and k8s.pod.uid resource attributes or connection's context, and tries to match it with the pod having the same attribute.
692+
- sources:
693+
- from: resource_attribute
694+
name: k8s.pod.ip
695+
- sources:
696+
- from: resource_attribute
697+
name: k8s.pod.uid
698+
- sources:
699+
- from: connection
700+
extract:
701+
metadata:
702+
- "k8s.replicaset.name"
703+
- "k8s.statefulset.name"
704+
- "k8s.daemonset.name"
705+
- "k8s.cronjob.name"
706+
- "k8s.job.name"
685707
receivers:
686708
# [OTLP Receiver](https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver)
687709
otlp:
@@ -852,7 +874,7 @@ collectors:
852874
processors:
853875
- elasticinframetrics
854876
- batch
855-
- k8sattributes
877+
- k8sattributes/ecs
856878
- resourcedetection/system
857879
- resourcedetection/eks
858880
- resourcedetection/gcp

0 commit comments

Comments
 (0)