Class KafkaResources


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

      • zookeeperStatefulSetName

        public static String zookeeperStatefulSetName​(String clusterName)
        Returns the name of the ZooKeeper StatefulSet for a Kafka cluster of the given name.
        Parameters:
        clusterName - The metadata.name of the Kafka resource.
        Returns:
        The name of the corresponding ZooKeeper StatefulSet.
      • 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.
      • kafkaStatefulSetName

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

        public static String kafkaPodName​(String clusterName,
                                          int podNum)
        Returns the name of the Kafka Pod for a Kafka cluster of the given name.
        Parameters:
        clusterName - The metadata.name of the Kafka resource.
        podNum - The number of the Kafka pod
        Returns:
        The name of the corresponding Kafka Pod.
      • 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

        public static String entityOperatorSecretName​(String clusterName)
        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.
        Parameters:
        clusterName - The metadata.name of the Kafka resource.
        Returns:
        The name of the corresponding Entity Operator Secret.
      • 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.
      • 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(String)
      • 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:
        plainBootstrapAddress(String)
      • 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.
        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.
      • 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.
      • 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.