Add installation script for the OTel Kube Stack Helm Chart - #294
Add installation script for the OTel Kube Stack Helm Chart#294cyrille-leclerc wants to merge 26 commits into
Conversation
…kube-stack-install-script # Conflicts: # guides/kubernetes/configuration/kube-stack/values.yaml
…kube-stack-install-script # Conflicts: # guides/kubernetes/configuration/kube-stack/Makefile # guides/kubernetes/configuration/kube-stack/examples/default/rendered/collector.yaml
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a2db7a8bc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33c8c47ec3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| read -p "Datadog Site (eg: 'datadoghq.eu'): " DD_SITE | ||
| [[ -z "$DD_SITE" ]] && error "Datadog Site cannot be empty" | ||
|
|
||
| read -p "Datadog API Key (eg: '1234...'): " DD_API_KEY |
There was a problem hiding this comment.
When the interactive setup path is used, this prompt echoes the Datadog API key to the terminal as it is typed, so the secret can be exposed in screen recordings, shared terminals, or scrollback. Use a silent read for this credential prompt before creating the Kubernetes secret.
Useful? React with 👍 / 👎.
|
@kangyili i think we would also greatly benefit from: I would love to get you feedback on this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18c21c6e9b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| kubectl create secret generic datadog-secret \ | ||
| --namespace opentelemetry-operator-system \ | ||
| --from-literal="api-key=$DD_API_KEY" \ | ||
| --from-literal="dd-site=${DD_SITE:-datadoghq.com}" \ | ||
| || echo "WARNING: Could not create secret 'datadog-secret' (may already exist or insufficient permissions). Continuing..." |
There was a problem hiding this comment.
Replace the Datadog secret on reruns
When the install script is rerun after the user fixes or rotates DD_API_KEY/DD_SITE, this kubectl create secret generic step is only a create operation (kubectl docs); if datadog-secret already exists, the command fails and the || echo path continues, so the Helm upgrade keeps using the old secret and telemetry is exported with stale credentials. Generate the Secret with --dry-run=client -o yaml | kubectl apply -f -, or delete/replace it before continuing.
Useful? React with 👍 / 👎.
| kubectl delete crd --namespace opentelemetry-operator-system opentelemetrycollectors.opentelemetry.io | ||
| kubectl delete crd --namespace opentelemetry-operator-system instrumentations.opentelemetry.io | ||
| kubectl delete crd --namespace opentelemetry-operator-system opampbridges.opentelemetry.io No newline at end of file |
There was a problem hiding this comment.
When this example is uninstalled from a cluster that also uses the OpenTelemetry Operator for another namespace or Helm release, these deletes are cluster-wide because Kubernetes documents CRDs as non-namespaced (CRD docs); the --namespace flag does not limit the blast radius, so this can remove the API definitions and custom resources for unrelated OpenTelemetry workloads. Leave CRDs in place by default or gate this behind an explicit destructive cleanup option.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 576e7b410a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| echo "Installing cert-manager (if not already installed)..." | ||
|
|
||
| helm repo add jetstack https://charts.jetstack.io |
There was a problem hiding this comment.
Make Helm repo setup idempotent
If the installer is rerun on a workstation where jetstack or open-telemetry has already been added, this unguarded helm repo add can abort the script under set -e before it reaches the idempotent secret apply and helm upgrade --install; Helm documents that existing repo names error in Helm 3.3.2+ and that --force-update is the overwrite path (https://helm.sh/docs/v3/faq/troubleshooting/#helm-repo-add-fails-when-it-used-to-work). Add --force-update or tolerate the already-present repo for both repo additions.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52dd7f3a47
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| # Load environment variables from .env file if it exists | ||
| [[ -f "$SCRIPT_DIR/.env" ]] && source "$SCRIPT_DIR/.env" | ||
|
|
||
| if [[ ! -f "$SCRIPT_DIR/.env" ]]; then |
There was a problem hiding this comment.
Honor pre-set credentials before prompting
When the installer is run with DD_API_KEY/DD_SITE already exported but no .env file exists, this condition still forces the interactive read path because it only checks for the file. That makes common non-interactive usage such as CI or DD_API_KEY=... DD_SITE=... ./install block or abort under set -e; gate the prompts on the required variables being missing instead of on .env alone.
Useful? React with 👍 / 👎.
|
FYI simplifying setup with: |
What does this PR do?
Add an installation script
Motivation