Skip to content

Update Kamaji to edge-25.4.1 - #953

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
upd-kamaji
May 17, 2025
Merged

Update Kamaji to edge-25.4.1#953
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
upd-kamaji

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented May 16, 2025

Copy link
Copy Markdown
Member

Signed-off-by: Andrei Kvapil kvapss@gmail.com

Summary by CodeRabbit

  • New Features

    • Added new validation rules to enforce stricter configuration requirements for datastore drivers and authentication fields.
    • Introduced a new field to specify stop signals for containers and a new status field to track terminating pods.
    • Added a new "Sleeping" status for version reporting.
  • Improvements

    • Updated and clarified field descriptions for environment variable sources, volume types, and deployment status.
    • Removed outdated beta feature gate notes from documentation.
  • Bug Fixes

    • Improved handling and validation of sensitive configuration fields based on driver type.
  • Chores

    • Updated Go base image and Kamaji version in the Dockerfile.
    • Changed Kamaji image tag to use the latest version.
  • Refactor

    • Moved imagePullSecrets configuration from the deployment to the ServiceAccount manifest for better management.

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@coderabbitai

coderabbitai Bot commented May 16, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This update enhances Kamaji's Kubernetes CRDs with stricter OpenAPI validation rules, new descriptive fields, and additional deployment status tracking. Helm templates are revised to shift imagePullSecrets configuration from the controller Deployment to the ServiceAccount. The Kamaji Dockerfile and image tag are updated to newer versions for both Go and the Kamaji component.

Changes

File(s) Change Summary
.../kamaji/crds/kamaji.clastix.io_datastores.yaml Added OpenAPI v3 validation rules to DataStore CRD: made driver immutable and enforced conditional presence/content of tlsConfig and basicAuth fields based on driver value.
.../kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml Updated CRD descriptions, added stopSignal field for container lifecycle, introduced terminatingReplicas status field, extended version status enum with "Sleeping", clarified field descriptions, and removed beta feature gate notes.
.../kamaji/templates/controller.yaml Removed conditional rendering of imagePullSecrets from the controller Deployment pod spec.
.../kamaji/templates/rbac.yaml Added conditional rendering of imagePullSecrets to the ServiceAccount manifest in the Helm template.
.../kamaji/images/kamaji/Dockerfile Updated base Go image from golang:1.23 to golang:1.24 and changed Kamaji build argument VERSION from edge-25.3.2 to edge-25.4.1.
.../kamaji/values.yaml Updated Kamaji image tag from a specific release candidate to latest with a new SHA256 digest.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Helm
    participant Kubernetes API
    participant Kamaji Controller

    User->>Helm: Install/upgrade Kamaji chart
    Helm->>Kubernetes API: Apply CRDs (with new validations)
    Helm->>Kubernetes API: Deploy ServiceAccount (with imagePullSecrets if set)
    Helm->>Kubernetes API: Deploy Controller (no imagePullSecrets in pod spec)
    Kubernetes API->>Kamaji Controller: Enforce new CRD schema and status fields
Loading

Poem

In the warren where YAMLs hop and play,
New rules for secrets now hold sway.
With Go refreshed and tags anew,
The pods report what they now do.
A signal for stopping, a status for sleep—
Kamaji’s changes run robust and deep!
🐇✨

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@lllamnyp Timofei Larkin (lllamnyp) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

♻️ Duplicate comments (2)
packages/system/kamaji/charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml (2)

1821-1821: Duplicate: Add validation pattern for C_IDENTIFIER on prefix
Same suggestion as above to enforce the C_IDENTIFIER constraint via a regex.


2070-2075: Duplicate: Enforce feature gate for stopSignal
Apply the same feature-gate annotation in this section to avoid schema errors on clusters without the alpha flag.

🧹 Nitpick comments (6)
packages/system/kamaji/values.yaml (1)

6-6: Use explicit versioned tag instead of latest for reproducibility
Using the latest tag can lead to non-deterministic deployments. Consider pinning to a specific version—e.g. edge-25.4.1@sha256:…—to ensure consistent image pulls across environments.

