Repository navigation
Add kubeactions par + rc config - #3618
gh-worker-dd-mergequeue-cf854d[bot] merged 10 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 843ea5c1f2
ℹ️ 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".
| clusterAnnotationEnabled := featureutils.HasFeatureEnableAnnotation(dda, featureutils.EnableClusterAgentPrivateActionRunnerAnnotation) | ||
| if clusterAnnotationEnabled || featureutils.IsKubernetesActionsPAREnabled(ddaSpec) { |
There was a problem hiding this comment.
Gate PAR auto-enable on the Cluster Agent version
When communication.par is enabled for a Cluster Agent older than 7.84, this condition configures the Private Action Runner despite the API declaring that channel unsupported before 7.84. For versions below 7.79, the Kubernetes Actions feature rejects the configuration while this separate feature still provisions an orphan runner, ConfigMap, and RBAC; for 7.79–7.83 it selects a channel that cannot deliver Kubernetes Actions. Apply the corresponding Cluster Agent version gate before requiring the runner.
Useful? React with 👍 / 👎.
Only pass DD_KUBEACTIONS_REMOTE_CONFIG_ENABLED / DD_KUBEACTIONS_PRIVATE_ACTION_RUNNER_ENABLED when the channel is turned off and the Cluster Agent understands the setting. On an older Cluster Agent, communication.rc=false is logged and ignored. communication.par=false now keeps Kubernetes actions out of a Private Action Runner enabled for other workflows. Fix the PAR minimum Cluster Agent version to 7.83.0.
…ons-communication # Conflicts: # docs/configuration.v2alpha1.md # docs/configuration_public.md
The patch DaemonSet / StatefulSet actions are not exposed in the Datadog UI, so do not grant the Cluster Agent cluster-wide patch on those workloads.
communication.par enabled the Cluster Agent Private Action Runner on any Cluster Agent version, provisioning an orphan runner, ConfigMap and RBAC on versions that don't ship the Kubernetes Actions bundle. Only enable it on 7.83.0+, from a shared feature-utils helper so the private action runner and Kubernetes Actions features agree, and log when the request is ignored. Also regenerate zz_generated.openapi.go (stale PAR field description) and add unit tests for the Kubernetes Actions helpers and builder.
|
|
||
| // KubernetesActionsCommunicationConfig selects the channels used to deliver Kubernetes actions to the Cluster Agent. | ||
| // +k8s:openapi-gen=true | ||
| type KubernetesActionsCommunicationConfig struct { |
There was a problem hiding this comment.
Naming nit: could we spell these out as remoteConfiguration / privateActionRunner? The CRD already uses remoteConfiguration for RC (features.remoteConfiguration, features.cws.remoteConfiguration), PAR is spelled out in all the private-action-runner-* annotations, and the agent env vars this maps to (DD_KUBEACTIONS_REMOTE_CONFIG_ENABLED, DD_KUBEACTIONS_PRIVATE_ACTION_RUNNER_ENABLED) spell them out too.
Struct nit: Optionally, following the cws.remoteConfiguration.enabled pattern ({enabled: bool} sub-structs) would leave room for PAR-specific options later for communication to be configured (eg. providing own URL or APP keys to be used for that specific RC client)
| if !apiutils.BoolValue(ka.Enabled) { | ||
| return false | ||
| } | ||
| return ka.Communication == nil || ka.Communication.RC == nil || *ka.Communication.RC |
There was a problem hiding this comment.
Optional nit: unsure if you've considered this but there does exist the global features.remoteConfiguration config. It could make sense to also disable KubeActions RC if the global RC is disabled, but also fair if you want this to be completely independent. Just wanted to highlight this
…nfiguration is disabled
Address review feedback:
- Spell out communication.rc / communication.par as
communication.remoteConfiguration.enabled / communication.privateActionRunner.enabled,
using {enabled} sub-structs like cws.remoteConfiguration so per-channel options can be
added later.
- Log an error when Kubernetes Actions is enabled while features.remoteConfiguration is
disabled: the Cluster Agent intentionally refuses to start in that case, and the log
points at the cause.
| // Communication selects the channels the Cluster Agent uses to receive Kubernetes actions. | ||
| // At least one channel must be enabled; both can be enabled at the same time. | ||
| // +optional | ||
| Communication *KubernetesActionsCommunicationConfig `json:"communication,omitempty"` |
There was a problem hiding this comment.
Do we really want to expose the internals here?
There was a problem hiding this comment.
@vboulineau The thought was that we'd give the option to use both pipelines or just one. Are you thinking that maybe we just require both? The PAR uses RC for configuration so, it's not like customers can use it with RC disabled anyway.
features.kubernetesActions.enabled: true now uses both Remote Configuration and the Cluster Agent Private Action Runner (on Cluster Agent 7.83.0+); set communication.privateActionRunner.enabled: false for Remote Configuration only.
Raise the Kubernetes Actions minimum Cluster Agent version from 7.79.0 to 7.84.0 and use one KubernetesActionsMinVersion for both the Kubernetes Actions feature and the Private Action Runner it enables. On older Cluster Agents the feature is not configured.
gabedos
left a comment
There was a problem hiding this comment.
Exposing KubeActions.Communication.[RemoteConfig|PrivateActionRunner].Enabled looks good to me 👍
…ons-communication # Conflicts: # api/datadoghq/v2alpha1/zz_generated.openapi.go # docs/configuration.v2alpha1.md
72c5a56 to
d08b6cb
Compare
What does this PR do?
A brief description of the change being made with this pull request.
Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Minimum Agent Versions
Are there minimum versions of the Datadog Agent and/or Cluster Agent required?
Describe your test plan
Write there any instructions and details you may have to test your PR.
Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel