Skip to content
Snippets Groups Projects
Commit 04f5e0c9 authored by fsoldatos's avatar fsoldatos
Browse files

feat(automation): externalize grpc clients configuration

parent 9cf94be4
No related branches found
No related tags found
1 merge request!54Release 2.0.0
# Define the host for the Context Service
quarkus.kubernetes.env.vars.context-service-host=context
# Define the host for the Device Service
quarkus.kubernetes.env.vars.device-service-host=device
\ No newline at end of file
...@@ -14,7 +14,8 @@ import javax.enterprise.context.ApplicationScoped; ...@@ -14,7 +14,8 @@ import javax.enterprise.context.ApplicationScoped;
@ApplicationScoped @ApplicationScoped
public class ContextGatewayImpl implements ContextGateway { public class ContextGatewayImpl implements ContextGateway {
@GrpcClient ContextService delegate; @GrpcClient("context")
ContextService delegate;
@Override @Override
public Multi<DeviceEvent> getDeviceEvents() { public Multi<DeviceEvent> getDeviceEvents() {
......
...@@ -14,7 +14,8 @@ import javax.enterprise.context.ApplicationScoped; ...@@ -14,7 +14,8 @@ import javax.enterprise.context.ApplicationScoped;
@ApplicationScoped @ApplicationScoped
public class DeviceGatewayImpl implements DeviceGateway { public class DeviceGatewayImpl implements DeviceGateway {
@GrpcClient DeviceService deviceDelegate; @GrpcClient("device")
DeviceService deviceDelegate;
@Override @Override
public Uni<eu.teraflow.automation.device.model.DeviceConfig> getInitialConfiguration( public Uni<eu.teraflow.automation.device.model.DeviceConfig> getInitialConfiguration(
......
automation: automation:
should-subscribe-to-context-component: false should-subscribe-to-context-component: true
quarkus: quarkus:
grpc: grpc:
server: server:
port: 9999 port: 9999
enable-reflection-service: true enable-reflection-service: true
clients:
context:
host: ${quarkus.kubernetes.env.vars.context-service-host}
device:
host: ${quarkus.kubernetes.env.vars.device-service-host}
http: http:
port: 8080 port: 8080
container-image: container-image:
...@@ -31,3 +36,7 @@ quarkus: ...@@ -31,3 +36,7 @@ quarkus:
grpc-server: grpc-server:
host-port: 9999 host-port: 9999
container-port: 9999 container-port: 9999
env:
vars:
context-service-host: context
device-service-host: device
\ No newline at end of file
...@@ -28708,11 +28708,19 @@ public final class ContextOuterClass { ...@@ -28708,11 +28708,19 @@ public final class ContextOuterClass {
context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder();
   
/** /**
* <pre>
*repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
* </pre>
*
* <code>string endpoint_type = 2;</code> * <code>string endpoint_type = 2;</code>
* @return The endpointType. * @return The endpointType.
*/ */
java.lang.String getEndpointType(); java.lang.String getEndpointType();
/** /**
* <pre>
*repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
* </pre>
*
* <code>string endpoint_type = 2;</code> * <code>string endpoint_type = 2;</code>
* @return The bytes for endpointType. * @return The bytes for endpointType.
*/ */
...@@ -28845,6 +28853,10 @@ public final class ContextOuterClass { ...@@ -28845,6 +28853,10 @@ public final class ContextOuterClass {
public static final int ENDPOINT_TYPE_FIELD_NUMBER = 2; public static final int ENDPOINT_TYPE_FIELD_NUMBER = 2;
private volatile java.lang.Object endpointType_; private volatile java.lang.Object endpointType_;
/** /**
* <pre>
*repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
* </pre>
*
* <code>string endpoint_type = 2;</code> * <code>string endpoint_type = 2;</code>
* @return The endpointType. * @return The endpointType.
*/ */
...@@ -28862,6 +28874,10 @@ public final class ContextOuterClass { ...@@ -28862,6 +28874,10 @@ public final class ContextOuterClass {
} }
} }
/** /**
* <pre>
*repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
* </pre>
*
* <code>string endpoint_type = 2;</code> * <code>string endpoint_type = 2;</code>
* @return The bytes for endpointType. * @return The bytes for endpointType.
*/ */
...@@ -29333,6 +29349,10 @@ public final class ContextOuterClass { ...@@ -29333,6 +29349,10 @@ public final class ContextOuterClass {
   
private java.lang.Object endpointType_ = ""; private java.lang.Object endpointType_ = "";
/** /**
* <pre>
*repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
* </pre>
*
* <code>string endpoint_type = 2;</code> * <code>string endpoint_type = 2;</code>
* @return The endpointType. * @return The endpointType.
*/ */
...@@ -29349,6 +29369,10 @@ public final class ContextOuterClass { ...@@ -29349,6 +29369,10 @@ public final class ContextOuterClass {
} }
} }
/** /**
* <pre>
*repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
* </pre>
*
* <code>string endpoint_type = 2;</code> * <code>string endpoint_type = 2;</code>
* @return The bytes for endpointType. * @return The bytes for endpointType.
*/ */
...@@ -29366,6 +29390,10 @@ public final class ContextOuterClass { ...@@ -29366,6 +29390,10 @@ public final class ContextOuterClass {
} }
} }
/** /**
* <pre>
*repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
* </pre>
*
* <code>string endpoint_type = 2;</code> * <code>string endpoint_type = 2;</code>
* @param value The endpointType to set. * @param value The endpointType to set.
* @return This builder for chaining. * @return This builder for chaining.
...@@ -29381,6 +29409,10 @@ public final class ContextOuterClass { ...@@ -29381,6 +29409,10 @@ public final class ContextOuterClass {
return this; return this;
} }
/** /**
* <pre>
*repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
* </pre>
*
* <code>string endpoint_type = 2;</code> * <code>string endpoint_type = 2;</code>
* @return This builder for chaining. * @return This builder for chaining.
*/ */
...@@ -29391,6 +29423,10 @@ public final class ContextOuterClass { ...@@ -29391,6 +29423,10 @@ public final class ContextOuterClass {
return this; return this;
} }
/** /**
* <pre>
*repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
* </pre>
*
* <code>string endpoint_type = 2;</code> * <code>string endpoint_type = 2;</code>
* @param value The bytes for endpointType to set. * @param value The bytes for endpointType to set.
* @return This builder for chaining. * @return This builder for chaining.
...@@ -3,8 +3,8 @@ apiVersion: v1 ...@@ -3,8 +3,8 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
annotations: annotations:
app.quarkus.io/commit-id: 285c0ca58a5b847c5bceed002b5e0fc0dcb5a28a app.quarkus.io/commit-id: 43db942bd5641ae293df75b65cd1eefd40b8085e
app.quarkus.io/build-timestamp: 2021-11-11 - 13:46:51 +0000 app.quarkus.io/build-timestamp: 2021-11-17 - 06:42:01 +0000
labels: labels:
app.kubernetes.io/name: automationservice app.kubernetes.io/name: automationservice
app.kubernetes.io/version: 0.0.1 app.kubernetes.io/version: 0.0.1
...@@ -27,28 +27,28 @@ apiVersion: apps/v1 ...@@ -27,28 +27,28 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
annotations: annotations:
app.quarkus.io/commit-id: 285c0ca58a5b847c5bceed002b5e0fc0dcb5a28a app.quarkus.io/commit-id: 43db942bd5641ae293df75b65cd1eefd40b8085e
app.quarkus.io/build-timestamp: 2021-11-11 - 13:46:51 +0000 app.quarkus.io/build-timestamp: 2021-11-17 - 06:42:01 +0000
labels: labels:
app: automationservice app: automationservice
app.kubernetes.io/version: 0.0.1
app.kubernetes.io/name: automationservice app.kubernetes.io/name: automationservice
app.kubernetes.io/version: 0.0.1
name: automationservice name: automationservice
spec: spec:
replicas: 1 replicas: 1
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/version: 0.0.1
app.kubernetes.io/name: automationservice app.kubernetes.io/name: automationservice
app.kubernetes.io/version: 0.0.1
template: template:
metadata: metadata:
annotations: annotations:
app.quarkus.io/commit-id: 285c0ca58a5b847c5bceed002b5e0fc0dcb5a28a app.quarkus.io/commit-id: 43db942bd5641ae293df75b65cd1eefd40b8085e
app.quarkus.io/build-timestamp: 2021-11-11 - 13:46:51 +0000 app.quarkus.io/build-timestamp: 2021-11-17 - 06:42:01 +0000
labels: labels:
app: automationservice app: automationservice
app.kubernetes.io/version: 0.0.1
app.kubernetes.io/name: automationservice app.kubernetes.io/name: automationservice
app.kubernetes.io/version: 0.0.1
spec: spec:
containers: containers:
- env: - env:
...@@ -56,6 +56,10 @@ spec: ...@@ -56,6 +56,10 @@ spec:
valueFrom: valueFrom:
fieldRef: fieldRef:
fieldPath: metadata.namespace fieldPath: metadata.namespace
- name: CONTEXT_SERVICE_HOST
value: context
- name: DEVICE_SERVICE_HOST
value: device
image: registry.gitlab.com/teraflow-h2020/controller/automation:0.0.1 image: registry.gitlab.com/teraflow-h2020/controller/automation:0.0.1
imagePullPolicy: Always imagePullPolicy: Always
livenessProbe: livenessProbe:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment