-
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.
DBZ-6738 Suport for watching all namespaces with OLM installation
- Loading branch information
Showing
9 changed files
with
185 additions
and
27 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
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
81 changes: 81 additions & 0 deletions
81
src/main/java/io/debezium/operator/DebeziumCsvMetadata.java
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,81 @@ | ||
/* | ||
* Copyright Debezium Authors. | ||
* | ||
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package io.debezium.operator; | ||
|
||
import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata; | ||
import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata.Annotations; | ||
import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata.Icon; | ||
import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata.InstallMode; | ||
import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata.Link; | ||
import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata.Maintainer; | ||
import io.quarkiverse.operatorsdk.bundle.runtime.CSVMetadata.Provider; | ||
import io.quarkiverse.operatorsdk.bundle.runtime.SharedCSVMetadata; | ||
|
||
// @formatter:off | ||
@CSVMetadata( | ||
name = "debezium-operator", | ||
displayName = "Debezium Operator", | ||
version = "DBZOP_NEXT", replaces = "DBZOP_REPLACES", | ||
icon = @Icon(fileName = "debezium-icon.svg"), | ||
provider = @Provider(name = "Debezium Authors", url = "https://debezium.io/"), | ||
maintainers = @Maintainer(name = "Debezium Authors", email = "[email protected]"), | ||
keywords = { | ||
"Debezium", | ||
"CDC", | ||
"Data", | ||
"Streaming"}, | ||
links = { | ||
@Link(url = "https://debezium.io/", name = "Debezium"), | ||
@Link(url = "https://debezium.io/documentation/reference/stable/", name = "Documentation"), | ||
@Link(url = "debezium.zulipchat.com", name = "Debezium Zulip Chat")}, | ||
installModes = { | ||
@InstallMode(type = "OwnNamespace"), | ||
@InstallMode(type = "SingleNamespace"), | ||
@InstallMode(type = "AllNamespaces"), | ||
@InstallMode(type = "MultiNamespace")}, | ||
annotations = @Annotations( | ||
capabilities = "Basic Install", | ||
categories = "Big Data, Database, Integration & Delivery, Streaming & Messaging", | ||
containerImage = "DBZOP_IMAGE_PULL_URL:DBZOP_NEXT", | ||
others = { | ||
@Annotations.Annotation( | ||
name = "support", | ||
value = "Debezium Authors"), | ||
@Annotations.Annotation( | ||
name = "description", | ||
value = "An Operator for installing and managing Debezium")}, | ||
almExamples =""" | ||
[ | ||
{ | ||
apiVersion: debezium.io/v1alpha1 | ||
kind: DebeziumServer | ||
metadata: | ||
name: debezium-test | ||
spec: | ||
quarkus: | ||
config: | ||
log.console.json: false | ||
sink: | ||
type: kafka | ||
config: | ||
producer.bootstrap.servers: dbz-kafka-kafka-bootstrap.debezium:9092 | ||
producer.key.serializer: org.apache.kafka.common.serialization.StringSerializer | ||
producer.value.serializer: org.apache.kafka.common.serialization.StringSerializer | ||
source: | ||
class: io.debezium.connector.mongodb.MongoDbConnector | ||
config: | ||
topic.prefix: dbserver1 | ||
offset.storage.file.filename: /debezium/data/offsets.dat | ||
database.history: io.debezium.relational.history.FileDatabaseHistory | ||
mongodb.connection.string: mongodb://debezium:[email protected]:27017/?replicaSet=rs0 | ||
} | ||
] | ||
"""), | ||
description = "Debezium is an open source distributed platform for change data capture. " + | ||
"Start it up, point it at your databases, and your apps can start responding " + | ||
"to all of the inserts, updates, and deletes that other apps commit to your databases") | ||
public class DebeziumCsvMetadata implements SharedCSVMetadata { | ||
} |
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
38 changes: 38 additions & 0 deletions
38
src/main/java/io/debezium/operator/dependent/RoleDependent.java
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,38 @@ | ||
/* | ||
* Copyright Debezium Authors. | ||
* | ||
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package io.debezium.operator.dependent; | ||
|
||
import io.debezium.operator.DebeziumServer; | ||
import io.fabric8.kubernetes.api.model.ObjectMetaBuilder; | ||
import io.fabric8.kubernetes.api.model.rbac.PolicyRuleBuilder; | ||
import io.fabric8.kubernetes.api.model.rbac.Role; | ||
import io.fabric8.kubernetes.api.model.rbac.RoleBuilder; | ||
import io.javaoperatorsdk.operator.api.reconciler.Context; | ||
import io.javaoperatorsdk.operator.processing.dependent.kubernetes.CRUDKubernetesDependentResource; | ||
|
||
public class RoleDependent | ||
extends CRUDKubernetesDependentResource<Role, DebeziumServer> { | ||
public static final String ROLE_NAME = "%s-config-view"; | ||
|
||
public RoleDependent() { | ||
super(Role.class); | ||
} | ||
|
||
@Override | ||
protected Role desired(DebeziumServer primary, Context<DebeziumServer> context) { | ||
return new RoleBuilder() | ||
.withMetadata(new ObjectMetaBuilder() | ||
.withName(ROLE_NAME.formatted(primary.getMetadata().getName())) | ||
.withNamespace(primary.getMetadata().getNamespace()) | ||
.build()) | ||
.withRules(new PolicyRuleBuilder() | ||
.withApiGroups("") | ||
.withResources("secrets", "configmaps") | ||
.withVerbs("get", "list", "watch") | ||
.build()) | ||
.build(); | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.