packages/system/kamaji/images/kamaji/Dockerfile (1)

2-2: Go base image bump to 1.24
Upgrading to golang:1.24 aligns the build with the latest Go toolchain. For immutability and security, consider pinning to an image digest or explicit variant (e.g., golang:1.24@sha256:…).

packages/system/kamaji/charts/kamaji/crds/kamaji.clastix.io_datastores.yaml (1)

269-283: Add CEL validations for driver-specific TLS and auth
The new x-kubernetes-validations block enforces:

  • For etcd: mandatory TLS fields (CA, client cert, private key).
  • For non-etcd: require at least one of tlsConfig or basicAuth with valid content.
    These rules harden the schema against misconfigurations. Optionally, you could add a rule to explicitly forbid basicAuth when driver == "etcd" for clarity.
packages/system/kamaji/charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml (3)

450-450: Add validation pattern for C_IDENTIFIER on prefix
To enforce the C_IDENTIFIER constraint, add a regex pattern so invalid prefixes are rejected at validation time.

 prefix:
   description: Optional text to prepend to the name of each environment variable. Must be a C_IDENTIFIER.
+  pattern: '^[A-Za-z_][A-Za-z0-9_]*$'
   type: string

4102-4102: Clarify K8s subPath terminology
The term “sub path” should match the field name subPath for consistency with API docs.

- Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33.
+ 'subPath' mounts for containers are not supported (spec.containers[*].volumeMounts.subPath) before 1.33.

7392-7392: Consider ordering enum values alphabetically or by lifecycle
Reordering the status values (e.g., Ready, NotReady, Migrating, Sleeping) can improve readability and maintenance.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between c42a502 and 4ecf492.

📒 Files selected for processing (6)
  • packages/system/kamaji/charts/kamaji/crds/kamaji.clastix.io_datastores.yaml (2 hunks)
  • packages/system/kamaji/charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml (11 hunks)
  • packages/system/kamaji/charts/kamaji/templates/controller.yaml (0 hunks)
  • packages/system/kamaji/charts/kamaji/templates/rbac.yaml (1 hunks)
  • packages/system/kamaji/images/kamaji/Dockerfile (1 hunks)
  • packages/system/kamaji/values.yaml (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/system/kamaji/charts/kamaji/templates/controller.yaml
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and Test
🔇 Additional comments (7)
packages/system/kamaji/charts/kamaji/templates/rbac.yaml (1)

12-15: Conditional imagePullSecrets for ServiceAccount
The new block correctly renders .Values.imagePullSecrets only when defined, shifting imagePullSecrets configuration from the controller pod spec to the ServiceAccount. Indentation and placement align with the Kubernetes ServiceAccount schema.

packages/system/kamaji/images/kamaji/Dockerfile (1)

4-4: Update build ARG VERSION to edge-25.4.1
Pointing the build to edge-25.4.1 ensures the correct GitHub tag is fetched and built, matching the Helm chart and values updates.

packages/system/kamaji/charts/kamaji/crds/kamaji.clastix.io_datastores.yaml (1)

123-125: Enforce driver field immutability
The added CEL validation self == oldSelf prevents changes to the driver after creation. Verify that target clusters run Kubernetes ≥1.25 so that x-kubernetes-validations CEL rules are supported.

packages/system/kamaji/charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml (4)

430-430: Approve addition of EnvFromSource description
Adding a concise description for EnvFromSource improves discoverability and aligns with other CRD schemas.


1801-1801: Approve addition of EnvFromSource description (infra context)
Consistent with the upper section, this description clarifies the source of ConfigMaps and Secrets.


7076-7076: Approve enhanced description for availableReplicas
This clarifies the metric being reported and matches Kubernetes terminology.


7160-7160: Approve enhanced description for updatedReplicas
The new wording clearly describes the meaning of updatedReplicas.

Comment on lines +699 to +704
stopSignal:
description: |-
StopSignal defines which signal will be sent to a container when it is being stopped.
If not specified, the default is defined by the container runtime in use.
StopSignal can only be set for Pods with a non-empty .spec.os.name
type: string

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.

🛠️ Refactor suggestion

Enforce feature gate for stopSignal
Since stopSignal is an alpha feature, include the Kubernetes feature gate annotation to prevent schema validation failures on clusters without it.

 stopSignal:
   description: |-
     StopSignal defines which signal will be sent to a container when it is being stopped.
   type: string
+  x-kubernetes-feature-gate: PodStopSignal
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
stopSignal:
description: |-
StopSignal defines which signal will be sent to a container when it is being stopped.
If not specified, the default is defined by the container runtime in use.
StopSignal can only be set for Pods with a non-empty .spec.os.name
type: string
stopSignal:
description: |-
StopSignal defines which signal will be sent to a container when it is being stopped.
If not specified, the default is defined by the container runtime in use.
StopSignal can only be set for Pods with a non-empty .spec.os.name
type: string
x-kubernetes-feature-gate: PodStopSignal
🤖 Prompt for AI Agents
In
packages/system/kamaji/charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml
around lines 699 to 704, the stopSignal field is an alpha feature and requires a
Kubernetes feature gate annotation to avoid schema validation errors on clusters
where the feature is disabled. Add the appropriate feature gate annotation
(e.g., kubernetes.io/feature-gates: "StopSignal=true") to the stopSignal field
definition to enforce this requirement.

Comment on lines +7144 to +7151
terminatingReplicas:
description: |-
Total number of terminating pods targeted by this deployment. Terminating pods have a non-null
.metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.

This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.
format: int32
type: integer

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.

🛠️ Refactor suggestion

Add feature gate for terminatingReplicas
This field is alpha and requires the cluster feature gate; annotate it accordingly to avoid validation issues.

 terminatingReplicas:
   description: |-
     Total number of terminating pods targeted by this deployment. Terminating pods have a non-null
     .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.
     This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.
   format: int32
   type: integer
+  x-kubernetes-feature-gate: DeploymentReplicaSetTerminatingReplicas
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
terminatingReplicas:
description: |-
Total number of terminating pods targeted by this deployment. Terminating pods have a non-null
.metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.
This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.
format: int32
type: integer
terminatingReplicas:
description: |-
Total number of terminating pods targeted by this deployment. Terminating pods have a non-null
.metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.
This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.
format: int32
type: integer
x-kubernetes-feature-gate: DeploymentReplicaSetTerminatingReplicas
🤖 Prompt for AI Agents
In
packages/system/kamaji/charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml
around lines 7144 to 7151, the terminatingReplicas field is alpha and requires
the DeploymentReplicaSetTerminatingReplicas feature gate. Add the appropriate
feature gate annotation to this field's schema to indicate it is gated, ensuring
validation tools recognize the requirement and avoid errors.

@kvaps
Andrei Kvapil (kvaps) merged commit 5273722 into main May 17, 2025
@kvaps
Andrei Kvapil (kvaps) deleted the upd-kamaji branch May 17, 2025 10:13
Timofei Larkin (lllamnyp) pushed a commit that referenced this pull request May 20, 2025
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Added new validation rules to enforce stricter configuration
requirements for datastore drivers and authentication fields.
- Introduced a new field to specify stop signals for containers and a
new status field to track terminating pods.
  - Added a new "Sleeping" status for version reporting.

- **Improvements**
- Updated and clarified field descriptions for environment variable
sources, volume types, and deployment status.
  - Removed outdated beta feature gate notes from documentation.

- **Bug Fixes**
- Improved handling and validation of sensitive configuration fields
based on driver type.

- **Chores**
  - Updated Go base image and Kamaji version in the Dockerfile.
  - Changed Kamaji image tag to use the latest version.

- **Refactor**
- Moved imagePullSecrets configuration from the deployment to the
ServiceAccount manifest for better management.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit 5273722)
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
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