Skip to content

Improvement/integrate registry operator mk8s - #5097

Open
eg-ayoub wants to merge 8 commits into
development/134.0from
improvement/integrate-registry-operator-mk8s
Open

Improvement/integrate registry operator mk8s#5097
eg-ayoub wants to merge 8 commits into
development/134.0from
improvement/integrate-registry-operator-mk8s

Conversation

@eg-ayoub

Copy link
Copy Markdown
Contributor

let's plug in the registry operator in metalk8s

moved from init.sls to core.sls because it's needed by
metalk8s-registry-operator and metalk8s-registry-operator is a core
component

Ref: MK8S-168
@eg-ayoub
eg-ayoub requested a review from a team as a code owner August 21, 2026 07:54
@bert-e

bert-e commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Hello eg-ayoub,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request.
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e

bert-e commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

Peer approvals must include at least 1 approval from the following list:

@eg-ayoub
eg-ayoub force-pushed the improvement/integrate-registry-operator-mk8s branch from 8e50d61 to f712e71 Compare August 21, 2026 07:57
Comment thread kustomizes/metalk8s-registry-operator/kustomization.yaml Outdated
- result: __slot__:salt:metalk8s_kubernetes.check_object_ready(
apiVersion='apps/v1', kind=Deployment,
name="metalk8s-registry-operator-controller-manager",
namespace="metalk8s-registry-system")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This checks the deployment in namespace metalk8s-registry-system, but the kustomize namespace override places the deployment in metalk8s-registry. The readiness check will never find the deployment.

— Claude Code

apiVersion: v1
kind: Namespace
metadata:
name: metalk8s-registry-system

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This creates namespace metalk8s-registry-system but all chart resources are deployed to metalk8s-registry (the kustomize namespace override). The namespace created here is unused.

— Claude Code

- metalk8s.kubernetes.cni.calico.deployed
- metalk8s.kubernetes.coredns.deployed
- metalk8s.addons.cert-manager.deployed
- metalk8s.addons.registry-operator.deployed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wrong salt module path: directory is metalk8s-registry-operator (with metalk8s- prefix), not registry-operator. This will fail at deploy time with a missing SLS error. Should be metalk8s.addons.metalk8s-registry-operator.deployed.

— Claude Code

Comment thread buildchain/buildchain/versions.py Outdated
@claude

claude Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor
  • Wrong salt path in core.sls: metalk8s.addons.registry-operator.deployed should be metalk8s.addons.metalk8s-registry-operator.deployed — will fail at deploy time
    - Image version mismatch: versions.py has v0.0.1-alpha.3 but kustomization.yaml uses v0.0.1-alpha.4 — ISO will ship wrong image
    - Namespace mismatch across 4 files: kustomize overrides namespace to metalk8s-registry, but namespace.sls creates metalk8s-registry-system, init.sls checks readiness in metalk8s-registry-system, and webhook cert dnsNames/inject-ca-from annotations reference metalk8s-registry-system. Webhook TLS verification will fail.
    - Missing from salt_tree.py: New salt files (chart.sls, init.sls, namespace.sls) are not listed in buildchain/buildchain/salt_tree.py — they won't ship in the ISO
    - Missing from sanity.feature: The new Deployment should be added to tests/post/features/sanity.feature per project convention

    Review by Claude Code

effect: "NoSchedule"
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nodeSelector is at the wrong YAML level — it's under spec.template.nodeSelector (not a valid Deployment field) instead of spec.template.spec.nodeSelector. Kubernetes will silently ignore it, so the operator won't be constrained to master nodes. The rendered chart.sls confirms this: nodeSelector appears as a sibling of spec inside template.

Suggested change
effect: "NoSchedule"
apiVersion: apps/v1
kind: Deployment
metadata:
name: not-important
spec:
template:
spec:
nodeSelector:
node-role.kubernetes.io/master: ""
tolerations:
- key: "node-role.kubernetes.io/bootstrap"
operator: "Exists"
effect: "NoSchedule"
- key: "node-role.kubernetes.io/infra"
operator: "Exists"
effect: "NoSchedule"
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"

— Claude Code

Comment thread salt/metalk8s/addons/metalk8s-registry-operator/deployed/init.sls Outdated
@claude

claude Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor
  • Namespace mismatch across multiple files (existing comments still open): kustomization.yaml overrides namespace to metalk8s-registry, but namespace.sls, init.sls readiness check, and webhook cert dnsNames/inject-ca-from annotations all reference metalk8s-registry-system. Pick one namespace and align everything.
  • Wrong salt module path in core.sls (existing comment still open): metalk8s.addons.registry-operator.deployed should be metalk8s.addons.metalk8s-registry-operator.deployed.
  • deploy_patch.yaml: nodeSelector at wrong YAML level — placed under spec.template instead of spec.template.spec. Kubernetes will silently ignore it and the operator won't be pinned to master nodes.
    • Move nodeSelector under spec.template.spec alongside tolerations.
  • init.sls: wrong require syntax and missing orderingrequire is missing the - sls: prefix, and there are no ordering states for cert-manager (needed for webhook certs) or namespace-before-chart.
    • Use - sls: prefix. Add ordering states following the patterns in crl-operator and disk-management-agent.
  • Missing salt_tree.py entries — the three new salt files (init.sls, namespace.sls, chart.sls) under salt/metalk8s/addons/metalk8s-registry-operator/deployed/ are not listed in buildchain/buildchain/salt_tree.py. They won't ship in the ISO.
    • Add all three paths to salt_tree.py.
  • Missing sanity.feature entry — the new Deployment metalk8s-registry-operator-controller-manager is not listed in tests/post/features/sanity.feature.
    • Add a row for the deployment in the appropriate namespace.

