Skip to content

[kubernetes] show Service and Ingress resources for kubernetes app in… - #1912

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
feat/list-svc-and-ing-for-k8s-in-dashboard
Jan 26, 2026
Merged

Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
feat/list-svc-and-ing-for-k8s-in-dashboard

Conversation

@sircthulhu

@sircthulhu Kirill Ilin (sircthulhu) commented Jan 26, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Add labels and selectors for Service and Ingress resources to correctly show them in corresponding tabs for Kubernetes app in dashboard

Release note

[kubernetes] show Ingress and Service resources in dashboard

Summary by CodeRabbit

  • Chores
    • Introduced standardized metadata labels across Kubernetes application resources including cloud configuration, ingress, and service components to improve resource organization, tracking, identification, and multi-tenant environment management
    • Extended the system's resource management framework to include and manage additional Kubernetes infrastructure components, such as ingress-nginx, enhancing overall cluster orchestration and service networking capabilities

✏️ Tip: You can customize this high-level summary in your review settings.

@dosubot dosubot Bot added size/S This PR changes 10-29 lines, ignoring generated files kind/feature Categorizes issue or PR as related to a new feature labels Jan 26, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello Kirill Ilin (@sircthulhu), I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses the visibility of Kubernetes Service and Ingress resources within the dashboard for the Kubernetes application. By introducing standardized labels to these resources and updating the resource definition to correctly identify them, the changes ensure that users can now view and manage these critical networking components directly from the dashboard interface, enhancing the overall user experience and operational clarity.

Highlights

  • Application Labels for Cloud Config: Added infraLabels to the cloud-config.yaml for the Kubernetes application, ensuring proper identification and categorization within the system.
  • Ingress and Service Labeling: Applied consistent application and tenantresource labels to both Ingress and Service resources defined in ingress.yaml, which is crucial for their discoverability and display in the dashboard.
  • Resource Discovery Configuration Update: Updated the kubernetes-rd configuration to explicitly include the newly labeled Ingress and Service resources by name and label matching, making them discoverable by the dashboard and ensuring they are correctly listed.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@coderabbitai

coderabbitai Bot commented Jan 26, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds metadata labels for application identification and tenant resource marking across Kubernetes templates, and extends resource configuration to include nginx ingress components in the ApplicationDefinition wiring for Kubernetes resources.

Changes

Cohort / File(s) Summary
Label Additions in App Templates
packages/apps/kubernetes/templates/cloud-config.yaml, packages/apps/kubernetes/templates/ingress.yaml
Introduces four consistent labels across cloud-config and ingress resources: application group, kind, name (with release trimming), and tenant resource marker. Labels added to Ingress metadata, Service metadata, and cloud-config infraLabels block.
Resource Configuration Extension
packages/system/kubernetes-rd/cozyrds/kubernetes.yaml
Extends ApplicationDefinition wiring with nginx ingress resources, adding kubernetes-{{ .name }}-ingress-nginx to both services and ingresses resource includes, plus cluster label matching cluster.x-k8s.io/cluster-name.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With whiskers twitching, labels align,
Metadata organized, pristine and fine,
Tenants and clusters now proudly tagged,
Configuration neat, nothing left lagged!
~CodeRabbit celebrates the cleanup divine! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective of the changeset: adding labels and configuration to display Service and Ingress resources for the Kubernetes app in the dashboard.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request aims to make Service and Ingress resources for Kubernetes applications visible in the dashboard. This is achieved by adding identifying labels to the resources and updating the ApplicationDefinition to include them. While the changes appear to be functionally correct, I've identified a couple of areas where maintainability can be improved. Specifically, there's some duplication of labels that could be centralized into a Helm helper template, and the resource selection in the ApplicationDefinition could be made more robust by using label selectors instead of hardcoded resource names.

Comment on lines +17 to +21
labels:
apps.cozystack.io/application.group: apps.cozystack.io
apps.cozystack.io/application.kind: Kubernetes
apps.cozystack.io/application.name: {{ .Release.Name | trimPrefix "kubernetes-" }}
internal.cozystack.io/tenantresource: "true"

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.

medium

These labels are duplicated in multiple places: here for the Ingress, for the Service in this same file (lines 49-53), and in packages/apps/kubernetes/templates/cloud-config.yaml for infraLabels (lines 13-17).

To improve maintainability and prevent inconsistencies, I recommend defining these common labels in a helper template within _helpers.tpl.

For example, you could add a kubernetes.cozy.app.labels template:

{{- define "kubernetes.cozy.app.labels" -}}
apps.cozystack.io/application.group: apps.cozystack.io
apps.cozystack.io/application.kind: Kubernetes
apps.cozystack.io/application.name: {{ .Release.Name | trimPrefix "kubernetes-" }}
internal.cozystack.io/tenantresource: "true"
{{- end -}}

And then include it in your resources:

  labels:
{{- include "kubernetes.cozy.app.labels" . | nindent 4 }}

This would centralize the label definitions, making them easier to manage.

Comment on lines 37 to +48
include:
- resourceNames:
- kubernetes-{{ .name }}
- kubernetes-{{ .name }}-ingress-nginx
- matchLabels:
cluster.x-k8s.io/cluster-name: kubernetes-{{ .name }}
ingresses:
exclude: []
include:
- resourceNames:
- kubernetes-{{ .name }}
- kubernetes-{{ .name }}-ingress-nginx

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.

medium

Instead of hardcoding the resource name kubernetes-{{ .name }}-ingress-nginx, it's more robust and idiomatic in Kubernetes to use labels for resource selection. Since you're adding labels to the Service and Ingress resources, you can leverage them here for discovery. This makes the configuration more maintainable and less brittle to potential resource name changes.

I suggest using a matchLabels selector for the new application labels, for both services and ingresses, instead of extending the resourceNames list.

    include:
      - resourceNames:
          - kubernetes-{{ .name }}
      - matchLabels:
          cluster.x-k8s.io/cluster-name: kubernetes-{{ .name }}
      - matchLabels:
          apps.cozystack.io/application.group: apps.cozystack.io
          apps.cozystack.io/application.kind: Kubernetes
          apps.cozystack.io/application.name: {{ .name }}
  ingresses:
    exclude: []
    include:
      - resourceNames:
          - kubernetes-{{ .name }}
      - matchLabels:
          apps.cozystack.io/application.group: apps.cozystack.io
          apps.cozystack.io/application.kind: Kubernetes
          apps.cozystack.io/application.name: {{ .name }}

@kvaps Andrei Kvapil (kvaps) added the kind/backport Categorizes issue or PR as requiring a backport to the current release line label Jan 26, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jan 26, 2026
@kvaps
Andrei Kvapil (kvaps) merged commit 8f7a174 into main Jan 26, 2026
14 checks passed
@kvaps
Andrei Kvapil (kvaps) deleted the feat/list-svc-and-ing-for-k8s-in-dashboard branch January 26, 2026 17:34
@github-actions

Copy link
Copy Markdown

Andrei Kvapil (kvaps) added a commit that referenced this pull request Jan 26, 2026
…es for kubernetes app in… (#1915)

# Description
Backport of #1912 to `release-0.41`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/backport Categorizes issue or PR as requiring a backport to the current release line kind/feature Categorizes issue or PR as related to a new feature lgtm This PR has been approved by a maintainer size/S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants