Loading src/automation/target/kubernetes/kubernetes.yml +29 −9 Original line number Diff line number Diff line Loading @@ -28,12 +28,13 @@ metadata: name: automationservice spec: ports: - name: http port: 9192 targetPort: 8080 - name: grpc-server - name: grpc port: 5050 targetPort: 5050 - name: metrics protocol: TCP port: 9192 targetPort: 8080 selector: app.kubernetes.io/name: automationservice type: ClusterIP Loading Loading @@ -95,10 +96,10 @@ spec: name: automationservice ports: - containerPort: 8080 name: http name: metrics protocol: TCP - containerPort: 5050 name: grpc-server name: grpc protocol: TCP readinessProbe: failureThreshold: 3 Loading @@ -111,9 +112,28 @@ spec: successThreshold: 1 timeoutSeconds: 10 resources: limits: cpu: 500m memory: 2048Mi requests: cpu: 50m memory: 512Mi limits: cpu: 500m memory: 2048Mi --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: automationservice-hpa spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: automationservice minReplicas: 1 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 80 src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java +19 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,9 @@ import context.ContextOuterClass.ServiceId; import io.quarkus.grpc.GrpcService; import io.smallrye.mutiny.Uni; import javax.inject.Inject; import org.eclipse.microprofile.metrics.MetricUnits; import org.eclipse.microprofile.metrics.annotation.Counted; import org.eclipse.microprofile.metrics.annotation.Timed; import policy.Policy; import policy.Policy.PolicyRuleBasic; import policy.Policy.PolicyRuleDevice; Loading @@ -41,6 +44,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_policyAddService_counter") @Timed(name = "policy_policyAddService_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleState> policyAddService(PolicyRuleService request) { final var policyRuleService = serializer.deserialize(request); Loading @@ -51,6 +56,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_policyUpdateService_counter") @Timed(name = "policy_policyUpdateService_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleState> policyUpdateService(PolicyRuleService request) { final var policyRuleService = serializer.deserialize(request); Loading @@ -61,6 +68,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_policyAddDevice_counter") @Timed(name = "policy_policyAddDevice_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleState> policyAddDevice(PolicyRuleDevice request) { final var policyRuleDevice = serializer.deserialize(request); Loading @@ -71,6 +80,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_policyUpdateDevice_counter") @Timed(name = "policy_policyUpdateDevice_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleState> policyUpdateDevice(PolicyRuleDevice request) { final var policyRuleDevice = serializer.deserialize(request); Loading @@ -81,6 +92,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_policyDelete_counter") @Timed(name = "policy_policyDelete_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleState> policyDelete(PolicyRuleId request) { final var policyRuleId = serializer.deserialize(request); Loading @@ -88,6 +101,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_getPolicyService_counter") @Timed(name = "policy_getPolicyService_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleService> getPolicyService(PolicyRuleId request) { final var policyRuleBasic = PolicyRuleBasic.newBuilder().setPolicyRuleId(request).build(); Loading @@ -96,6 +111,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_getPolicyDevice_counter") @Timed(name = "policy_getPolicyDevice_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleDevice> getPolicyDevice(PolicyRuleId request) { final var policyRuleBasic = PolicyRuleBasic.newBuilder().setPolicyRuleId(request).build(); Loading @@ -104,6 +121,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_getPolicyByServiceId_counter") @Timed(name = "policy_getPolicyByServiceId_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleServiceList> getPolicyByServiceId(ServiceId request) { return Uni.createFrom().item(() -> Policy.PolicyRuleServiceList.newBuilder().build()); } Loading src/policy/target/kubernetes/kubernetes.yml +32 −13 Original line number Diff line number Diff line Loading @@ -15,12 +15,12 @@ metadata: name: policyservice spec: ports: - name: grpc-server port: 6060 targetPort: 6060 - name: http - name: metrics port: 9192 targetPort: 8080 - name: grpc port: 6060 targetPort: 6060 selector: app.kubernetes.io/name: policyservice type: ClusterIP Loading Loading @@ -63,12 +63,12 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - name: MONITORING_SERVICE_HOST value: monitoringservice - name: CONTEXT_SERVICE_HOST value: contextservice - name: SERVICE_SERVICE_HOST value: serviceservice - name: CONTEXT_SERVICE_HOST value: contextservice - name: MONITORING_SERVICE_HOST value: monitoringservice image: labs.etsi.org:5050/tfs/controller/policy:0.1.0 imagePullPolicy: Always livenessProbe: Loading @@ -84,10 +84,10 @@ spec: name: policyservice ports: - containerPort: 6060 name: grpc-server name: grpc protocol: TCP - containerPort: 8080 name: http name: metrics protocol: TCP readinessProbe: failureThreshold: 3 Loading @@ -100,9 +100,28 @@ spec: successThreshold: 1 timeoutSeconds: 10 resources: limits: cpu: 500m memory: 2048Mi requests: cpu: 50m memory: 512Mi limits: cpu: 500m memory: 2048Mi --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: policyservice-hpa spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: policyservice minReplicas: 1 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 80 manifests/servicemonitors.yaml +1 −1 File changed.Contains only whitespace changes. Show changes Loading
src/automation/target/kubernetes/kubernetes.yml +29 −9 Original line number Diff line number Diff line Loading @@ -28,12 +28,13 @@ metadata: name: automationservice spec: ports: - name: http port: 9192 targetPort: 8080 - name: grpc-server - name: grpc port: 5050 targetPort: 5050 - name: metrics protocol: TCP port: 9192 targetPort: 8080 selector: app.kubernetes.io/name: automationservice type: ClusterIP Loading Loading @@ -95,10 +96,10 @@ spec: name: automationservice ports: - containerPort: 8080 name: http name: metrics protocol: TCP - containerPort: 5050 name: grpc-server name: grpc protocol: TCP readinessProbe: failureThreshold: 3 Loading @@ -111,9 +112,28 @@ spec: successThreshold: 1 timeoutSeconds: 10 resources: limits: cpu: 500m memory: 2048Mi requests: cpu: 50m memory: 512Mi limits: cpu: 500m memory: 2048Mi --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: automationservice-hpa spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: automationservice minReplicas: 1 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 80
src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java +19 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,9 @@ import context.ContextOuterClass.ServiceId; import io.quarkus.grpc.GrpcService; import io.smallrye.mutiny.Uni; import javax.inject.Inject; import org.eclipse.microprofile.metrics.MetricUnits; import org.eclipse.microprofile.metrics.annotation.Counted; import org.eclipse.microprofile.metrics.annotation.Timed; import policy.Policy; import policy.Policy.PolicyRuleBasic; import policy.Policy.PolicyRuleDevice; Loading @@ -41,6 +44,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_policyAddService_counter") @Timed(name = "policy_policyAddService_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleState> policyAddService(PolicyRuleService request) { final var policyRuleService = serializer.deserialize(request); Loading @@ -51,6 +56,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_policyUpdateService_counter") @Timed(name = "policy_policyUpdateService_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleState> policyUpdateService(PolicyRuleService request) { final var policyRuleService = serializer.deserialize(request); Loading @@ -61,6 +68,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_policyAddDevice_counter") @Timed(name = "policy_policyAddDevice_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleState> policyAddDevice(PolicyRuleDevice request) { final var policyRuleDevice = serializer.deserialize(request); Loading @@ -71,6 +80,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_policyUpdateDevice_counter") @Timed(name = "policy_policyUpdateDevice_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleState> policyUpdateDevice(PolicyRuleDevice request) { final var policyRuleDevice = serializer.deserialize(request); Loading @@ -81,6 +92,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_policyDelete_counter") @Timed(name = "policy_policyDelete_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleState> policyDelete(PolicyRuleId request) { final var policyRuleId = serializer.deserialize(request); Loading @@ -88,6 +101,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_getPolicyService_counter") @Timed(name = "policy_getPolicyService_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleService> getPolicyService(PolicyRuleId request) { final var policyRuleBasic = PolicyRuleBasic.newBuilder().setPolicyRuleId(request).build(); Loading @@ -96,6 +111,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_getPolicyDevice_counter") @Timed(name = "policy_getPolicyDevice_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleDevice> getPolicyDevice(PolicyRuleId request) { final var policyRuleBasic = PolicyRuleBasic.newBuilder().setPolicyRuleId(request).build(); Loading @@ -104,6 +121,8 @@ public class PolicyGatewayImpl implements PolicyGateway { } @Override @Counted(name = "policy_getPolicyByServiceId_counter") @Timed(name = "policy_getPolicyByServiceId_histogram", unit = MetricUnits.MILLISECONDS) public Uni<PolicyRuleServiceList> getPolicyByServiceId(ServiceId request) { return Uni.createFrom().item(() -> Policy.PolicyRuleServiceList.newBuilder().build()); } Loading
src/policy/target/kubernetes/kubernetes.yml +32 −13 Original line number Diff line number Diff line Loading @@ -15,12 +15,12 @@ metadata: name: policyservice spec: ports: - name: grpc-server port: 6060 targetPort: 6060 - name: http - name: metrics port: 9192 targetPort: 8080 - name: grpc port: 6060 targetPort: 6060 selector: app.kubernetes.io/name: policyservice type: ClusterIP Loading Loading @@ -63,12 +63,12 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - name: MONITORING_SERVICE_HOST value: monitoringservice - name: CONTEXT_SERVICE_HOST value: contextservice - name: SERVICE_SERVICE_HOST value: serviceservice - name: CONTEXT_SERVICE_HOST value: contextservice - name: MONITORING_SERVICE_HOST value: monitoringservice image: labs.etsi.org:5050/tfs/controller/policy:0.1.0 imagePullPolicy: Always livenessProbe: Loading @@ -84,10 +84,10 @@ spec: name: policyservice ports: - containerPort: 6060 name: grpc-server name: grpc protocol: TCP - containerPort: 8080 name: http name: metrics protocol: TCP readinessProbe: failureThreshold: 3 Loading @@ -100,9 +100,28 @@ spec: successThreshold: 1 timeoutSeconds: 10 resources: limits: cpu: 500m memory: 2048Mi requests: cpu: 50m memory: 512Mi limits: cpu: 500m memory: 2048Mi --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: policyservice-hpa spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: policyservice minReplicas: 1 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 80