-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable adapters to specify read vs write resources (#33)
* Add !mermaid command * Add read/write Resources and Kafka ACL controller * Add insert-into syntax to yaml and mermaid commands * Tweak Acl CRD * Fix ACL template * License select files under Apache 2 * Ignore case for CLI commands, h/t @hshukla * Javadocs on public Resources, h/t @hshukla
- Loading branch information
1 parent
c064a16
commit da4bdb0
Showing
42 changed files
with
1,474 additions
and
140 deletions.
There are no files selected for viewing
This file contains 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 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,105 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: acls.hoptimator.linkedin.com | ||
spec: | ||
group: hoptimator.linkedin.com | ||
names: | ||
kind: Acl | ||
listKind: AclList | ||
plural: acls | ||
singular: acl | ||
shortNames: | ||
- acl | ||
preserveUnknownFields: false | ||
scope: Namespaced | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true | ||
schema: | ||
openAPIV3Schema: | ||
description: Access control rule (colloquially, an Acl) | ||
type: object | ||
properties: | ||
apiVersion: | ||
type: string | ||
kind: | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: A set of related ACL rules. | ||
type: object | ||
properties: | ||
resource: | ||
description: The resource being controlled. | ||
type: object | ||
properties: | ||
kind: | ||
description: The kind of resource being controlled. | ||
type: string | ||
name: | ||
description: The name of the resource being controlled. | ||
type: string | ||
method: | ||
description: The resource access method. | ||
type: string | ||
enum: | ||
- Alter | ||
- Create | ||
- Delete | ||
- Describe | ||
- Read | ||
- Write | ||
- Post | ||
- Put | ||
- Get | ||
- Head | ||
- Patch | ||
- Trace | ||
- Options | ||
- GetAll | ||
- BatchGet | ||
- BatchCreate | ||
- BatchUpdate | ||
- PartialUpdate | ||
- BatchDelete | ||
- BatchPartialDelete | ||
principal: | ||
description: The principal being allowed access. Format depends on principal type. | ||
type: string | ||
required: | ||
- resource | ||
- method | ||
- principal | ||
status: | ||
description: Status, as set by the operator. | ||
type: object | ||
properties: | ||
ready: | ||
description: Whether the ACL rule has been applied. | ||
type: boolean | ||
message: | ||
description: Human-readable status message. | ||
type: string | ||
subresources: | ||
status: {} | ||
additionalPrinterColumns: | ||
- name: PRINCIPAL | ||
type: string | ||
description: A user, service, group, etc. | ||
jsonPath: .spec.principal | ||
- name: METHOD | ||
type: string | ||
description: A resource access method, e.g. Get. | ||
jsonPath: .spec.method | ||
- name: KIND | ||
type: string | ||
description: The resource being accessed. | ||
jsonPath: .spec.resource.kind | ||
- name: RESOURCE | ||
type: string | ||
description: The resource being accessed. | ||
jsonPath: .spec.resource.name | ||
|
This file contains 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,52 @@ | ||
# Copyright (c) 2023, LinkedIn | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Based on examples at: | ||
# https://github.com/strimzi/strimzi-kafka-operator/blob/main/examples/kafka | ||
|
||
|
||
apiVersion: kafka.strimzi.io/v1beta2 | ||
kind: Kafka | ||
metadata: | ||
name: one | ||
namespace: kafka | ||
spec: | ||
kafka: | ||
version: 3.4.0 | ||
replicas: 1 | ||
listeners: | ||
- name: plain | ||
port: 9092 | ||
type: internal | ||
tls: false | ||
- name: tls | ||
port: 9093 | ||
type: internal | ||
tls: true | ||
config: | ||
offsets.topic.replication.factor: 1 | ||
transaction.state.log.replication.factor: 1 | ||
transaction.state.log.min.isr: 1 | ||
default.replication.factor: 1 | ||
min.insync.replicas: 1 | ||
inter.broker.protocol.version: "3.4" | ||
allow.everyone.if.no.acl.found: true | ||
storage: | ||
type: ephemeral | ||
authorization: | ||
type: simple | ||
zookeeper: | ||
replicas: 3 | ||
storage: | ||
type: ephemeral |
This file contains 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 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 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,24 @@ | ||
apiVersion: hoptimator.linkedin.com/v1alpha1 | ||
kind: Acl | ||
metadata: | ||
name: sample-kafka-acl-1 | ||
spec: | ||
resource: | ||
kind: KafkaTopic | ||
name: test-sink | ||
method: Read | ||
principal: User:ANONYMOUS | ||
|
||
--- | ||
|
||
apiVersion: hoptimator.linkedin.com/v1alpha1 | ||
kind: Acl | ||
metadata: | ||
name: sample-kafka-acl-2 | ||
spec: | ||
resource: | ||
kind: KafkaTopic | ||
name: test-sink | ||
method: Write | ||
principal: User:ANONYMOUS | ||
|
This file contains 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 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 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 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 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.