Class KafkaResources

java.lang.Object
io.strimzi.api.kafka.model.kafka.KafkaResources

public class KafkaResources extends Object
Encapsulates the naming scheme used for the resources which the Cluster Operator manages for a Kafka cluster.
  • Method Details

    • clusterCaCertificateSecretName

      public static String clusterCaCertificateSecretName(String clusterName)
      Returns the name of the Cluster CA certificate Secret for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Cluster CA certificate Secret.
    • clusterCaKeySecretName

      public static String clusterCaKeySecretName(String clusterName)
      Returns the name of the Cluster CA key Secret for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Cluster CA key Secret.
    • clientsCaCertificateSecretName

      public static String clientsCaCertificateSecretName(String clusterName)
      Returns the name of the Clients CA certificate Secret for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Clients CA certificate Secret.
    • clientsCaKeySecretName

      public static String clientsCaKeySecretName(String clusterName)
      Returns the name of the Clients CA key Secret for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Clients CA key Secret.
    • kafkaComponentName

      public static String kafkaComponentName(String clusterName)
      Returns the name of the Kafka StrimziPodSet for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Kafka StrimziPodSet.
    • kafkaPodName

      public static String kafkaPodName(String clusterName, int podNum)
      Returns the name of the Kafka Pod for a Kafka cluster not using KafkaNodePool resources.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      podNum - The ordinal number of the Kafka pod
      Returns:
      The name of the corresponding Kafka Pod.
    • kafkaPodName

      public static String kafkaPodName(String clusterName, String nodePoolName, int podNum)
      Returns the name of the Kafka Pod for a Kafka cluster using KafkaNodePool resources.
      Parameters:
      clusterName - The metadata.name of the Kafka resource
      nodePoolName - The metadata.name of the KafkaNodePool resource
      podNum - The ordinal number of the Kafka pod
      Returns:
      The name of the corresponding Kafka Pod.
    • bootstrapServiceName

      public static String bootstrapServiceName(String clusterName)
      Returns the name of the internal bootstrap Service for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding bootstrap Service.
    • plainBootstrapAddress

      public static String plainBootstrapAddress(String clusterName)
      Returns the address (<host>:<port>) of the internal plain bootstrap Service for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The address of the corresponding bootstrap Service.
      See Also:
    • tlsBootstrapAddress

      public static String tlsBootstrapAddress(String clusterName)
      Returns the address (<host>:<port>) of the internal TLS bootstrap Service for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The address of the corresponding bootstrap Service.
      See Also:
    • brokersServiceName

      public static String brokersServiceName(String clusterName)
      Returns the name of the (headless) brokers Service for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding brokers Service.
    • externalBootstrapServiceName

      public static String externalBootstrapServiceName(String clusterName)
      Returns the name of the external bootstrap Service for a Kafka cluster of the given name. This Service will only exist if Kafka.spec.kafka.listeners.external is configured for a loadbalancer or NodePort in the Kafka resource with the given name. This is used only for the backwards compatible service names (listener name has to be `external` and port has to be 9094).
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding bootstrap Service.
    • brokerSpecificService

      public static String brokerSpecificService(String clusterName, int podNum)
      Returns the name of the Service for a specific Kafka Pod of a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      podNum - The number of the Kafka pod corresponding to the service
      Returns:
      The name of the corresponding Kafka Service.
    • kafkaMetricsAndLogConfigMapName

      public static String kafkaMetricsAndLogConfigMapName(String clusterName)
      Returns the name of the Kafka metrics and log ConfigMap for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Kafka metrics and log ConfigMap.
    • initContainerClusterRoleBindingName

      public static String initContainerClusterRoleBindingName(String cluster, String namespace)
      Get the name of the resource init container role binding given the name of the namespace and cluster.
      Parameters:
      cluster - The cluster name.
      namespace - The namespace.
      Returns:
      The name of the init container's cluster role binding.
    • kafkaSecretName

      public static String kafkaSecretName(String clusterName)
      Returns the name of the Kafka Secret with server certificates.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Kafka Secret.
    • kafkaJmxSecretName

      public static String kafkaJmxSecretName(String clusterName)
      Returns the name of the Kafka Secret with JMX credentials.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Kafka JMX Secret.
    • kafkaNetworkPolicyName

      public static String kafkaNetworkPolicyName(String clusterName)
      Returns the name of the Kafka Network Policy.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Kafka Network Policy.
    • zookeeperComponentName

      public static String zookeeperComponentName(String clusterName)
      Returns the name of the ZooKeeper StrimziPodSet for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding ZooKeeper StrimziPodSet.
    • zookeeperPodName

      public static String zookeeperPodName(String clusterName, int podNum)
      Returns the name of the ZooKeeper Pod for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      podNum - The number of the ZooKeeper pod
      Returns:
      The name of the corresponding ZooKeeper Pod.
    • zookeeperMetricsAndLogConfigMapName

      public static String zookeeperMetricsAndLogConfigMapName(String clusterName)
      Returns the name of the ZooKeeper metrics and log ConfigMap for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding ZooKeeper metrics and log ConfigMap.
    • zookeeperServiceName

      public static String zookeeperServiceName(String clusterName)
      Returns the name of the ZooKeeper service name for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding ZooKeeper service name.
    • zookeeperHeadlessServiceName

      public static String zookeeperHeadlessServiceName(String clusterName)
      Returns the name of the ZooKeeper headless service name for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding ZooKeeper headless service name.
    • zookeeperSecretName

      public static String zookeeperSecretName(String clusterName)
      Returns the name of the ZooKeeper Secret with server certificates.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding ZooKeeper Secret.
    • zookeeperJmxSecretName

      public static String zookeeperJmxSecretName(String clusterName)
      Returns the name of the ZooKeeper Secret with JMX credentials.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding ZooKeeper JMX Secret.
    • zookeeperNetworkPolicyName

      public static String zookeeperNetworkPolicyName(String clusterName)
      Returns the name of the ZooKeeper Network Policy.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding ZooKeeper Network Policy.
    • entityOperatorDeploymentName

      public static String entityOperatorDeploymentName(String clusterName)
      Returns the name of the Entity Operator Deployment for a Kafka cluster of the given name. This Deployment will only exist if Kafka.spec.entityOperator is configured in the Kafka resource with the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Entity Operator Deployment.
    • entityOperatorSecretName

      @Deprecated public static String entityOperatorSecretName(String clusterName)
      Deprecated.
      Returns the name of the Entity Operator Secret for a Kafka cluster of the given name. This Secret will only exist if Kafka.spec.entityOperator is configured in the Kafka resource with the given name. This secret is not used anymore and is deprecated. This method will be removed in the future.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Entity Operator Secret.
    • entityTopicOperatorSecretName

      public static String entityTopicOperatorSecretName(String clusterName)
      Returns the name of the Entity Topic Operator Secret for a Kafka cluster of the given name. This Secret will only exist if Kafka.spec.entityOperator.topicOperator is configured in the Kafka resource with the given name. Note: This secret is used by both EntityTopicOperator and the TLS sidecar in the same EntityOperator.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Entity Topic Operator Secret.
    • entityTopicOperatorCcApiSecretName

      public static String entityTopicOperatorCcApiSecretName(String clusterName)
      Returns the name of the Cruise Control API auth Secret used by the Topic Operator in a Kafka cluster of the given name. This Secret will only exist if Kafka.spec.cruiseControl is configured in the Kafka resource with the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Secret.
    • entityTopicOperatorLoggingConfigMapName

      public static String entityTopicOperatorLoggingConfigMapName(String clusterName)
      Returns the name of the Entity Topic Operator logging ConfigMap for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Entity Topic Operator metrics and log ConfigMap.
    • entityTopicOperatorRoleBinding

      public static String entityTopicOperatorRoleBinding(String clusterName)
      Get the name of the Entity Topic Operator role binding given the name of the Kafka cluster.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the Entity Topic Operator role binding.
    • entityUserOperatorSecretName

      public static String entityUserOperatorSecretName(String clusterName)
      Returns the name of the Entity User Operator Secret for a Kafka cluster of the given name. This Secret will only exist if Kafka.spec.entityOperator.userOperator is configured in the Kafka resource with the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Entity Operator Secret.
    • entityUserOperatorLoggingConfigMapName

      public static String entityUserOperatorLoggingConfigMapName(String clusterName)
      Returns the name of the Entity User Operator logging ConfigMap for a Kafka cluster of the given name.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the corresponding Entity User Operator metrics and log ConfigMap.
    • entityUserOperatorRoleBinding

      public static String entityUserOperatorRoleBinding(String clusterName)
      Get the name of the Entity User Operator role binding given the name of the Kafka cluster.
      Parameters:
      clusterName - The metadata.name of the Kafka resource.
      Returns:
      The name of the Entity User Operator role binding.
    • clusterOperatorCertsSecretName

      public static String clusterOperatorCertsSecretName(String cluster)
      Name of the secret with the Cluster Operator certificates for connecting to this cluster
      Parameters:
      cluster - Name of the Kafka cluster
      Returns:
      Name of the Cluster Operator certificate secret
    • autoRebalancingKafkaRebalanceResourceName

      public static String autoRebalancingKafkaRebalanceResourceName(String cluster, KafkaAutoRebalanceMode kafkaAutoRebalanceMode)
      Compose the name of the KafkaRebalance custom resource to be used for running an auto-rebalancing in the specified mode for the specified Kafka cluster
      Parameters:
      cluster - Kafka cluster name (from Kafka custom resource metadata)
      kafkaAutoRebalanceMode - Auto-rebalance mode
      Returns:
      the name of the KafkaRebalance custom resource to be used for running an auto-rebalancing in the specified mode for the specified Kafka cluster