[Backport v1.29] [TON-743] Add EKS add-on credential sync resources - #3330
Conversation
Add EKS add-on lifecycle chart contract Rename managed installation chart values Support managed installation credentials in EKS add-on Add EKS add-on credential sync resources Generalize EKS add-on credential sync Use operator pod for credential sync Rename credential sync template Clarify credential sync values documentation Restore EKS add-on release instructions Merge branch 'main' into fanny/TON-723/operator-addon-ascp-credentials-sync Make synchronized secret name configurable Simplify credential sync configuration Co-authored-by: fanny.jiang <fanny.jiang@datadoghq.com> (cherry picked from commit 5d82e4a)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6091500ce
ℹ️ 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".
| secretObjects: | ||
| - secretName: {{ default "datadog-secret" $credentialsSecretSync.kubernetesSecretName | quote }} |
There was a problem hiding this comment.
Add a pod mount to drive credential secret sync
When a user enables credentialsSecretSync and points datadog-operator.*ExistingSecret at this secret, this manifest still will not create the Kubernetes Secret by itself: the Secrets Store CSI Driver only syncs secretObjects after a pod mounts the SecretProviderClass, and this chart does not render any pod/volume referencing datadog-credentials. In that configuration the operator waits on a missing Secret unless users deploy an extra mounting pod outside the add-on, so the chart should render that mount/keeper pod or mount the SPC on the operator deployment together with this resource.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Users can mount the datadog-credentials volume to the operator pod via the Add-on values or to any pod of their choice running in the same namespace.
|
🎯 Code Coverage (details) 🔗 Commit SHA: a609150 | Docs | Datadog PR Page | Give us feedback! |
Backport 5d82e4a from #3291.
What does this PR do?
Adds opt-in AWS Secrets Manager credential synchronization to the Datadog Operator EKS add-on chart.
When
credentialsSecretSync.apiKeySecretId,credentialsSecretSync.appKeySecretId, or both are configured, the chart rendersSecretProviderClass/datadog-credentials, which synchronizes the configured values to theapi-keyandapp-keykeys inSecret/<kubernetesSecretName>(datadog-secretby default).To have the Operator use this Secret, set its name in
datadog-operator.apiKeyExistingSecretand/ordatadog-operator.appKeyExistingSecret.To use this feature, a pod in the add-on namespace must mount a Secrets Store CSI volume referencing
SecretProviderClass/datadog-credentials. The volume can be mounted to the Operator pod usingdatadog-operator.volumesanddatadog-operator.volumeMounts(see QA example below). A future version of the Datadog Operator chart will provide a dedicated option for enabling this configuration. The pod service account must have an EKS Pod Identity association with an IAM role that can read the configured secrets. The cluster must have the EKS Pod Identity Agent and AWS Secrets Store CSI Driver Provider add-ons installed, with Kubernetes Secret sync enabled.Motivation
Bootstraps Datadog API and application-key credentials from AWS Secrets Manager when installing the Datadog Operator EKS add-on.
Minimum Agent Versions
Describe your test plan
Automated/local validation performed:
datadog-operatordependency.SecretProviderClass/datadog-credentialsand the Operator Deployment can mount its CSI volume.SecretProviderClassPodStatusreportedmounted=true, and SHA-256 comparisons confirmed both synchronized keys matched their Secrets Manager values.git diff --check.QA
ACTIVE:In Secrets Manager, create separate API- and App-key secrets as raw plaintext values (not JSON key-value pairs). Use the default
aws/secretsmanagerencryption key. Record both secret ARNs.Create a Pod Identity IAM role using these policies, replacing the secret ARN placeholders:
trust-policy.json:{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": {"Service": "pods.eks.amazonaws.com"}, "Action": ["sts:AssumeRole", "sts:TagSession"], "Condition": {"StringEquals": { "aws:RequestTag/kubernetes-namespace": "datadog-addon-qa", "aws:RequestTag/kubernetes-service-account": "operator-eks-addon-datadog-operator" }} }] }permissions-policy.json:{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["secretsmanager:GetSecretValue", "secretsmanager:DescribeSecret"], "Resource": ["<API_KEY_SECRET_ARN>", "<APP_KEY_SECRET_ARN>"] }] }marketplaces/charts/operator-eks-addon/README.md. Install it with values equivalent to:Confirm the pod status reports
mounted=true,datadog-secretcontainsapi-keyandapp-key, and their SHA-256 hashes match the Secrets Manager values without printing them. The final command should reportNotFoundbecause there is no helper Deployment.Also install or render with
credentialsSecretSync: nulland verify thatSecretProviderClass/datadog-credentialsis absent.AWS references: ASCP EKS add-on and EKS Pod Identity roles.
Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel