Search in sources :

Example 6 with KafkaRebalanceBuilder

use of io.strimzi.api.kafka.model.KafkaRebalanceBuilder in project strimzi by strimzi.

the class KafkaRebalanceAssemblyOperator method reconcile.

private Future<Void> reconcile(Reconciliation reconciliation, String host, CruiseControlApi apiClient, KafkaRebalance kafkaRebalance, KafkaRebalanceState currentState, KafkaRebalanceAnnotation rebalanceAnnotation) {
    LOGGER.infoCr(reconciliation, "Rebalance action from state [{}]", currentState);
    if (Annotations.isReconciliationPausedWithAnnotation(kafkaRebalance)) {
        // we need to do this check again because it was triggered by a watcher
        KafkaRebalanceStatus status = new KafkaRebalanceStatus();
        Set<Condition> unknownAndDeprecatedConditions = validate(reconciliation, kafkaRebalance);
        unknownAndDeprecatedConditions.add(StatusUtils.getPausedCondition());
        status.setConditions(new ArrayList<>(unknownAndDeprecatedConditions));
        return updateStatus(reconciliation, kafkaRebalance, status, null).compose(i -> Future.succeededFuture());
    }
    RebalanceOptions.RebalanceOptionsBuilder rebalanceOptionsBuilder = convertRebalanceSpecToRebalanceOptions(kafkaRebalance.getSpec(), usingJbodStorage);
    return computeNextStatus(reconciliation, host, apiClient, kafkaRebalance, currentState, rebalanceAnnotation, rebalanceOptionsBuilder).compose(desiredStatusAndMap -> {
        // do a new get to retrieve the current resource state.
        return kafkaRebalanceOperator.getAsync(reconciliation.namespace(), reconciliation.name()).compose(currentKafkaRebalance -> {
            if (currentKafkaRebalance != null) {
                return configMapOperator.reconcile(reconciliation, kafkaRebalance.getMetadata().getNamespace(), kafkaRebalance.getMetadata().getName(), desiredStatusAndMap.getLoadMap()).compose(i -> updateStatus(reconciliation, currentKafkaRebalance, desiredStatusAndMap.getStatus(), null)).compose(updatedKafkaRebalance -> {
                    LOGGER.infoCr(reconciliation, "State updated to [{}] with annotation {}={} ", rebalanceStateConditionType(updatedKafkaRebalance.getStatus()), ANNO_STRIMZI_IO_REBALANCE, rawRebalanceAnnotation(updatedKafkaRebalance));
                    if (hasRebalanceAnnotation(updatedKafkaRebalance)) {
                        LOGGER.debugCr(reconciliation, "Removing annotation {}={}", ANNO_STRIMZI_IO_REBALANCE, rawRebalanceAnnotation(updatedKafkaRebalance));
                        // Updated KafkaRebalance has rebalance annotation removed as
                        // action specified by user has been completed.
                        KafkaRebalance patchedKafkaRebalance = new KafkaRebalanceBuilder(updatedKafkaRebalance).editMetadata().removeFromAnnotations(ANNO_STRIMZI_IO_REBALANCE).endMetadata().build();
                        return kafkaRebalanceOperator.patchAsync(reconciliation, patchedKafkaRebalance);
                    } else {
                        LOGGER.debugCr(reconciliation, "No annotation {}", ANNO_STRIMZI_IO_REBALANCE);
                        return Future.succeededFuture();
                    }
                }).mapEmpty();
            } else {
                return Future.succeededFuture();
            }
        }, exception -> {
            LOGGER.errorCr(reconciliation, "Status updated to [NotReady] due to error: {}", exception.getMessage());
            return updateStatus(reconciliation, kafkaRebalance, new KafkaRebalanceStatus(), exception).mapEmpty();
        });
    }, exception -> {
        LOGGER.errorCr(reconciliation, "Status updated to [NotReady] due to error: {}", exception.getMessage());
        return updateStatus(reconciliation, kafkaRebalance, new KafkaRebalanceStatus(), exception).mapEmpty();
    });
}
Also used : Condition(io.strimzi.api.kafka.model.status.Condition) Arrays(java.util.Arrays) LabelSelector(io.fabric8.kubernetes.api.model.LabelSelector) ANNO_STRIMZI_IO_REBALANCE(io.strimzi.operator.common.Annotations.ANNO_STRIMZI_IO_REBALANCE) Watcher(io.fabric8.kubernetes.client.Watcher) Annotations(io.strimzi.operator.common.Annotations) CruiseControlConfiguration(io.strimzi.operator.cluster.model.CruiseControlConfiguration) Resource(io.fabric8.kubernetes.client.dsl.Resource) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) JsonObject(io.vertx.core.json.JsonObject) CruiseControlRebalanceKeys(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlRebalanceKeys) ModelUtils(io.strimzi.operator.cluster.model.ModelUtils) KubernetesClientException(io.fabric8.kubernetes.client.KubernetesClientException) AbstractOperator(io.strimzi.operator.common.AbstractOperator) StatusUtils(io.strimzi.operator.common.operator.resource.StatusUtils) KafkaRebalance(io.strimzi.api.kafka.model.KafkaRebalance) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) Set(java.util.Set) KafkaRebalanceList(io.strimzi.api.kafka.KafkaRebalanceList) KafkaRebalanceAnnotation(io.strimzi.api.kafka.model.balancing.KafkaRebalanceAnnotation) Future(io.vertx.core.Future) Collectors(java.util.stream.Collectors) NoSuchResourceException(io.strimzi.operator.cluster.model.NoSuchResourceException) CruiseControlUserTaskStatus(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlUserTaskStatus) KafkaRebalanceStatusBuilder(io.strimzi.api.kafka.model.status.KafkaRebalanceStatusBuilder) CruiseControlResources(io.strimzi.api.kafka.model.CruiseControlResources) List(java.util.List) Labels(io.strimzi.operator.common.model.Labels) Stream(java.util.stream.Stream) CruiseControlApi(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlApi) Secret(io.fabric8.kubernetes.api.model.Secret) Optional(java.util.Optional) Condition(io.strimzi.api.kafka.model.status.Condition) PlatformFeaturesAvailability(io.strimzi.operator.PlatformFeaturesAvailability) ClusterOperatorConfig(io.strimzi.operator.cluster.ClusterOperatorConfig) KafkaList(io.strimzi.api.kafka.KafkaList) KafkaRebalanceState(io.strimzi.api.kafka.model.balancing.KafkaRebalanceState) KafkaRebalanceBuilder(io.strimzi.api.kafka.model.KafkaRebalanceBuilder) HashMap(java.util.HashMap) CruiseControlApiImpl(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlApiImpl) KafkaRebalanceSpec(io.strimzi.api.kafka.model.KafkaRebalanceSpec) ArrayList(java.util.ArrayList) WatcherException(io.fabric8.kubernetes.client.WatcherException) CompositeFuture(io.vertx.core.CompositeFuture) ConfigMapOperator(io.strimzi.operator.common.operator.resource.ConfigMapOperator) CrdOperator(io.strimzi.operator.common.operator.resource.CrdOperator) RebalanceOptions(io.strimzi.operator.cluster.operator.resource.cruisecontrol.RebalanceOptions) CruiseControl(io.strimzi.operator.cluster.model.CruiseControl) JbodStorage(io.strimzi.api.kafka.model.storage.JbodStorage) ReconciliationLogger(io.strimzi.operator.common.ReconciliationLogger) InvalidResourceException(io.strimzi.operator.cluster.model.InvalidResourceException) Promise(io.vertx.core.Promise) Vertx(io.vertx.core.Vertx) CruiseControlLoadParameters(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlLoadParameters) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) KafkaRebalanceStatus(io.strimzi.api.kafka.model.status.KafkaRebalanceStatus) ConfigMapBuilder(io.fabric8.kubernetes.api.model.ConfigMapBuilder) Reconciliation(io.strimzi.operator.common.Reconciliation) JsonArray(io.vertx.core.json.JsonArray) HTTP_DEFAULT_IDLE_TIMEOUT_SECONDS(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlApiImpl.HTTP_DEFAULT_IDLE_TIMEOUT_SECONDS) StatusDiff(io.strimzi.operator.cluster.model.StatusDiff) Util(io.strimzi.operator.common.Util) AbstractWatchableStatusedResourceOperator(io.strimzi.operator.common.operator.resource.AbstractWatchableStatusedResourceOperator) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) Kafka(io.strimzi.api.kafka.model.Kafka) CruiseControlRestException(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlRestException) Collections(java.util.Collections) KafkaRebalanceStatus(io.strimzi.api.kafka.model.status.KafkaRebalanceStatus) KafkaRebalanceBuilder(io.strimzi.api.kafka.model.KafkaRebalanceBuilder) RebalanceOptions(io.strimzi.operator.cluster.operator.resource.cruisecontrol.RebalanceOptions) KafkaRebalance(io.strimzi.api.kafka.model.KafkaRebalance)

Example 7 with KafkaRebalanceBuilder

use of io.strimzi.api.kafka.model.KafkaRebalanceBuilder in project strimzi by strimzi.

the class KafkaRebalanceStateMachineTest method createKafkaRebalance.

/**
 * Creates an example {@link KafkaRebalanceBuilder} instance using the supplied state parameters.
 *
 * @param currentState The current state of the resource before being passed to computeNextStatus.
 * @param currentStatusSessionID The user task ID attached to the current KafkaRebalance resource. Can be null.
 * @param userAnnotation An annotation to be applied after the reconcile has started, for example "approve" or "stop".
 * @param rebalanceSpec A custom rebalance specification. If null a blank spec will be used.
 * @return A KafkaRebalance instance configured with the supplied parameters.
 */
private KafkaRebalance createKafkaRebalance(KafkaRebalanceState currentState, String currentStatusSessionID, String userAnnotation, KafkaRebalanceSpec rebalanceSpec) {
    KafkaRebalanceBuilder kafkaRebalanceBuilder = new KafkaRebalanceBuilder().editOrNewMetadata().withName(RESOURCE_NAME).withNamespace(CLUSTER_NAMESPACE).withLabels(Collections.singletonMap(Labels.STRIMZI_CLUSTER_LABEL, CLUSTER_NAME)).withAnnotations(Collections.singletonMap(Annotations.ANNO_STRIMZI_IO_REBALANCE, userAnnotation == null ? "none" : userAnnotation)).endMetadata().withSpec(rebalanceSpec);
    // there is no actual status and related condition when a KafkaRebalance is just created
    if (currentState != KafkaRebalanceState.New) {
        Condition currentRebalanceCondition = new Condition();
        currentRebalanceCondition.setType(currentState.toString());
        currentRebalanceCondition.setStatus("True");
        KafkaRebalanceStatus currentStatus = new KafkaRebalanceStatus();
        currentStatus.setConditions(Collections.singletonList(currentRebalanceCondition));
        currentStatus.setSessionId(currentStatusSessionID);
        kafkaRebalanceBuilder.withStatus(currentStatus);
    }
    return kafkaRebalanceBuilder.build();
}
Also used : Condition(io.strimzi.api.kafka.model.status.Condition) KafkaRebalanceStatus(io.strimzi.api.kafka.model.status.KafkaRebalanceStatus) KafkaRebalanceBuilder(io.strimzi.api.kafka.model.KafkaRebalanceBuilder)

