Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Helm generated instead of cert-manager generated certs for the operator #1648

Merged
merged 25 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
20c7ba1
initial draft
jvoravong Jan 29, 2025
b36d8a3
Update CI/CD to support self signed cert data
jvoravong Jan 29, 2025
688d380
update functional tests
jvoravong Feb 13, 2025
3be762e
Merge branch 'main'
jvoravong Feb 13, 2025
9670d64
more test fixes
jvoravong Feb 13, 2025
ccf0937
Merge branch 'main'
jvoravong Feb 13, 2025
18d5c01
updates to keep support for the certmanager subchart around, updated …
jvoravong Feb 14, 2025
c23c1a1
Update docs/auto-instrumentation-install.md
jvoravong Feb 14, 2025
5895726
draft migration guide for 0.118.0 to 0.119.0
jvoravong Feb 18, 2025
cf52cab
Update docs/auto-instrumentation-install.md
jvoravong Feb 18, 2025
367f02e
Merge branch 'main' of https://github.com/signalfx/splunk-otel-collec…
jvoravong Feb 26, 2025
4ade4e0
Update docs after main merge
jvoravong Feb 26, 2025
c429f2b
split our pre-commit update into a separate PR
jvoravong Feb 26, 2025
c4f6cd7
Merge branch 'main' of https://github.com/signalfx/splunk-otel-collec…
jvoravong Feb 26, 2025
83ce345
Documentation improvements, mostly just reorganize content for easier…
jvoravong Feb 27, 2025
49091d2
name fix
jvoravong Feb 27, 2025
c28f181
remove doc TODOs
jvoravong Feb 27, 2025
87e1823
More upgrading step touch ups
jvoravong Feb 27, 2025
868016f
remove functional test values file updates because they are not needed
jvoravong Feb 27, 2025
4bef359
regenerate functional_tests/testdata/expected_kind_values/expected_cl…
jvoravong Feb 27, 2025
d12f6f3
dummy commit to get CI/CD run with the "Ignore Tests" PR label
jvoravong Feb 27, 2025
6f7aea3
restore comment that wasn't ment to be removed
jvoravong Feb 27, 2025
4c8d9e4
doc update for autoGenerateCert.enabled
jvoravong Feb 28, 2025
ea8b041
Remove missed cert-manager references in docs
jvoravong Mar 3, 2025
4dff958
Update UPGRADING.md
jvoravong Mar 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .github/workflows/functional_test_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ jobs:
- name: Update dependencies
run: |
make dep-update
- name: Deploy cert-manager
run: |
make cert-manager
- name: run functional tests
id: run-functional-tests
env:
Expand Down Expand Up @@ -124,9 +121,6 @@ jobs:
- name: Update dependencies
run: |
make dep-update
- name: Deploy cert-manager
run: |
make cert-manager
- name: run functional tests
env:
HOST_ENDPOINT: 0.0.0.0
Expand Down Expand Up @@ -178,19 +172,13 @@ jobs:
- name: Update dependencies
run: |
cd base && make dep-update
- name: Deploy cert-manager
run: |
cd base && make cert-manager
- name: Deploy previous version of the chart
run: |
helm list | grep -q "^sock$" && echo "Found previous 'sock' release. Deleting..." && helm delete sock
cd base && helm install sock helm-charts/splunk-otel-collector --set cloudProvider=aws --set distribution=eks --set splunkObservability.realm=us0 --set splunkObservability.accessToken=xxxxx
- name: Update dependencies
run: |
make dep-update
- name: Deploy cert-manager
run: |
make cert-manager
- name: run functional tests
env:
HOST_ENDPOINT: 0.0.0.0
Expand Down Expand Up @@ -232,19 +220,13 @@ jobs:
- name: Update dependencies
run: |
cd base && make dep-update
- name: Deploy cert-manager
run: |
cd base && make cert-manager
- name: Deploy previous version of the chart
run: |
helm list | grep -q "^sock$" && echo "Found previous 'sock' release. Deleting..." && helm delete sock
cd base && helm install sock helm-charts/splunk-otel-collector --set cloudProvider=aws --set distribution=eks --set splunkObservability.realm=us0 --set splunkObservability.accessToken=xxxxx --set operator.enabled=true --set environment=dev
- name: Update dependencies
run: |
make dep-update
- name: Deploy cert-manager
run: |
make cert-manager
- name: run functional tests
env:
HOST_ENDPOINT: 0.0.0.0
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ repos:
exclude: "^examples|^test"
- id: check-yaml
# Can't check source yaml since it has go templates in it.
# Can't check operator-webhook.yaml due to redacted TLS certificate information causing yaml format issues.
exclude: "^helm-charts|operator-webhook.yaml"
args: [ --allow-multiple-documents ]
- id: check-added-large-files
97 changes: 88 additions & 9 deletions docs/auto-instrumentation-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ these frameworks often have pre-built instrumentation capabilities already avail
- [partially enable profiling](../examples/enable-operator-and-auto-instrumentation/instrumentation/instrumentation-enable-profiling-partially.yaml).

```bash
# Check if cert-manager is already installed, don't deploy a second cert-manager.
kubectl get pods -l app=cert-manager --all-namespaces

# If cert-manager is not deployed, make sure to add certmanager.enabled=true to the list of values to set
helm install splunk-otel-collector -f ./my_values.yaml --set operatorcrds.install=true,operator.enabled=true,environment=dev splunk-otel-collector-chart/splunk-otel-collector
```

Expand Down Expand Up @@ -533,10 +529,93 @@ kubectl get certificates
# splunk-otel-collector-operator-serving-cert True splunk-otel-collector-operator-controller-manager-service-cert 5m
```

##### Using a Self-Signed Certificate for the Webhook
#### TLS Certificate Requirement for Kubernetes Operator Webhooks

In Kubernetes, the API server communicates with operator webhook components over HTTPS, which requires a valid TLS certificate that the API server trusts. The operator supports several methods for configuring the required certificate, each with different levels of complexity and security.

---

##### 1. **Using a Self-Signed Certificate Generated by the Chart**

This is the default and simplest method for generating a TLS certificate. It automatically creates a self-signed certificate for the webhook. It is suitable for internal environments or testing purposes but may not be trusted by clients outside your cluster.

**Configuration:**
- Set `admissionWebhooks.certManager.enabled` to `false` and `admissionWebhooks.autoGenerateCert.enabled` to `true`.
- Helm generates a self-signed certificate, valid for 10 years, and creates a secret for the webhook.
- The certificate is automatically recreated on every Helm upgrade.

This is the easiest setup for users and does not require additional configuration.

**Note**: Self-signed certificates are not trusted by default by clients, so this option is generally best for internal or testing scenarios.

---

##### 2. **Using a cert-manager Certificate**

Using `cert-manager` offers more control over certificate management and is more suitable for production environments. However, due to Helm’s install/upgrade order of operations, cert-manager CRDs and certificates cannot be installed within the same Helm operation. To work around this limitation, you can choose one of the following options:

###### Option 1: **Pre-deploy cert-manager**

If `cert-manager` is already deployed in your cluster, you can configure the operator to use it without enabling certificate generation by Helm.

**Configuration:**
```yaml
operator:
admissionWebhooks:
certManager:
enabled: true
autoGenerateCert:
enabled: false
```

###### Option 2: **Deploy cert-manager and the operator together**

If you need to install `cert-manager` along with the operator, use a Helm post-install or post-upgrade hook to ensure that the certificate is created after cert-manager CRDs are installed.

**Configuration:**
```yaml
operator:
admissionWebhooks:
certManager:
enabled: true
certificateAnnotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-weight": "1"
issuerAnnotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-weight": "1"
certmanager:
enabled: true
installCRDs: true
```

This method is useful when installing `cert-manager` as a subchart or as part of a larger Helm chart installation.

---

##### 3. **Using a Custom Externally Generated Certificate**

For full control, you can use an externally generated certificate. This is suitable if you already have a certificate issued by a trusted CA or have specific security requirements.

**Configuration:**
- Set both `operator.admissionWebhooks.certManager.enabled` and `operator.admissionWebhooks.autoGenerateCert.enabled` to `false`.
- Provide the paths to your certificate (`certFile`), private key (`keyFile`), and CA certificate (`caFile`) in the values.

**Example:**
```yaml
operator:
admissionWebhooks:
certManager:
enabled: false
autoGenerateCert:
enabled: false
certFile: /path/to/cert.crt
keyFile: /path/to/cert.key
caFile: /path/to/ca.crt
```

This method allows you to use a certificate that is trusted by external systems, such as certificates issued by a corporate CA.

The operator supports various methods for managing TLS certificates for the webhook. Below are the options available through the operator, with a brief description for each. For detailed configurations and specific use cases, please refer to the operator’s
[official Helm chart documentation](https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-operator/values.yaml)
---

**Note**: While using a self-signed certificate offers a quicker and simpler setup, it has limitations, such as not being trusted by default by clients.
This may be acceptable for testing purposes or internal environments. For complete configurations and additional guidance, please refer to the provided link to the Helm chart documentation.
For more advanced use cases, refer to the [official Helm chart documentation](https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-operator/values.yaml) for detailed configuration options and scenarios.
9 changes: 9 additions & 0 deletions examples/enable-operator-and-auto-instrumentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ This example demonstrates how to:
- **Single App Focus:** Explore trace-related performance of a single instrumented NodeJS application in the APM console.
- **Simplified Use Case:** Although relations between applications will not be showcased in the APM console, this demo offers a simplified setup suitable for understanding basic instrumentation and trace visualization.

## [Simple Webserver - .NET Instrumentation](./otel-demo-nodejs.md)
This example demonstrates how to:
- Deploy the chart to the current namespace and the demo to the `dotnet-demo` namespace.
- Instrument a single .NET application.

**Highlights:**
- **Single App Focus:** Explore trace-related performance of a single instrumented .NET application in the APM console.
- **Simplified Use Case:** Although relations between applications will not be showcased in the APM console, this demo offers a simplified setup suitable for understanding basic instrumentation and trace visualization.

## Exploring Traces and Applications in APM Console
The examples provide practical insights into using the APM console for exploring application relations and traces.
Whether dealing with multiple applications interacting with each other or focusing on a single application, you will gain hands-on experience in visualizing trace data using Splunk Observability APM.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ operatorcrds:
install: true
operator:
enabled: true
certmanager:
enabled: true

Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@ curl https://raw.githubusercontent.com/signalfx/splunk-otel-collector-chart/main
#### 2.1 Deploy the Helm Chart with the Operator enabled

To install the chart with operator in an existing cluster, make sure you have cert-manager installed and available.
Both the cert-manager and operator are subcharts of this chart and can be enabled with `--set operatorcrds.install=true,operator.enabled=true,certmanager.enabled=true`.
Both the cert-manager and operator are subcharts of this chart and can be enabled with `--set operatorcrds.install=true,operator.enabled=true`.
These helm install commands will deploy the chart to the current namespace for this example.

```bash
# Check if a cert-manager is already installed by looking for cert-manager pods.
kubectl get pods -l app=cert-manager --all-namespaces

# If cert-manager is deployed, make sure to remove certmanager.enabled=true to the list of values to set
helm install splunk-otel-collector -f ./my_values.yaml --set operatorcrds.install=true,operator.enabled=true,certmanager.enabled=true,environment=dev splunk-otel-collector-chart/splunk-otel-collector
```

Expand All @@ -46,15 +42,16 @@ kubectl get pods
# splunk-otel-collector-agent-2mtfn 2/2 Running 0 5m
# splunk-otel-collector-agent-k4gc8 2/2 Running 0 5m
# splunk-otel-collector-agent-wjt98 2/2 Running 0 5m
# splunk-otel-collector-certmanager-69b98cc84d-2vzl7 1/1 Running 0 5m
# splunk-otel-collector-certmanager-cainjector-76db6dcbbf-4625c 1/1 Running 0 5m
# splunk-otel-collector-certmanager-webhook-bc68cd487-dctrf 1/1 Running 0 5m
# splunk-otel-collector-k8s-cluster-receiver-8449bfdc8-hhbvz 1/1 Running 0 5m
# splunk-otel-collector-operator-754c9d78f8-9ztwg 2/2 Running 0 5m

kubectl get mutatingwebhookconfiguration.admissionregistration.k8s.io
# NAME WEBHOOKS AGE
# splunk-otel-collector-certmanager-webhook 1 8m
# splunk-otel-collector-operator-mutation 3 2m

# TODO: Validate these inputs andoutput
kubectl get validatingwebhookconfiguration.admissionregistration.k8s.io
# NAME WEBHOOKS AGE
# splunk-otel-collector-operator-mutation 3 2m

kubectl get otelinst
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@ curl https://raw.githubusercontent.com/signalfx/splunk-otel-collector-chart/main
#### 2.1 Deploy the Helm Chart with the Operator enabled

To install the chart with operator in an existing cluster, make sure you have cert-manager installed and available.
Both the cert-manager and operator are subcharts of this chart and can be enabled with `--set operatorcrds.install=true,operator.enabled=true,certmanager.enabled=true`.
Both the cert-manager and operator are subcharts of this chart and can be enabled with `--set operatorcrds.install=true,operator.enabled=true`.
These helm install commands will deploy the chart to the current namespace for this example.

```bash
# Check if a cert-manager is already installed by looking for cert-manager pods.
kubectl get pods -l app=cert-manager --all-namespaces

