Skip to content

Add BYOC resource generation - #3556

Merged
shuheiktgw merged 3 commits into
mainfrom
add-byoc-resource-generation
Oct 7, 2026
Merged

shuheiktgw merged 3 commits into
mainfrom
add-byoc-resource-generation

Conversation

@shuheiktgw

@shuheiktgw shuheiktgw commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds Kubernetes resource generation for DatadogBYOCCluster:

  • internal/controller/datadogbyoccluster/resources: Builders for the various resources required for a BYOC cluster, except for Observability Pipelines Workers.

No reconciler calls these builders yet. The BYOC controller PR wires them in. Child Observability Pipelines Worker generation comes in a later PR. Adds github.com/imdario/mergo as a direct dependency (already in go.sum).

Checklist

  • PR has at least one valid label: enhancement
  • PR has a milestone or the qa/skip-qa label
  • All commits are signed

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T12:59:09.592589Z ba9f2d6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd135749d0

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/controller/datadogbyoccluster/resources/config_map.go
Comment thread internal/controller/datadogbyoccluster/resources/workload.go Outdated
Comment thread internal/controller/datadogbyoccluster/resources/workload.go Outdated
Comment thread internal/controller/datadogbyoccluster/resources/resources.go Outdated
@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Code Coverage

🎯 Code Coverage (details)
• Patch Coverage: 94.44%
• Overall Coverage: 53.61% (+0.74%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ba9f2d6 | Docs | Give us feedback!

@shuheiktgw
shuheiktgw force-pushed the add-byoc-resource-generation branch from dd13574 to a4f135e Compare October 6, 2026 09:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4f135eb9f

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/controller/datadogbyoccluster/resources/metadata.go
Comment thread internal/controller/datadogbyoccluster/resources/workload.go Outdated
Comment thread internal/controller/datadogbyoccluster/resources/stateful_set.go Outdated
Base automatically changed from add-byoc-defaults-validation to main October 6, 2026 11:21
@shuheiktgw
shuheiktgw force-pushed the add-byoc-resource-generation branch from a4f135e to c1dee15 Compare October 6, 2026 11:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c1dee15341

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/controller/utils/merge.go
Comment thread internal/controller/datadogbyoccluster/resources/stateful_set.go Outdated
@shuheiktgw
shuheiktgw force-pushed the add-byoc-resource-generation branch from 3d3ccb7 to c1dee15 Compare October 6, 2026 11:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3d3ccb7d63

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/controller/datadogbyoccluster/resources/workload.go Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ecd03a4d3

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/controller/datadogbyoccluster/resources/workload.go Outdated
Comment thread internal/controller/datadogbyoccluster/resources/stateful_set.go Outdated
Comment thread internal/controller/datadogbyoccluster/resources/config_map.go
@shuheiktgw
shuheiktgw force-pushed the add-byoc-resource-generation branch from 0ecd03a to d08cba0 Compare October 6, 2026 13:02

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d08cba072a

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/controller/datadogbyoccluster/resources/workload.go
Comment thread internal/controller/datadogbyoccluster/resources/resources.go
func components(cluster *datadoghqv1alpha1.DatadogBYOCCluster) []component {
spec := cluster.Spec.Components
return []component{
metastoreComponent(MetastoreComponentName, quickwitMetastoreServiceName, "QW_METASTORE_URI", spec.Metastore),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Env variable misnomers are hard to detect and keep aligned across different repos. I suggest to at least group all the env variables on top (or a dedicated env.go).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively in constants.go?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've grouped all the Pomsky configurations in pomsky.go 🙏
ba9f2d6


config := map[string]any{
"version": 0.8,
"listen_address": "0.0.0.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(not relevant to the PR) I dream of the day [::] becomes the default and IPv4 is dead. Long live IPv6 :)

datadoghqv1alpha1 "github.com/DataDog/datadog-operator/api/datadoghq/v1alpha1"
)

func newConfigMap(cluster *datadoghqv1alpha1.DatadogBYOCCluster) (*corev1.ConfigMap, error) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC here we create a new default ConfigMap. How to keep it aligned with Pomsky? What I'm after is to minimise having the same values defined multiples times across different repositories.

Comment thread internal/controller/datadogbyoccluster/resources/workload.go Outdated
Comment thread internal/controller/datadogbyoccluster/resources/workload.go Outdated
@Mallets

Mallets commented Oct 7, 2026

Copy link
Copy Markdown

The code LGTM.

However I have a general concern w.r.t. default config/values duplication between the Pomsky helm chart and the values included in this PR. Going forward keeping aligned default config/values across repos is going to be an additional burden to the release process.

Before merging this PR, I'd like to have sketched out the workflow for updating config/values in Pomsky between helm chart and operator.

As a first step I suggest to group all config values, env var names, etc. in a single file in this PR.
This should already facilitate keeping things aligned (and any automation) going forward.

QW_NUM_CPUS is read from the CPU request through the downward API, which
resolves to 0 when neither a CPU request nor a CPU limit is set. Quickwit
then uses 0 CPUs instead of falling back to another source. Reject custom
resources without any CPU value on every Pomsky component.
Collect component names, environment variable names, ports, probe
settings, fixed environment values and the static node configuration in
one file so they are easier to keep aligned with the CloudPrem Helm
chart. Rendered resources are unchanged.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba9f2d6233

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

InitContainers: spec.InitContainers,
Containers: []corev1.Container{{
Name: appName,
Image: in.image.GetImageReference(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject empty digest overrides before rendering the image

When a release is present and spec.imageOverrides.byoc.digest is explicitly "", the CRD accepts it because digest has no MinLength, and runtime validation only rejects an empty digest when no release is provided. The resolver then treats the non-nil override as authoritative, clearing the release tag and producing a ResolvedImage with neither tag nor digest; this line consequently renders <repository>:, which Kubernetes rejects, so every BYOC workload fails to be created. Reject empty digest values regardless of whether a release is configured, or treat an empty digest as omitted.

Useful? React with 👍 / 👎.

@shuheiktgw

Copy link
Copy Markdown
Contributor Author

So the plan is: in the short term, we’ll use the Pomsky Helm chart as the source of truth and pick up changes made there and apply the same changes to the Operator. In the mid term, I’d like to automate this process. In the long run, I’d like to sunset the Helm chart.

@shuheiktgw
shuheiktgw merged commit 324dd04 into main Oct 7, 2026
40 checks passed
@shuheiktgw
shuheiktgw deleted the add-byoc-resource-generation branch October 7, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants