-
Notifications
You must be signed in to change notification settings - Fork 15
Add support for v1 clusters for users, roles, topics, and schemas #1120
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
79c88f5
Add support for v1 clusters for users, roles, and schemas
andrewstucki ed700ab
Add topic controller watches and make initialization similar to other…
andrewstucki b03cd2d
Fix step references
andrewstucki 90c0f1f
Fix versioning
andrewstucki a4640ab
Merge branch 'main' of github.com:redpanda-data/redpanda-operator int…
andrewstucki 1b66104
swap to vectorized-based regex
andrewstucki 303f89e
Fix up features
andrewstucki 061aec4
Update cluster.yaml with proper name
andrewstucki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| apiVersion: redpanda.vectorized.io/v1alpha1 | ||
| kind: Cluster | ||
| metadata: | ||
| name: sasl | ||
| spec: | ||
| image: "redpandadata/redpanda" | ||
| version: "v25.2.1" | ||
| replicas: 1 | ||
| enableSasl: true | ||
| resources: | ||
| requests: | ||
| cpu: "100m" | ||
| memory: 256Mi | ||
| limits: | ||
| cpu: "100m" | ||
| memory: 256Mi | ||
| configuration: | ||
| rpcServer: | ||
| port: 33145 | ||
| kafkaApi: | ||
| - port: 9092 | ||
| adminApi: | ||
| - port: 9644 | ||
| developerMode: true | ||
| additionalCommandlineArguments: | ||
| dump-memory-diagnostics-on-alloc-failure-kind: all | ||
| abort-on-seastar-bad-alloc: '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| @cluster:vectorized/sasl | ||
| Feature: Vectorized Role CRDs | ||
| Background: Cluster available | ||
| Given vectorized cluster "sasl" is available | ||
|
|
||
| @skip:gke @skip:aks @skip:eks | ||
| Scenario: Manage vectorized roles | ||
| Given there is no role "admin-role" in vectorized cluster "sasl" | ||
| And there are the following pre-existing users in vectorized cluster "sasl" | ||
| | name | password | mechanism | | ||
| | alice | password | SCRAM-SHA-256 | | ||
| | bob | password | SCRAM-SHA-256 | | ||
| When I apply Kubernetes manifest: | ||
| """ | ||
| --- | ||
| apiVersion: cluster.redpanda.com/v1alpha2 | ||
| kind: Role | ||
| metadata: | ||
| name: admin-role | ||
| spec: | ||
| cluster: | ||
| clusterRef: | ||
| group: redpanda.vectorized.io | ||
| kind: Cluster | ||
| name: sasl | ||
| principals: | ||
| - User:alice | ||
| - User:bob | ||
| """ | ||
| And role "admin-role" is successfully synced | ||
| Then role "admin-role" should exist in vectorized cluster "sasl" | ||
| And role "admin-role" should have members "alice and bob" in vectorized cluster "sasl" | ||
|
|
||
| @skip:gke @skip:aks @skip:eks | ||
| Scenario: Manage vectorized roles with authorization | ||
| Given there is no role "read-only-role" in vectorized cluster "sasl" | ||
| And there are the following pre-existing users in vectorized cluster "sasl" | ||
| | name | password | mechanism | | ||
| | charlie | password | SCRAM-SHA-256 | | ||
| When I create topic "public-test" in vectorized cluster "sasl" | ||
| And I apply Kubernetes manifest: | ||
| """ | ||
| --- | ||
| apiVersion: cluster.redpanda.com/v1alpha2 | ||
| kind: Role | ||
| metadata: | ||
| name: read-only-role | ||
| spec: | ||
| cluster: | ||
| clusterRef: | ||
| group: redpanda.vectorized.io | ||
| kind: Cluster | ||
| name: sasl | ||
| principals: | ||
| - User:charlie | ||
| authorization: | ||
| acls: | ||
| - type: allow | ||
| resource: | ||
| type: topic | ||
| name: public- | ||
| patternType: prefixed | ||
| operations: [Read, Describe] | ||
| """ | ||
| And role "read-only-role" is successfully synced | ||
| Then role "read-only-role" should exist in vectorized cluster "sasl" | ||
| And role "read-only-role" should have ACLs for topic pattern "public-" in vectorized cluster "sasl" | ||
| And "charlie" should be able to read from topic "public-test" in vectorized cluster "sasl" | ||
|
|
||
| @skip:gke @skip:aks @skip:eks | ||
| Scenario: Manage vectorized authorization-only roles | ||
| Given there are the following pre-existing users in vectorized cluster "sasl" | ||
| | name | password | mechanism | | ||
| | travis | password | SCRAM-SHA-256 | | ||
| And there is a pre-existing role "travis-role" in vectorized cluster "sasl" | ||
| When I apply Kubernetes manifest: | ||
| """ | ||
| --- | ||
| apiVersion: cluster.redpanda.com/v1alpha2 | ||
| kind: Role | ||
| metadata: | ||
| name: travis-role | ||
| spec: | ||
| cluster: | ||
| clusterRef: | ||
| group: redpanda.vectorized.io | ||
| kind: Cluster | ||
| name: sasl | ||
| principals: | ||
| - User:travis | ||
| authorization: | ||
| acls: | ||
| - type: allow | ||
| resource: | ||
| type: topic | ||
| name: some-topic | ||
| patternType: prefixed | ||
| operations: [Read] | ||
| """ | ||
| And role "travis-role" is successfully synced | ||
| And I delete the CRD role "travis-role" | ||
| Then there should still be role "travis-role" in vectorized cluster "sasl" | ||
| And there should be no ACLs for role "travis-role" in vectorized cluster "sasl" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this step be replaced with Topic custom resource. I understand test should as much as possible test isolated features/changes, but I think acceptance test suite can combine more custom resources under test.