From aa8541cd42120ff91ef0573b05beb1e1d0861617 Mon Sep 17 00:00:00 2001 From: kpoulakakis <kpoulakakis@ubitech.eu> Date: Wed, 14 Feb 2024 15:14:13 +0200 Subject: [PATCH] refactor: spotless apply and kubernetes --- .../ExternalServiceFailureException.java | 28 ++-- .../exception/GeneralExceptionHandler.java | 28 ++-- .../tfs/policy/exception/NewException.java | 28 ---- .../policy/policy/model/PolicyRuleBase.java | 28 ++-- src/policy/target/kubernetes/kubernetes.yml | 133 ++++++++++++++++++ 5 files changed, 175 insertions(+), 70 deletions(-) delete mode 100644 src/policy/src/main/java/org/etsi/tfs/policy/exception/NewException.java create mode 100644 src/policy/target/kubernetes/kubernetes.yml diff --git a/src/policy/src/main/java/org/etsi/tfs/policy/exception/ExternalServiceFailureException.java b/src/policy/src/main/java/org/etsi/tfs/policy/exception/ExternalServiceFailureException.java index 9e11822f6..5b45d0499 100644 --- a/src/policy/src/main/java/org/etsi/tfs/policy/exception/ExternalServiceFailureException.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/exception/ExternalServiceFailureException.java @@ -1,18 +1,18 @@ /* - * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ package org.etsi.tfs.policy.exception; diff --git a/src/policy/src/main/java/org/etsi/tfs/policy/exception/GeneralExceptionHandler.java b/src/policy/src/main/java/org/etsi/tfs/policy/exception/GeneralExceptionHandler.java index f2d3a97d2..57842aaa6 100644 --- a/src/policy/src/main/java/org/etsi/tfs/policy/exception/GeneralExceptionHandler.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/exception/GeneralExceptionHandler.java @@ -1,18 +1,18 @@ /* - * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ package org.etsi.tfs.policy.exception; diff --git a/src/policy/src/main/java/org/etsi/tfs/policy/exception/NewException.java b/src/policy/src/main/java/org/etsi/tfs/policy/exception/NewException.java deleted file mode 100644 index 9bc8cd02d..000000000 --- a/src/policy/src/main/java/org/etsi/tfs/policy/exception/NewException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.etsi.tfs.policy.exception; - -public class NewException extends RuntimeException { - - public NewException(String message, Exception e) { - super(message, e); - } - - public NewException(String message) { - super(message); - } -} diff --git a/src/policy/src/main/java/org/etsi/tfs/policy/policy/model/PolicyRuleBase.java b/src/policy/src/main/java/org/etsi/tfs/policy/policy/model/PolicyRuleBase.java index 76f073b5c..6fb98c722 100644 --- a/src/policy/src/main/java/org/etsi/tfs/policy/policy/model/PolicyRuleBase.java +++ b/src/policy/src/main/java/org/etsi/tfs/policy/policy/model/PolicyRuleBase.java @@ -1,18 +1,18 @@ /* - * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ package org.etsi.tfs.policy.policy.model; diff --git a/src/policy/target/kubernetes/kubernetes.yml b/src/policy/target/kubernetes/kubernetes.yml new file mode 100644 index 000000000..bdcfcad5f --- /dev/null +++ b/src/policy/target/kubernetes/kubernetes.yml @@ -0,0 +1,133 @@ +--- +apiVersion: v1 +kind: Service +metadata: + annotations: + app.quarkus.io/commit-id: 5af252b6acd7e8bc36acbb668cc6f1f0405346f1 + app.quarkus.io/build-timestamp: 2024-02-14 - 13:13:25 +0000 + prometheus.io/scrape: "true" + prometheus.io/path: /q/metrics + prometheus.io/port: "8080" + prometheus.io/scheme: http + labels: + app.kubernetes.io/name: policyservice + app.kubernetes.io/version: 0.1.0 + app: policyservice + app.kubernetes.io/managed-by: quarkus + name: policyservice +spec: + ports: + - name: https + port: 443 + protocol: TCP + targetPort: 8443 + - name: http + port: 9192 + protocol: TCP + targetPort: 8080 + - name: grpc + port: 6060 + protocol: TCP + targetPort: 6060 + selector: + app.kubernetes.io/name: policyservice + type: ClusterIP +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + app.quarkus.io/commit-id: 5af252b6acd7e8bc36acbb668cc6f1f0405346f1 + app.quarkus.io/build-timestamp: 2024-02-14 - 13:13:25 +0000 + prometheus.io/scrape: "true" + prometheus.io/path: /q/metrics + prometheus.io/port: "8080" + prometheus.io/scheme: http + labels: + app: policyservice + app.kubernetes.io/managed-by: quarkus + app.kubernetes.io/version: 0.1.0 + app.kubernetes.io/name: policyservice + name: policyservice +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: policyservice + template: + metadata: + annotations: + app.quarkus.io/commit-id: 5af252b6acd7e8bc36acbb668cc6f1f0405346f1 + app.quarkus.io/build-timestamp: 2024-02-14 - 13:13:25 +0000 + prometheus.io/scrape: "true" + prometheus.io/path: /q/metrics + prometheus.io/port: "8080" + prometheus.io/scheme: http + labels: + app: policyservice + app.kubernetes.io/managed-by: quarkus + app.kubernetes.io/version: 0.1.0 + app.kubernetes.io/name: policyservice + spec: + containers: + - env: + - name: KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: CONTEXT_SERVICE_HOST + value: contextservice + - name: SERVICE_SERVICE_HOST + value: serviceservice + - name: MONITORING_SERVICE_HOST + value: monitoringservice + image: labs.etsi.org:5050/tfs/controller/policy:0.1.0 + imagePullPolicy: Always + livenessProbe: + failureThreshold: 3 + httpGet: + path: /q/health/live + port: 8080 + scheme: HTTP + initialDelaySeconds: 2 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 + name: policyservice + ports: + - containerPort: 8443 + name: https + protocol: TCP + - containerPort: 8080 + name: http + protocol: TCP + - containerPort: 6060 + name: grpc + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /q/health/ready + port: 8080 + scheme: HTTP + initialDelaySeconds: 2 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 + resources: + limits: + cpu: 500m + memory: 2048Mi + requests: + cpu: 50m + memory: 512Mi + startupProbe: + failureThreshold: 3 + httpGet: + path: /q/health/started + port: 8080 + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 -- GitLab