Search in sources :

Example 1 with FlinkOperatorConfiguration

use of org.apache.flink.kubernetes.operator.config.FlinkOperatorConfiguration in project flink-kubernetes-operator by apache.

the class FlinkOperator method main.

public static void main(String... args) {
    LOG.info("Starting Flink Kubernetes Operator");
    DefaultConfig defaultConfig = FlinkUtils.loadDefaultConfig();
    OperatorMetricUtils.initOperatorMetrics(defaultConfig.getOperatorConfig());
    DefaultKubernetesClient client = new DefaultKubernetesClient();
    String namespace = client.getNamespace();
    if (namespace == null) {
        namespace = "default";
    }
    DefaultConfigurationService configurationService = DefaultConfigurationService.instance();
    Operator operator = new Operator(client, configurationService);
    FlinkService flinkService = new FlinkService(client);
    FlinkOperatorConfiguration operatorConfiguration = FlinkOperatorConfiguration.fromConfiguration(defaultConfig.getOperatorConfig());
    Observer observer = new Observer(flinkService, operatorConfiguration);
    FlinkDeploymentValidator validator = new DefaultDeploymentValidator();
    ReconcilerFactory factory = new ReconcilerFactory(client, flinkService, operatorConfiguration);
    FlinkDeploymentController controller = new FlinkDeploymentController(defaultConfig, operatorConfiguration, client, namespace, validator, observer, factory);
    FlinkControllerConfig controllerConfig = new FlinkControllerConfig(controller);
    controller.setControllerConfig(controllerConfig);
    controllerConfig.setConfigurationService(configurationService);
    operator.register(controller, controllerConfig);
    operator.installShutdownHook();
    operator.start();
}
Also used : Operator(io.javaoperatorsdk.operator.Operator) DefaultConfigurationService(io.javaoperatorsdk.operator.config.runtime.DefaultConfigurationService) FlinkDeploymentValidator(org.apache.flink.kubernetes.operator.validation.FlinkDeploymentValidator) FlinkDeploymentController(org.apache.flink.kubernetes.operator.controller.FlinkDeploymentController) ReconcilerFactory(org.apache.flink.kubernetes.operator.reconciler.ReconcilerFactory) DefaultDeploymentValidator(org.apache.flink.kubernetes.operator.validation.DefaultDeploymentValidator) DefaultConfig(org.apache.flink.kubernetes.operator.config.DefaultConfig) FlinkOperatorConfiguration(org.apache.flink.kubernetes.operator.config.FlinkOperatorConfiguration) Observer(org.apache.flink.kubernetes.operator.observer.Observer) FlinkControllerConfig(org.apache.flink.kubernetes.operator.controller.FlinkControllerConfig) FlinkService(org.apache.flink.kubernetes.operator.service.FlinkService) DefaultKubernetesClient(io.fabric8.kubernetes.client.DefaultKubernetesClient)

Aggregations

DefaultKubernetesClient (io.fabric8.kubernetes.client.DefaultKubernetesClient)1 Operator (io.javaoperatorsdk.operator.Operator)1 DefaultConfigurationService (io.javaoperatorsdk.operator.config.runtime.DefaultConfigurationService)1 DefaultConfig (org.apache.flink.kubernetes.operator.config.DefaultConfig)1 FlinkOperatorConfiguration (org.apache.flink.kubernetes.operator.config.FlinkOperatorConfiguration)1 FlinkControllerConfig (org.apache.flink.kubernetes.operator.controller.FlinkControllerConfig)1 FlinkDeploymentController (org.apache.flink.kubernetes.operator.controller.FlinkDeploymentController)1 Observer (org.apache.flink.kubernetes.operator.observer.Observer)1 ReconcilerFactory (org.apache.flink.kubernetes.operator.reconciler.ReconcilerFactory)1 FlinkService (org.apache.flink.kubernetes.operator.service.FlinkService)1 DefaultDeploymentValidator (org.apache.flink.kubernetes.operator.validation.DefaultDeploymentValidator)1 FlinkDeploymentValidator (org.apache.flink.kubernetes.operator.validation.FlinkDeploymentValidator)1