Skip to content

Commit

Permalink
Remove managed kafka ephemeral mode (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
psav authored Jun 14, 2023
1 parent 49c8b4a commit 25cea61
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 1,243 deletions.
7 changes: 0 additions & 7 deletions apis/cloud.redhat.com/v1alpha1/clowdenvironment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,6 @@ type KafkaConfig struct {
// Managed topic prefix for the managed cluster. Only used in (*_managed_*) mode.
ManagedPrefix string `json:"managedPrefix,omitempty"`

// Defines the secret reference for the Ephemeral Managed Kafka mode. Only used in (*_managed-ephem_*) mode.
EphemManagedSecretRef NamespacedName `json:"ephemManagedSecretRef,omitempty"`

// Deprecated: topics being deleted will be done so using the env name and a regex that combines - with .
// There is also a clowder top level setting to ensure that only certain topics can be deleted.
EphemManagedDeletePrefix string `json:"ephemManagedDeletePrefix,omitempty"`

// (Deprecated) Defines the cluster name to be used by the Kafka Provider this will
// be used in some modes to locate the Kafka instance.
ClusterName string `json:"clusterName,omitempty"`
Expand Down
1 change: 0 additions & 1 deletion apis/cloud.redhat.com/v1alpha1/zz_generated.deepcopy.go

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

20 changes: 0 additions & 20 deletions config/crd/bases/cloud.redhat.com_clowdenvironments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -313,26 +313,6 @@ spec:
enableLegacyStrimzi:
description: EnableLegacyStrimzi disables TLS + user auth
type: boolean
ephemManagedDeletePrefix:
description: 'Deprecated: topics being deleted will be done
so using the env name and a regex that combines - with .
There is also a clowder top level setting to ensure that
only certain topics can be deleted.'
type: string
ephemManagedSecretRef:
description: Defines the secret reference for the Ephemeral
Managed Kafka mode. Only used in (*_managed-ephem_*) mode.
properties:
name:
description: Name defines the Name of a resource.
type: string
namespace:
description: Namespace defines the Namespace of a resource.
type: string
required:
- name
- namespace
type: object
managedPrefix:
description: Managed topic prefix for the managed cluster.
Only used in (*_managed_*) mode.
Expand Down
38 changes: 0 additions & 38 deletions controllers/cloud.redhat.com/providers/kafka/cyndi.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package kafka
import (
"context"
"fmt"
"strconv"

crd "github.com/RedHatInsights/clowder/apis/cloud.redhat.com/v1alpha1"
"github.com/RedHatInsights/clowder/controllers/cloud.redhat.com/errors"
Expand Down Expand Up @@ -280,40 +279,3 @@ func createCyndiInventoryDbSecret(

return secretName, nil
}

// create a configmap to tweak the connector config for CyndiPipelines created in a specific namespace
// at the moment this function is only called when the kafka provider mode is 'managed-ephem'
func createCyndiConfigMap(
s prov.RootProvider,
connectClusterNamespace string,
) error {
// TODO: as a followup, make these topic names configurable
eventsTopic := fmt.Sprintf("%s-platform.inventory.events", s.GetEnv().Name)
deadLetterQueueTopic := fmt.Sprintf("%s-platform.cyndi.dlq", s.GetEnv().Name)
replicationFactor := 3

nn := types.NamespacedName{
Namespace: connectClusterNamespace,
Name: "cyndi",
}

cm := &core.ConfigMap{}

if err := s.GetCache().Create(CyndiConfigMap, nn, cm); err != nil {
return err
}

cm.Data = map[string]string{
"connector.topic": eventsTopic,
"connector.deadletterqueue.topic.name": deadLetterQueueTopic,
"connector.topic.replication.factor": strconv.Itoa(replicationFactor),
}

cm.SetName(nn.Name)
cm.SetNamespace(nn.Namespace)
// it would be best for the ClowdApp to own this, but since cross-namespace OwnerReferences
// are not permitted, make this owned by the ClowdEnvironment
cm.SetOwnerReferences([]metav1.OwnerReference{s.GetEnv().MakeOwnerReference()})

return s.GetCache().Update(CyndiConfigMap, cm)
}
Loading

0 comments on commit 25cea61

Please sign in to comment.