Example 8 with KafkaRebalanceBuilder

use of io.strimzi.api.kafka.model.KafkaRebalanceBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaRebalanceAssemblyOperator method reconcile.

private Future<Void> reconcile(Reconciliation reconciliation, String host, CruiseControlApi apiClient, KafkaRebalance kafkaRebalance, KafkaRebalanceState currentState, KafkaRebalanceAnnotation rebalanceAnnotation) {
    LOGGER.infoCr(reconciliation, "Rebalance action from state [{}]", currentState);
    if (Annotations.isReconciliationPausedWithAnnotation(kafkaRebalance)) {
        // we need to do this check again because it was triggered by a watcher
        KafkaRebalanceStatus status = new KafkaRebalanceStatus();
        Set<Condition> unknownAndDeprecatedConditions = validate(reconciliation, kafkaRebalance);
        unknownAndDeprecatedConditions.add(StatusUtils.getPausedCondition());
        status.setConditions(new ArrayList<>(unknownAndDeprecatedConditions));
        return updateStatus(reconciliation, kafkaRebalance, status, null).compose(i -> Future.succeededFuture());
    }
    RebalanceOptions.RebalanceOptionsBuilder rebalanceOptionsBuilder = convertRebalanceSpecToRebalanceOptions(kafkaRebalance.getSpec(), usingJbodStorage);
    return computeNextStatus(reconciliation, host, apiClient, kafkaRebalance, currentState, rebalanceAnnotation, rebalanceOptionsBuilder).compose(desiredStatusAndMap -> {
        // do a new get to retrieve the current resource state.
        return kafkaRebalanceOperator.getAsync(reconciliation.namespace(), reconciliation.name()).compose(currentKafkaRebalance -> {
            if (currentKafkaRebalance != null) {
                return configMapOperator.reconcile(reconciliation, kafkaRebalance.getMetadata().getNamespace(), kafkaRebalance.getMetadata().getName(), desiredStatusAndMap.getLoadMap()).compose(i -> updateStatus(reconciliation, currentKafkaRebalance, desiredStatusAndMap.getStatus(), null)).compose(updatedKafkaRebalance -> {
                    LOGGER.infoCr(reconciliation, "State updated to [{}] with annotation {}={} ", rebalanceStateConditionType(updatedKafkaRebalance.getStatus()), ANNO_STRIMZI_IO_REBALANCE, rawRebalanceAnnotation(updatedKafkaRebalance));
                    if (hasRebalanceAnnotation(updatedKafkaRebalance)) {
                        LOGGER.debugCr(reconciliation, "Removing annotation {}={}", ANNO_STRIMZI_IO_REBALANCE, rawRebalanceAnnotation(updatedKafkaRebalance));
                        // Updated KafkaRebalance has rebalance annotation removed as
                        // action specified by user has been completed.
                        KafkaRebalance patchedKafkaRebalance = new KafkaRebalanceBuilder(updatedKafkaRebalance).editMetadata().removeFromAnnotations(ANNO_STRIMZI_IO_REBALANCE).endMetadata().build();
                        return kafkaRebalanceOperator.patchAsync(reconciliation, patchedKafkaRebalance);
                    } else {
                        LOGGER.debugCr(reconciliation, "No annotation {}", ANNO_STRIMZI_IO_REBALANCE);
                        return Future.succeededFuture();
                    }
                }).mapEmpty();
            } else {
                return Future.succeededFuture();
            }
        }, exception -> {
            LOGGER.errorCr(reconciliation, "Status updated to [NotReady] due to error: {}", exception.getMessage());
            return updateStatus(reconciliation, kafkaRebalance, new KafkaRebalanceStatus(), exception).mapEmpty();
        });
    }, exception -> {
        LOGGER.errorCr(reconciliation, "Status updated to [NotReady] due to error: {}", exception.getMessage());
        return updateStatus(reconciliation, kafkaRebalance, new KafkaRebalanceStatus(), exception).mapEmpty();
    });
}
Also used : Condition(io.strimzi.api.kafka.model.status.Condition) Arrays(java.util.Arrays) LabelSelector(io.fabric8.kubernetes.api.model.LabelSelector) ANNO_STRIMZI_IO_REBALANCE(io.strimzi.operator.common.Annotations.ANNO_STRIMZI_IO_REBALANCE) Watcher(io.fabric8.kubernetes.client.Watcher) Annotations(io.strimzi.operator.common.Annotations) CruiseControlConfiguration(io.strimzi.operator.cluster.model.CruiseControlConfiguration) Resource(io.fabric8.kubernetes.client.dsl.Resource) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) ResourceOperatorSupplier(io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier) JsonObject(io.vertx.core.json.JsonObject) CruiseControlRebalanceKeys(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlRebalanceKeys) ModelUtils(io.strimzi.operator.cluster.model.ModelUtils) KubernetesClientException(io.fabric8.kubernetes.client.KubernetesClientException) AbstractOperator(io.strimzi.operator.common.AbstractOperator) StatusUtils(io.strimzi.operator.common.operator.resource.StatusUtils) KafkaRebalance(io.strimzi.api.kafka.model.KafkaRebalance) SecretOperator(io.strimzi.operator.common.operator.resource.SecretOperator) Set(java.util.Set) KafkaRebalanceList(io.strimzi.api.kafka.KafkaRebalanceList) KafkaRebalanceAnnotation(io.strimzi.api.kafka.model.balancing.KafkaRebalanceAnnotation) Future(io.vertx.core.Future) Collectors(java.util.stream.Collectors) NoSuchResourceException(io.strimzi.operator.cluster.model.NoSuchResourceException) CruiseControlUserTaskStatus(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlUserTaskStatus) KafkaRebalanceStatusBuilder(io.strimzi.api.kafka.model.status.KafkaRebalanceStatusBuilder) CruiseControlResources(io.strimzi.api.kafka.model.CruiseControlResources) List(java.util.List) Labels(io.strimzi.operator.common.model.Labels) Stream(java.util.stream.Stream) CruiseControlApi(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlApi) Secret(io.fabric8.kubernetes.api.model.Secret) Optional(java.util.Optional) Condition(io.strimzi.api.kafka.model.status.Condition) PlatformFeaturesAvailability(io.strimzi.operator.PlatformFeaturesAvailability) ClusterOperatorConfig(io.strimzi.operator.cluster.ClusterOperatorConfig) KafkaList(io.strimzi.api.kafka.KafkaList) KafkaRebalanceState(io.strimzi.api.kafka.model.balancing.KafkaRebalanceState) KafkaRebalanceBuilder(io.strimzi.api.kafka.model.KafkaRebalanceBuilder) HashMap(java.util.HashMap) CruiseControlApiImpl(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlApiImpl) KafkaRebalanceSpec(io.strimzi.api.kafka.model.KafkaRebalanceSpec) ArrayList(java.util.ArrayList) WatcherException(io.fabric8.kubernetes.client.WatcherException) CompositeFuture(io.vertx.core.CompositeFuture) ConfigMapOperator(io.strimzi.operator.common.operator.resource.ConfigMapOperator) CrdOperator(io.strimzi.operator.common.operator.resource.CrdOperator) RebalanceOptions(io.strimzi.operator.cluster.operator.resource.cruisecontrol.RebalanceOptions) CruiseControl(io.strimzi.operator.cluster.model.CruiseControl) JbodStorage(io.strimzi.api.kafka.model.storage.JbodStorage) ReconciliationLogger(io.strimzi.operator.common.ReconciliationLogger) InvalidResourceException(io.strimzi.operator.cluster.model.InvalidResourceException) Promise(io.vertx.core.Promise) Vertx(io.vertx.core.Vertx) CruiseControlLoadParameters(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlLoadParameters) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) KafkaRebalanceStatus(io.strimzi.api.kafka.model.status.KafkaRebalanceStatus) ConfigMapBuilder(io.fabric8.kubernetes.api.model.ConfigMapBuilder) Reconciliation(io.strimzi.operator.common.Reconciliation) JsonArray(io.vertx.core.json.JsonArray) HTTP_DEFAULT_IDLE_TIMEOUT_SECONDS(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlApiImpl.HTTP_DEFAULT_IDLE_TIMEOUT_SECONDS) StatusDiff(io.strimzi.operator.cluster.model.StatusDiff) Util(io.strimzi.operator.common.Util) AbstractWatchableStatusedResourceOperator(io.strimzi.operator.common.operator.resource.AbstractWatchableStatusedResourceOperator) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) Kafka(io.strimzi.api.kafka.model.Kafka) CruiseControlRestException(io.strimzi.operator.cluster.operator.resource.cruisecontrol.CruiseControlRestException) Collections(java.util.Collections) KafkaRebalanceStatus(io.strimzi.api.kafka.model.status.KafkaRebalanceStatus) KafkaRebalanceBuilder(io.strimzi.api.kafka.model.KafkaRebalanceBuilder) RebalanceOptions(io.strimzi.operator.cluster.operator.resource.cruisecontrol.RebalanceOptions) KafkaRebalance(io.strimzi.api.kafka.model.KafkaRebalance)

Example 9 with KafkaRebalanceBuilder

use of io.strimzi.api.kafka.model.KafkaRebalanceBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaRebalanceAssemblyOperator method updateStatus.

private Future<KafkaRebalance> updateStatus(Reconciliation reconciliation, KafkaRebalance kafkaRebalance, KafkaRebalanceStatus desiredStatus, Throwable e) {
    // Leave the current status when the desired state is null
    if (desiredStatus != null) {
        Condition cond = rebalanceStateCondition(desiredStatus);
        List<Condition> previous = Collections.emptyList();
        if (desiredStatus.getConditions() != null) {
            previous = desiredStatus.getConditions().stream().filter(condition -> condition != cond).collect(Collectors.toList());
        }
        String rebalanceType = rebalanceStateConditionType(desiredStatus);
        // If a throwable is supplied, it is set in the status with priority
        if (e != null) {
            StatusUtils.setStatusConditionAndObservedGeneration(kafkaRebalance, desiredStatus, KafkaRebalanceState.NotReady.toString(), e);
            desiredStatus.setConditions(Stream.concat(desiredStatus.getConditions().stream(), previous.stream()).collect(Collectors.toList()));
        } else if (rebalanceType != null) {
            StatusUtils.setStatusConditionAndObservedGeneration(kafkaRebalance, desiredStatus, rebalanceType);
            desiredStatus.setConditions(Stream.concat(desiredStatus.getConditions().stream(), previous.stream()).collect(Collectors.toList()));
        } else {
            throw new IllegalArgumentException("Status related exception and the Status condition's type cannot both be null");
        }
        StatusDiff diff = new StatusDiff(kafkaRebalance.getStatus(), desiredStatus);
        if (!diff.isEmpty()) {
            return kafkaRebalanceOperator.updateStatusAsync(reconciliation, new KafkaRebalanceBuilder(kafkaRebalance).withStatus(desiredStatus).build());
        }
    }
    return Future.succeededFuture(kafkaRebalance);
}
Also used : Condition(io.strimzi.api.kafka.model.status.Condition) StatusDiff(io.strimzi.operator.cluster.model.StatusDiff) KafkaRebalanceBuilder(io.strimzi.api.kafka.model.KafkaRebalanceBuilder)

Example 10 with KafkaRebalanceBuilder

use of io.strimzi.api.kafka.model.KafkaRebalanceBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaRebalanceAssemblyOperatorTest method annotate.

/**
 * annotate the KafkaRebalance, patch the (mocked) server with the resource and then return the annotated resource
 */
private KafkaRebalance annotate(KubernetesClient kubernetesClient, String namespace, String resource, KafkaRebalanceAnnotation annotationValue) {
    KafkaRebalance kafkaRebalance = Crds.kafkaRebalanceOperation(kubernetesClient).inNamespace(namespace).withName(resource).get();
    KafkaRebalance patchedKr = new KafkaRebalanceBuilder(kafkaRebalance).editMetadata().addToAnnotations(Annotations.ANNO_STRIMZI_IO_REBALANCE, annotationValue.toString()).endMetadata().build();
    Crds.kafkaRebalanceOperation(kubernetesClient).inNamespace(namespace).withName(resource).patch(patchedKr);
    return patchedKr;
}
Also used : KafkaRebalanceBuilder(io.strimzi.api.kafka.model.KafkaRebalanceBuilder) KafkaRebalance(io.strimzi.api.kafka.model.KafkaRebalance)

Aggregations

KafkaRebalanceBuilder (io.strimzi.api.kafka.model.KafkaRebalanceBuilder)12 Condition (io.strimzi.api.kafka.model.status.Condition)8 KafkaRebalance (io.strimzi.api.kafka.model.KafkaRebalance)6 KafkaRebalanceStatus (io.strimzi.api.kafka.model.status.KafkaRebalanceStatus)6 ConfigMap (io.fabric8.kubernetes.api.model.ConfigMap)4 Secret (io.fabric8.kubernetes.api.model.Secret)4 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)4 KafkaList (io.strimzi.api.kafka.KafkaList)4 KafkaRebalanceList (io.strimzi.api.kafka.KafkaRebalanceList)4 CruiseControlResources (io.strimzi.api.kafka.model.CruiseControlResources)4 Kafka (io.strimzi.api.kafka.model.Kafka)4 KafkaRebalanceSpec (io.strimzi.api.kafka.model.KafkaRebalanceSpec)4 KafkaRebalanceAnnotation (io.strimzi.api.kafka.model.balancing.KafkaRebalanceAnnotation)4 KafkaRebalanceState (io.strimzi.api.kafka.model.balancing.KafkaRebalanceState)4 PlatformFeaturesAvailability (io.strimzi.operator.PlatformFeaturesAvailability)4 ClusterOperatorConfig (io.strimzi.operator.cluster.ClusterOperatorConfig)4 CruiseControl (io.strimzi.operator.cluster.model.CruiseControl)4 InvalidResourceException (io.strimzi.operator.cluster.model.InvalidResourceException)4 NoSuchResourceException (io.strimzi.operator.cluster.model.NoSuchResourceException)4 ResourceOperatorSupplier (io.strimzi.operator.cluster.operator.resource.ResourceOperatorSupplier)4