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

Add Kafka connector #784

Merged
merged 7 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion apis/installer/v1alpha1/kubedb_catalog_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ type PSP struct {
//+optional
Proxysql PSPProxysql `json:"proxysql"`
//+optional
Redis PSPRedis `json:"redis"` //+optional
Redis PSPRedis `json:"redis"`
//+optional
Kafka PSPKafka `json:"kafka"`
//+optional
KafkaConnector PSPKafkaConnector `json:"kafkaconnector"`
}

type PSPElasticsearch struct {
Expand Down Expand Up @@ -141,6 +144,11 @@ type PSPKafka struct {
Privileged bool `json:"privileged"`
}

type PSPKafkaConnector struct {
AllowPrivilegeEscalation bool `json:"allowPrivilegeEscalation"`
Privileged bool `json:"privileged"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// KubedbCatalogList is a list of KubedbCatalogs
Expand Down
17 changes: 17 additions & 0 deletions apis/installer/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions catalog/kubedb/active_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
"3.3.2",
"3.3.0"
],
"KafkaConnector": [
"s3-2.15.0",
"postgres-2.4.2.final",
"mysql-2.4.2.final",
"mongodb-1.11.0",
"gcs-0.13.0"
],
"MariaDB": [
"11.2.2",
"11.1.3",
Expand Down
5 changes: 5 additions & 0 deletions catalog/kubedb/fmt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ func main() {
panic(err)
}
}
} else if dbKind == "KafkaConnector" {
connectorType, _, _ := unstructured.NestedString(ri.Object.Object, "spec", "type")
if distro == "" {
distro = connectorType
}
}

dbVersion, _, err := unstructured.NestedString(ri.Object.Object, "spec", "version")
Expand Down
2 changes: 2 additions & 0 deletions catalog/kubedb/raw/kafka/kafka-3.3.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ kind: KafkaVersion
metadata:
name: 3.3.0
spec:
connectCluster:
image: ghcr.io/appscode-images/kafka-connect-cluster:3.3.2
cruiseControl:
image: ghcr.io/kubedb/cruise-control:3.3.0
db:
Expand Down
6 changes: 4 additions & 2 deletions catalog/kubedb/raw/kafka/kafka-3.3.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ kind: KafkaVersion
metadata:
name: 3.3.2
spec:
connectCluster:
image: ghcr.io/appscode-images/kafka-connect-cluster:3.3.2
cruiseControl:
image: ghcr.io/kubedb/cruise-control:3.3.2
image: ghcr.io/appscode-images/kafka-cruise-control:3.3.2
db:
image: ghcr.io/kubedb/kafka-kraft:3.3.2
image: ghcr.io/appscode-images/kafka-kraft:3.3.2
podSecurityPolicies:
databasePolicyName: kafka-db
securityContext:
Expand Down
2 changes: 2 additions & 0 deletions catalog/kubedb/raw/kafka/kafka-3.4.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ kind: KafkaVersion
metadata:
name: 3.4.0
spec:
connectCluster:
image: ghcr.io/appscode-images/kafka-connect-cluster:3.4.1
cruiseControl:
image: ghcr.io/kubedb/cruise-control:3.4.0
db:
Expand Down
6 changes: 4 additions & 2 deletions catalog/kubedb/raw/kafka/kafka-3.4.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ kind: KafkaVersion
metadata:
name: 3.4.1
spec:
connectCluster:
image: ghcr.io/appscode-images/kafka-connect-cluster:3.4.1
cruiseControl:
image: ghcr.io/kubedb/cruise-control:3.4.1
image: ghcr.io/appscode-images/kafka-cruise-control:3.4.1
db:
image: ghcr.io/kubedb/kafka-kraft:3.4.1
image: ghcr.io/appscode-images/kafka-kraft:3.4.1
podSecurityPolicies:
databasePolicyName: kafka-db
securityContext:
Expand Down
6 changes: 4 additions & 2 deletions catalog/kubedb/raw/kafka/kafka-3.5.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ kind: KafkaVersion
metadata:
name: 3.5.1
spec:
connectCluster:
image: ghcr.io/appscode-images/kafka-connect-cluster:3.5.1
cruiseControl:
image: ghcr.io/kubedb/cruise-control:3.5.1
image: ghcr.io/appscode-images/kafka-cruise-control:3.5.1
db:
image: ghcr.io/kubedb/kafka-kraft:3.5.1
image: ghcr.io/appscode-images/kafka-kraft:3.5.1
podSecurityPolicies:
databasePolicyName: kafka-db
securityContext:
Expand Down
6 changes: 4 additions & 2 deletions catalog/kubedb/raw/kafka/kafka-3.6.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ kind: KafkaVersion
metadata:
name: 3.6.0
spec:
connectCluster:
image: ghcr.io/appscode-images/kafka-connect-cluster:3.6.0
cruiseControl:
image: ghcr.io/kubedb/cruise-control:3.6.0
image: ghcr.io/appscode-images/kafka-cruise-control:3.6.0
db:
image: ghcr.io/kubedb/kafka-kraft:3.6.0
image: ghcr.io/appscode-images/kafka-kraft:3.6.0
podSecurityPolicies:
databasePolicyName: kafka-db
securityContext:
Expand Down
13 changes: 13 additions & 0 deletions catalog/kubedb/raw/kafkaconnector/kafkaconnector-0.13.0-gcs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: catalog.kubedb.com/v1alpha1
kind: KafkaConnectorVersion
metadata:
name: gcs-0.13.0
spec:
connectorPlugin:
image: ghcr.io/appscode-images/kafka-connector-gcs:0.13.0
podSecurityPolicies:
databasePolicyName: kafkaconnector
securityContext:
runAsUser: 1001
type: GCS
version: 0.13.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: catalog.kubedb.com/v1alpha1
kind: KafkaConnectorVersion
metadata:
name: mongodb-1.11.0
spec:
connectorPlugin:
image: ghcr.io/appscode-images/kafka-connector-mongodb:1.11.0
podSecurityPolicies:
databasePolicyName: kafkaconnector
securityContext:
runAsUser: 1001
type: MongoDB
version: 1.11.0
13 changes: 13 additions & 0 deletions catalog/kubedb/raw/kafkaconnector/kafkaconnector-2.15.0-s3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: catalog.kubedb.com/v1alpha1
kind: KafkaConnectorVersion
metadata:
name: s3-2.15.0
spec:
connectorPlugin:
image: ghcr.io/appscode-images/kafka-connector-s3:2.15.0
podSecurityPolicies:
databasePolicyName: kafkaconnector
securityContext:
runAsUser: 1001
type: S3
version: 2.15.0
13 changes: 13 additions & 0 deletions catalog/kubedb/raw/kafkaconnector/kafkaconnector-2.4.2-mysql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: catalog.kubedb.com/v1alpha1
kind: KafkaConnectorVersion
metadata:
name: mysql-2.4.2.final
spec:
connectorPlugin:
image: ghcr.io/appscode-images/kafka-connector-mysql:2.4.2.final
podSecurityPolicies:
databasePolicyName: kafkaconnector
securityContext:
runAsUser: 1001
type: MySQL
version: 2.4.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: catalog.kubedb.com/v1alpha1
kind: KafkaConnectorVersion
metadata:
name: postgres-2.4.2.final
spec:
connectorPlugin:
image: ghcr.io/appscode-images/kafka-connector-postgres:2.4.2.final
podSecurityPolicies:
databasePolicyName: kafkaconnector
securityContext:
runAsUser: 1001
type: Postgres
version: 2.4.2
20 changes: 20 additions & 0 deletions catalog/kubedb/raw/kafkaconnector/kafkaconnector-psp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: kafkaconnector
spec:
allowPrivilegeEscalation: false
fsGroup:
rule: RunAsAny
hostIPC: false
hostNetwork: false
hostPID: false
privileged: false
runAsUser:
rule: RunAsAny
seLinux:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
volumes:
- '*'
Loading
Loading