# If cert-manager is deployed, make sure to remove certmanager.enabled=true to the list of values to set
helm install splunk-otel-collector -f ./my_values.yaml --set operatorcrds.install=true,operator.enabled=true,certmanager.enabled=true,environment=dev splunk-otel-collector-chart/splunk-otel-collector
helm install splunk-otel-collector -f ./my_values.yaml --set operatorcrds.install=true,operator.enabled=true,environment=dev splunk-otel-collector-chart/splunk-otel-collector
```

#### 2.2 Verify all the OpenTelemetry resources (collector, operator, webhook, instrumentation) are deployed successfully
Expand All @@ -42,15 +38,16 @@ kubectl get pods
# splunk-otel-collector-agent-2mtfn 2/2 Running 0 5m
# splunk-otel-collector-agent-k4gc8 2/2 Running 0 5m
# splunk-otel-collector-agent-wjt98 2/2 Running 0 5m
# splunk-otel-collector-certmanager-69b98cc84d-2vzl7 1/1 Running 0 5m
# splunk-otel-collector-certmanager-cainjector-76db6dcbbf-4625c 1/1 Running 0 5m
# splunk-otel-collector-certmanager-webhook-bc68cd487-dctrf 1/1 Running 0 5m
# splunk-otel-collector-k8s-cluster-receiver-8449bfdc8-hhbvz 1/1 Running 0 5m
# splunk-otel-collector-operator-754c9d78f8-9ztwg 2/2 Running 0 5m

kubectl get mutatingwebhookconfiguration.admissionregistration.k8s.io
# NAME WEBHOOKS AGE
# splunk-otel-collector-certmanager-webhooh 1 8m
# splunk-otel-collector-operator-mutation 3 2m

# TODO: Validate these inputs andoutput
kubectl get validatingwebhookconfiguration.admissionregistration.k8s.io
# NAME WEBHOOKS AGE
# splunk-otel-collector-operator-mutation 3 2m

kubectl get otelinst
Expand Down

This file was deleted.

Loading
Loading