Skip to content

Remove unnecessary allow-to-keycloak policy - #512

Merged
Andrei Kvapil (kvaps) merged 2 commits into
cozystack:mainfrom
klinch0:bugfix/del-trash
Dec 5, 2024
Merged

Andrei Kvapil (kvaps) merged 2 commits into
cozystack:mainfrom
klinch0:bugfix/del-trash

Conversation

@klinch0

@klinch0 klinch0 commented Dec 5, 2024 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Enhanced Keycloak client configuration with new secrets for k8s-client, kubeapps-client, and kubeapps-auth-config.
    • Introduced new ClusterKeycloak and ClusterKeycloakRealm resources for improved management.
    • Updated Keycloak client scopes with additional attributes and protocol mappers.
    • Added multiple CiliumNetworkPolicy and CiliumClusterwideNetworkPolicy configurations for better traffic control.
  • Improvements

    • Logic added to check for existing Kubernetes secrets and generate new ones as needed, ensuring seamless configuration management.
    • Enhanced network policies to provide comprehensive control over ingress and egress traffic for various services within the tenant's namespace.

@dosubot dosubot Bot added the size/XS This PR changes 0-9 lines, ignoring generated files label Dec 5, 2024
@coderabbitai

coderabbitai Bot commented Dec 5, 2024 •

Copy link
Copy Markdown
Contributor

Walkthrough

The changes in this pull request focus on the configuration of Keycloak clients and their associated secrets within the configure-kk.yaml file. New logic has been introduced to manage existing Kubernetes secrets and to generate new secrets when necessary. Several new Kubernetes resources, including Secret, ClusterKeycloak, ClusterKeycloakRealm, KeycloakClient, and KeycloakClientScope, have been defined or updated to enhance the management of Keycloak configurations and ensure proper handling of credentials. Additionally, the networkpolicy.yaml file has been updated to introduce new Cilium network policies for managing traffic flow within the tenant's namespace.

Changes

File Path Change Summary
packages/system/keycloak-configure/templates/configure-kk.yaml - Added new Secrets: k8s-client, kubeapps-client, kubeapps-auth-config.
- Added new ClusterKeycloak: keycloak-cozy.
- Added new ClusterKeycloakRealm: keycloakrealm-cozy.
- Added new KeycloakClientScope: keycloakclientscope-cozy, kubernetes-client.
- Added new KeycloakClients: keycloakclient, kubeapps-client.
- Added new ConfigMap: kubeapps-auth-config.
- Added new KeycloakRealmGroup: kubeapps-admin.
packages/apps/tenant/templates/networkpolicy.yaml - Added multiple CiliumNetworkPolicy and CiliumClusterwideNetworkPolicy configurations for traffic management.
- New policies include: allow-internal-communication, allow-external-communication, egress and ingress policies based on tenant namespace.
- Removed the previous allow-to-keycloak policy.

Possibly related PRs

  • fix keycloak-configure secrets drift #506: The changes in this PR directly relate to the management of Kubernetes secrets for k8s-client, kubeapps-client, and cookieSecret, which are also modified in the main PR to enhance the handling of Keycloak client configurations and secrets.

Suggested reviewers

  • kvaps

🐰 In the garden, secrets grow,
With Keycloak's help, they surely flow.
Clients and realms, all in a row,
Kubernetes whispers, "Let it show!"
New configs bloom, a vibrant show,
Hopping along, we watch them glow! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1b0f016 and 5b48111.

📒 Files selected for processing (1)
  • packages/apps/tenant/templates/networkpolicy.yaml (0 hunks)
💤 Files with no reviewable changes (1)
  • packages/apps/tenant/templates/networkpolicy.yaml

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

@dosubot dosubot Bot added size/S This PR changes 10-29 lines, ignoring generated files and removed size/XS This PR changes 0-9 lines, ignoring generated files labels Dec 5, 2024
@kvaps Andrei Kvapil (kvaps) changed the title del trash Remove unnecessary allow-to-keycloak policy Dec 5, 2024

@kvaps Andrei Kvapil (kvaps) 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

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Dec 5, 2024
@kvaps
Andrei Kvapil (kvaps) merged commit b7a51ba into cozystack:main Dec 5, 2024
klinch0 added a commit to klinch0/cozystack that referenced this pull request Dec 5, 2024
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced Keycloak client configuration with new secrets for
`k8s-client`, `kubeapps-client`, and `kubeapps-auth-config`.
- Introduced new `ClusterKeycloak` and `ClusterKeycloakRealm` resources
for improved management.
- Updated Keycloak client scopes with additional attributes and protocol
mappers.
- Added multiple CiliumNetworkPolicy and CiliumClusterwideNetworkPolicy
configurations for better traffic control.

- **Improvements**
- Logic added to check for existing Kubernetes secrets and generate new
ones as needed, ensuring seamless configuration management.
- Enhanced network policies to provide comprehensive control over
ingress and egress traffic for various services within the tenant's
namespace.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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