Review by Claude Code

Use kustomize to generate a chart for the operator

Ref: MK8S-168
Deploy the registry alongside metalk8s core components

Ref: MK8S-168
@eg-ayoub
eg-ayoub force-pushed the improvement/integrate-registry-operator-mk8s branch from f712e71 to 39f5a48 Compare August 21, 2026 08:13
@claude

claude Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Still open from prior review:

- salt/metalk8s/deployed/core.sls:6 — Wrong salt module path: metalk8s.addons.registry-operator.deployed should be metalk8s.addons.metalk8s-registry-operator.deployed (directory is metalk8s-registry-operator, not registry-operator). Will fail at deploy time.
- kustomizes/metalk8s-registry-operator/deploy_patch.yamlnodeSelector is under spec.template.nodeSelector instead of spec.template.spec.nodeSelector. Kubernetes will silently ignore it and the operator won't be constrained to master nodes.
- salt/metalk8s/addons/metalk8s-registry-operator/deployed/init.sls:15-16require block uses wrong syntax (missing - sls: prefix). Additionally, the file is missing ordering dependencies: cert-manager must be ready before deploying (webhook certs), and namespace must be created before the chart. See crl-operator/deployed/init.sls and disk-management-agent/deployed/init.sls for the established patterns.

New issues:

- buildchain/buildchain/salt_tree.py — The three new salt files are not listed. Per the project checklist, they will not ship in the ISO. Need to add:
- salt/metalk8s/addons/metalk8s-registry-operator/deployed/chart.sls
- salt/metalk8s/addons/metalk8s-registry-operator/deployed/init.sls
- salt/metalk8s/addons/metalk8s-registry-operator/deployed/namespace.sls
- tests/post/features/sanity.feature — Missing the registry-operator Deployment in the sanity checks. Other operators (crl-operator, disk-management-agent, node-warden-operator) are all listed there.

Resolved since last review:

- Namespace mismatch between kustomization.yaml and init.sls/namespace.sls is now fixed (all consistent on metalk8s-registry-system).
- Image version in versions.py now matches kustomization.yaml (v0.0.1-alpha.4).

Review by Claude Code

@@ -0,0 +1,45 @@
include:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing explicit cert-manager dependency. The chart.sls deploys cert-manager resources (Certificate, Issuer, webhook cert-manager.io/inject-ca-from annotation), and .registry-certs creates additional Certificates and ClusterIssuers. Without cert-manager deployed first, the metalk8s_kubernetes renderer will fail because the Certificate/Issuer CRDs do not exist yet. Follow the pattern in crl-operator/deployed/init.sls: add - metalk8s.addons.cert-manager.deployed to the include list, then add a gate state that requires cert-manager and require_in the chart.

— Claude Code

@claude

claude Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor
  • Missing explicit cert-manager dependency in init.sls — chart.sls and registry-certs SLS files deploy cert-manager CRs (Certificate, Issuer, ClusterIssuer) that require cert-manager to be running. Follow the crl-operator/deployed/init.sls pattern: include cert-manager and gate the chart on it with an explicit requisite.
    - Add - metalk8s.addons.cert-manager.deployed to the include list and a require/require_in gate state.

    Prior comments on the wrong salt path in core.sls, nodeSelector at wrong YAML level in deploy_patch.yaml, and namespace consistency are still open in existing threads.

    Review by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Changelog check failed

This PR does not add a .changes/unreleased/*.yaml file and does not
modify CHANGELOG.md. Please add a changelog entry by commenting on
this PR:

/changie <kind> <body>

<kind> must be one of: Enhanced, Breaking, Fix, Added, Removed.

Example:

/changie Fix Corrected the deployment logic when running on ARM

If a changelog entry is not appropriate for this PR (e.g. CI-only or
docs-only change), apply the skip changelog label instead.

- .registry-certs
- .registry

Wait for Registry Operator to be Ready:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing namespace-before-resources ordering. Two gaps:
1. .namespace must run before .chart — chart.sls deploys ServiceAccount, Deployment, etc. into metalk8s-registry-system, but no requisite guarantees .namespace creates it first.
2. .registry-namespace must run before .registry-certsmtls.sls creates a Certificate in namespace metalk8s-registry, but nothing orders .registry-namespace before .registry-certs.

Without explicit gates, Salt may apply resources before the target namespace exists, causing API failures. Follow the disk-management-agent/deployed/init.sls pattern — add require/require_in states for each pair.

— Claude Code

@claude

claude Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor
  • Missing Salt namespace ordering in init.sls: no require/require_in gates ensure .namespace runs before .chart or .registry-namespace runs before .registry-certs, so Salt may apply resources to non-existent namespaces
    - Add explicit ordering states following the disk-management-agent/deployed/init.sls pattern
    - (Prior reviews) core.sls still references registry-operator instead of metalk8s-registry-operator, and deploy_patch.yaml still has nodeSelector at the wrong YAML level (spec.template.nodeSelector instead of spec.template.spec.nodeSelector)

    Review by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants