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();
}
Aggregations