Commit 5fc6376d authored by kesnar's avatar kesnar
Browse files

chore: cleanup

parent ef293e0c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ echo "Create secret with NATS data"
NATS_CLIENT_PORT=$(kubectl --namespace ${NATS_NAMESPACE} get service ${NATS_NAMESPACE} -o 'jsonpath={.spec.ports[?(@.name=="client")].port}')
kubectl create secret generic nats-data --namespace ${TFS_K8S_NAMESPACE} --type='Opaque' \
    --from-literal=NATS_NAMESPACE=${NATS_NAMESPACE} \
    --from-literal=NATS_CLIENT_PORT="4222"
    --from-literal=NATS_CLIENT_PORT=${NATS_CLIENT_PORT}
printf "\n"

echo "Create secret with QuestDB data"
+19 −19
Original line number Diff line number Diff line
@@ -108,22 +108,22 @@ spec:
            limits:
              cpu: 2000m
              memory: 2048Mi
              #---
              #apiVersion: autoscaling/v2
              #kind: HorizontalPodAutoscaler
              #metadata:
              #  name: policyservice-hpa
              #spec:
              #  scaleTargetRef:
              #    apiVersion: apps/v1
              #    kind: Deployment
              #    name: policyservice
              #  minReplicas: 1
              #  maxReplicas: 1
              #  metrics:
              #  - type: Resource
              #    resource:
              #      name: cpu
              #      target:
              #        type: Utilization
              #        averageUtilization: 80
---
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
+6 −9
Original line number Diff line number Diff line
@@ -23,13 +23,10 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/"
export TFS_COMPONENTS="context device pathcomp service slice compute webui load_generator"

# Uncomment to activate Monitoring
export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"

# Uncomment to activate Policy Manager
export TFS_COMPONENTS="${TFS_COMPONENTS} policy"

# Uncomment to activate Automation Manager
#export TFS_COMPONENTS="${TFS_COMPONENTS} automation"
# Uncomment to activate Automation and Policy Manager
#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy"

# Uncomment to activate Optical CyberSecurity
#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager"
@@ -59,7 +56,7 @@ export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yam
export TFS_GRAFANA_PASSWORD="admin123+"

# Disable skip-build flag to rebuild the Docker images.
export TFS_SKIP_BUILD="YES"
export TFS_SKIP_BUILD=""


# ----- CockroachDB ------------------------------------------------------------
@@ -87,7 +84,7 @@ export CRDB_DATABASE="tfs"
export CRDB_DEPLOY_MODE="single"

# Disable flag for dropping database, if it exists.
export CRDB_DROP_DATABASE_IF_EXISTS="YES"
export CRDB_DROP_DATABASE_IF_EXISTS=""

# Disable flag for re-deploying CockroachDB from scratch.
export CRDB_REDEPLOY=""
@@ -135,7 +132,7 @@ export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis"
export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups"

# Disable flag for dropping tables if they exist.
export QDB_DROP_TABLES_IF_EXIST="YES"
export QDB_DROP_TABLES_IF_EXIST=""

# Disable flag for re-deploying QuestDB from scratch.
export QDB_REDEPLOY=""
+0 −1
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ class P4Driver(_Driver):
        self.__settings = settings
        self.__id = None
        self.__name = DRIVER_NAME
        self._name = None
        self.__vendor = P4_VAL_DEF_VENDOR
        self.__hw_version = P4_VAL_DEF_HW_VER
        self.__sw_version = P4_VAL_DEF_SW_VER
+2 −8
Original line number Diff line number Diff line
@@ -198,9 +198,7 @@ public class PolicyServiceImpl implements PolicyService {
                                return policyRuleState;
                            }
                            contextService.setPolicyRule(policyRule).subscribe().with(x -> {});
                            LOGGER.infof("THIS IS A TEST! 1");
                            setPolicyRuleServiceToContext(policyRuleService, VALIDATED_POLICYRULE_STATE);
                            LOGGER.infof("THIS IS A TEST! 2");
                            noAlarms = 0;

                            // Create an alarmIds list that contains the promised ids returned from setKpiAlarm
@@ -210,8 +208,7 @@ public class PolicyServiceImpl implements PolicyService {
                                LOGGER.infof(alarmDescriptor.toString());
                                alarmIds.add(monitoringService.setKpiAlarm(alarmDescriptor));
                            }
                            LOGGER.infof("THIS IS A TEST!");
                            LOGGER.infof("%s", alarmIds);

                            // Transform the alarmIds into promised alarms returned from the
                            // getAlarmResponseStream
                            List<Multi<AlarmResponse>> alarmResponseStreamList = new ArrayList<>();
@@ -728,8 +725,7 @@ public class PolicyServiceImpl implements PolicyService {
            // TODO: Temp fix for AlarmDescriptor object
            AlarmDescriptor alarmDescriptor =
                    new AlarmDescriptor(
                            //"alarmId-" + gen(),
                            null,
                            "alarmId-" + gen(),
                            "alarmDescription",
                            "alarmName-" + gen(),
                            policyRuleCondition.getKpiId(),
@@ -774,7 +770,6 @@ public class PolicyServiceImpl implements PolicyService {
        final var kpiValueRange = convertPolicyRuleConditionToKpiValueRange(policyRuleCondition);

        return new AlarmDescriptor(
                            //"alarmId-" + gen(),
                "alarmId-" + gen(),
                "alarmDescription",
                "alarmName-" + gen(),
@@ -805,7 +800,6 @@ public class PolicyServiceImpl implements PolicyService {
        }

        return new AlarmDescriptor(
                            //"alarmId-" + gen(),
                "alarmId-" + gen(),
                "alarmDescription",
                "alarmName-" + gen(),
Loading