Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable maester by default #687

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

kenankule
Copy link
Contributor

@kenankule kenankule commented May 23, 2024

This patch changes the default value maester.enabled to false. If the user would like to manage the rules with the maester controller, maester.enabled should be set to true and managedAccessRules should be set to false

Related Issue or Design Document

Fixes #512

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
    If this pull request addresses a security vulnerability,
    I confirm that I got approval (please contact security@ory.sh) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

Further comments

Tested with the following configurations:

1- The user would like to manage rules manually. In this configuration the rules configmap and the initContainer to fix the permissions are not added to the deployment. rules volume is an emptydir:

oathkeeper:
  managedAccessRules: false
maester:
  enabled: false

2- The rules are managed by the helm chart oathkeeper.accessRules value. Rules configmap is created but the initContainer is not added to the deployment.

oathkeeper:
  managedAccessRules: true
maester:
  enabled: false

3- The rules are managed by the maester. Rules configmap is created by the maester chart and the volume name in the oathkeeper deployment is aligned with the maester chart. initContainer is not added to the deployment.

oathkeeper:
  managedAccessRules: false
maester:
  enabled: true

4- Invalid configuration so the helm chart rendering fails with an error message.

oathkeeper:
  managedAccessRules: true
maester:
  enabled: true

I believe the first configuration (where the chart creates an emptydir volume) should be replaced with a configuration where the chart gets an existing configmap name and uses that instead.

@CLAassistant
Copy link

CLAassistant commented May 23, 2024

CLA assistant check
All committers have signed the CLA.

@kenankule kenankule force-pushed the kk-fix-maester-rules-cm branch from f24a17b to 9fab8cc Compare May 23, 2024 23:22
@eroznik
Copy link

eroznik commented Aug 21, 2024

Any info on this one? Whats the hold up? 🤔
AFAIK, without this we're not able to use the chart as is - there is no way to make the Oathkeeper chart not create "empty rules" but still using the config map created by Maester ..

edit: relates to #669

@kenankule
Copy link
Contributor Author

I've created this fix only for a PoC and we're not using the chart or the product anymore. I'd be happy if the maintainers take the ownership of this changeset.

@Demonsthere
Copy link
Collaborator

Hi there!
The issue with this change is that it changes the default behaviour for people who do not use the maester controller, which we consider an addon. If we could provide the same function without changing the default behaviour (as still, most people use oathkeeper standalone, without the controller) i would be more than happy to merge this :)

@kenankule
Copy link
Contributor Author

I think that (change in the default behavior) can be avoided if I set

managedAccessRules: true
maester:
  enabled: false

in the default values of the chart. Should I go ahead and change the defaults so that the change is somewhat backwards compatible? The only case it is not is when both of these values are set to true which I believe should not happen. There is even a comment in the values file about this.

@Demonsthere
Copy link
Collaborator

@kenankule yes please :) I think it even would make sense to add a check for this case (both are set to true) and fail the installation with an error message when that happens.

- Disable maester by default. Currently both maester and
  managedAccessRules are enabled and these two settings are contradicting with
each other.

- Fail if both managedAccessRules and maester are enabled.

- Align rules configmap name with the maester if the maester is enabled.
@kenankule kenankule force-pushed the kk-fix-maester-rules-cm branch from 9fab8cc to 6788f47 Compare August 22, 2024 11:44
@kenankule kenankule changed the title fix!: use maester rules by default fix: disable maester by default Aug 22, 2024
@kenankule
Copy link
Contributor Author

I've changed the defaults, rebased the branch and pushed. Also edited the changeset description.

The validation you've requested is already implemented :

{{- fail "Both `managedAccessRules` and `maester.enabled` cannot be set to true at the same time" }}

@Demonsthere Demonsthere merged commit defbd62 into ory:master Aug 22, 2024
15 checks passed
@eroznik
Copy link

eroznik commented Aug 22, 2024

@Demonsthere any ETA for the next release? :))

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.

Configmap Names for AccessRules are misaligned between oathkeeper and oathkeeper-maester
4 participants