Commit 88e32d06 authored by Mohammad Ismaeel's avatar Mohammad Ismaeel
Browse files

Tapi

parent 39b800e1
Loading
Loading
Loading
Loading

delete_me/Dockerfile

0 → 100644
+16 −0
Original line number Diff line number Diff line
# Use the official Ubuntu image from the Docker Hub
FROM ubuntu:latest

# Update and install any required packages

RUN  apt-get update


# Set the working directory
WORKDIR /app

# Copy any necessary files into the working directory
COPY . /app

# Specify the command to run when the container starts
CMD ["echo", "Hello, Docker!"]
+6 −6
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ function crdb_deploy_single() {
            printf "%c" "."
            sleep 1
        done
        kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=300s pod/cockroachdb-0
        kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=3600s pod/cockroachdb-0
    fi
    echo

@@ -195,7 +195,7 @@ function crdb_deploy_cluster() {
        sed "s/%TFS_CRDB_NAMESPACE%/${CRDB_NAMESPACE}/g" "${CRDB_MANIFESTS_PATH}/operator.yaml" \
            > "${TMP_MANIFESTS_FOLDER}/crdb_operator.yaml"
        kubectl apply -f "${TMP_MANIFESTS_FOLDER}/crdb_operator.yaml"
        kubectl wait --namespace cockroach-operator-system --for=condition=Available=True --timeout=300s \
        kubectl wait --namespace cockroach-operator-system --for=condition=Available=True --timeout=3600s \
            deployment/cockroach-operator-manager
        #kubectl wait --namespace cockroach-operator-system --for=jsonpath='{.status.readyReplicas}'=1 --timeout=300s \
        #    deployment/cockroach-operator-manager
@@ -257,9 +257,9 @@ function crdb_deploy_cluster() {
            printf "%c" "."
            sleep 1
        done
        kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=300s pod/cockroachdb-0
        kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=300s pod/cockroachdb-1
        kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=300s pod/cockroachdb-2
        kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=3600s pod/cockroachdb-0
        kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=3600s pod/cockroachdb-1
        kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=3600s pod/cockroachdb-2
    fi
    echo

@@ -271,7 +271,7 @@ function crdb_deploy_cluster() {
        echo ">>> Deploy CockroachDB Client"
        cp "${CRDB_MANIFESTS_PATH}/client-secure-operator.yaml" "${TMP_MANIFESTS_FOLDER}/crdb_client-secure-operator.yaml"
        kubectl create --namespace ${CRDB_NAMESPACE} -f "${TMP_MANIFESTS_FOLDER}/crdb_client-secure-operator.yaml"
        kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=300s pod/cockroachdb-client-secure
        kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=3600s pod/cockroachdb-client-secure
    fi
    echo

+5 −2
Original line number Diff line number Diff line
@@ -218,7 +218,9 @@ kubectl create secret generic redis-secrets --namespace=$TFS_K8S_NAMESPACE \
echo "export REDIS_PASSWORD=${REDIS_PASSWORD}" >> $ENV_VARS_SCRIPT
printf "\n"


DOCKER_BUILD="docker build  "

DOCKER_MAJOR_VERSION=$(docker --version | grep -o -E "Docker version [0-9]+\." | grep -o -E "[0-9]+" | cut -c 1-3)
if [[ $DOCKER_MAJOR_VERSION -ge 23 ]]; then
    # If Docker version >= 23, build command was migrated to docker-buildx
@@ -230,7 +232,8 @@ if [[ $DOCKER_MAJOR_VERSION -ge 23 ]]; then
        echo "If you installed docker through APT package docker.io, consider installing also package docker-buildx"
        exit 1;
    fi
    DOCKER_BUILD="docker buildx build"
   
    DOCKER_BUILD="docker buildx build --network=host "
fi

LINKERD_STATUS="$(microk8s status -a linkerd)"
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ spec:
              command: ["/bin/grpc_health_probe", "-addr=:4040"]
          resources:
            requests:
              cpu: 250m
              cpu: 350m
              memory: 128Mi
            limits:
              cpu: 1000m
+89 −0
Original line number Diff line number Diff line
# Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (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.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: tapiservice
spec:
  selector:
    matchLabels:
      app: tapiservice
  #replicas: 1
  template:
    metadata:
      labels:
        app: tapiservice
    spec:
      terminationGracePeriodSeconds: 5
      containers:
        - name: server
          image: labs.etsi.org:5050/tfs/controller/tapi:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 10070
            - containerPort: 9192
          env:
            - name: LOG_LEVEL
              value: "INFO"
         
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: 100m
              memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
  name: tapiservice
  labels:
    app: tapiservice
spec:
  type: NodePort
  selector:
    app: tapiservice
  ports:
    - name: grpc
      protocol: TCP
      port: 10070
      targetPort: 10070
    - name: metrics
      protocol: TCP
      port: 9192
      targetPort: 9192
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: serviceservice-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: tapiservice
  minReplicas: 1
  maxReplicas: 20
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 80
  #behavior:
  #  scaleDown:
  #    stabilizationWindowSeconds: 30
Loading