public class KubernetesServiceImporter extends Object implements io.fabric8.kubernetes.client.Watcher<io.fabric8.kubernetes.api.model.Service>, ServiceImporter
The bridge is configured using:
* the oauth token (using the content of `/var/run/secrets/kubernetes.io/serviceaccount/token` by default) * the namespace in which the service are searched (defaults to `default`).
Be aware that the application must have access to Kubernetes and must be able to read the chosen namespace.
Record
are created from Kubernetes Service. The service type is deduced from the `service.type` label. If
not set, the service is imported as `unknown`. Only `http-endpoint` are supported for now.
Constructor and Description |
---|
KubernetesServiceImporter() |
Modifier and Type | Method and Description |
---|---|
void |
eventReceived(io.fabric8.kubernetes.client.Watcher.Action action,
io.fabric8.kubernetes.api.model.Service service) |
void |
onClose(io.fabric8.kubernetes.client.KubernetesClientException e) |
void |
start(Vertx vertx,
ServicePublisher publisher,
JsonObject configuration,
Future<Void> completion)
Starts the bridge.
|
void |
stop(Vertx vertx,
ServicePublisher publisher,
Future<Void> future)
Stops the bridge.
|
public void start(Vertx vertx, ServicePublisher publisher, JsonObject configuration, Future<Void> completion)
ServiceImporter
start
in interface ServiceImporter
vertx
- the vertx instancepublisher
- the service discovery instanceconfiguration
- the bridge configuration if anycompletion
- a future on which the bridge must report the completion of the startingpublic void stop(Vertx vertx, ServicePublisher publisher, Future<Void> future)
ServiceImporter
stop
in interface ServiceImporter
vertx
- the vertx instancepublisher
- the service discovery instancefuture
- the future on which the bridge must report the completion of the stopping processpublic void eventReceived(io.fabric8.kubernetes.client.Watcher.Action action, io.fabric8.kubernetes.api.model.Service service)
eventReceived
in interface io.fabric8.kubernetes.client.Watcher<io.fabric8.kubernetes.api.model.Service>
public void onClose(io.fabric8.kubernetes.client.KubernetesClientException e)
onClose
in interface io.fabric8.kubernetes.client.Watcher<io.fabric8.kubernetes.api.model.Service>
Copyright © 2016. All rights reserved.