diff --git a/api/main.py b/api/main.py index bb2cba87..a37fe25e 100644 --- a/api/main.py +++ b/api/main.py @@ -61,6 +61,7 @@ UserGroup, ) from .metrics import Metrics +from .maintenance import purge_old_nodes @asynccontextmanager @@ -1088,6 +1089,17 @@ async def get_metrics(): return PlainTextResponse(response) +@app.get('/maintenance/purge-old-nodes') +async def purge_old_nodes(current_user: User = Depends(get_current_superuser)): + """Purge old nodes from the database + This is a maintenance operation and should be performed + only by superusers. + """ + metrics.add('http_requests_total', 1) + await purge_old_nodes() + return "OK" + + versioned_app = VersionedFastAPI( app, version_format='{major}', diff --git a/api/maintenance.py b/api/maintenance.py new file mode 100644 index 00000000..fe098534 --- /dev/null +++ b/api/maintenance.py @@ -0,0 +1,33 @@ +from pymongo import MongoClient +import datetime +import os + + +def purge_ids(db, collection, ids): + print("Purging", len(ids), "from", collection) + db[collection].delete_many({"_id": {"$in": ids}}) + + +def connect_to_db(): + mongo_service = os.environ["MONGO_SERVICE"] + if not mongo_service: + raise ValueError("MONGO_SERVICE environment variable is not set") + client = MongoClient(mongo_service) + db = client["kernelci"] + return db + + +async def purge_old_nodes(age_days=180): + date_end = datetime.datetime.today() - datetime.timedelta(days=age_days) + db = connect_to_db() + nodes = db["nodes"].find({"created": {"$lt": date_end}}) + # We need to delete node in chunks of 1000, + # to not block the main thread for too long + del_batch = [] + for node in nodes: + del_batch.append(node["_id"]) + if len(del_batch) == 1000: + purge_ids(db, "nodes", del_batch) + del_batch = [] + if del_batch: + purge_ids(db, "nodes", del_batch) diff --git a/kube/aks/api.yaml b/kube/aks/api.yaml index dbd0b541..614ea0e5 100644 --- a/kube/aks/api.yaml +++ b/kube/aks/api.yaml @@ -19,9 +19,13 @@ spec: labels: app: api spec: + initContainers: + - name: wait-for-mongo + image: busybox + command: ["sh", "-c", "until nc -z mongo.kernelci-api.svc.cluster.local 27017; do echo waiting for mongo; sleep 2; done"] containers: - name: api - image: kernelci/api + image: kernelci/kernelci:api imagePullPolicy: Always resources: requests: diff --git a/kube/minikube/README.md b/kube/minikube/README.md deleted file mode 100644 index 0c08ef88..00000000 --- a/kube/minikube/README.md +++ /dev/null @@ -1,151 +0,0 @@ -Getting Started with KernelCI API in Minikube -============================================= - -## Forking GitHub Repository in the Minikube node - -### init/init-job.yaml - -Simply run the following from the root of the kube/minikube folder and it will run a Kubernetes job that will fork the kernelci-api official github repository and will use hostPath based volume persisting mechanism to persist the job-based pod data on the Minikube node. -``` -kubectl apply -f init/init-job.yaml -``` -Thus the data will remain on the Minikube node in /home/docker/kernelci-api folder even after the pod gets deleted. You can verify this by simply SSHing into Minikube node and finding the mentioned directory. - -To SSH into Minikube node simply run -``` -minikube ssh -``` - -### init/init-pod.yaml - -Simply run the following command to use init-pod.yaml instead of init-job.yaml from the root of the kube/minikube folder. -``` -kubectl apply -f init/init-pod.yaml -``` -In the case of init-pod.yaml, everything would essentially be the same except for the case that pods are not good at the tasks that ends at certain point and for that specific reason we prefer init-job.yaml. Here to forcefully keep the pod persisting and stopping it from failing we used the command ```tail -f /dev/null```. Thus it would be more resource intensive than init-job.yaml. Except for this everything would be the same - -### re-running or reinitializing the init-job.yaml or init-pod.yaml - -To re-run or reinitialize the init-pod.yaml or init-job.yaml, first of all you need to clean the existing ```/home/docker/kernelci-api``` directory in the minikube node, otherwise the associated pods would throw an error as the directory would not be empty at the time of re-running or reinitialization. So in order to avoid these errors and prevent pods associated with init-jobs.yaml or init-pods.yaml from failing, simply run the following command before applying or reconfiguring any of these yaml files if you haven't done complete clean-up and are not starting afresh. -``` -minikube ssh -- sudo rm -rf /home/docker/kernelci-api -``` - -### manually forking github repo in minikube node without using pods or jobs - -To achieve this we need to ssh into minikube using ```minikube ssh``` and then we need to manually download git using ```sudo apt update``` and ```sudo apt git```. After that we can manually clone the official kernelci-api github repository. This is not a recommended method, as manually doing a task that can be automated is against one of the Larry Wall's three virtues of programmers i.e. laziness. Also, things that requires frequent manual tunneling can be a security threat. To update your cloned git repo, you can simply use ```git pull``` command to merge the latest changes. - -## Creating a Kubernetes secret - -To create a Kubernetes secret with name my-secret and store its value as key-value pair with the key named secret-key run the following command. -``` -kubectl create secret generic kernelci-api-secret --from-literal=secret-key=$(openssl rand -hex 32) -``` - -To check your secret in base64 encoded form use - -``` -kubectl get secret kernelci-api-secret -o jsonpath='{.data.secret-key}' -``` - -To decode your secret key and get the original data use -``` -kubectl get secret kernelci-api-secret -o jsonpath='{.data.secret-key}' | base64 -d -``` - -To encode your already encoded base64 key using base64 encryption i.e. to double encode your key in base64 format use -``` -kubectl get secret kernelci-api-secret -o jsonpath='{.data.secret-key}' | base64 - -``` - -## Setting up persistent volume claim - -Simply run the following command from the roots of the kube/minikube folder to set up the pvc. -``` -kubectl apply -f pvc/db-pvc.yaml -``` - -To monitor your pvc use -``` -kubectl get pvc -``` - -## Setting up the services - -Simply run the following command from the root of kube/minikube/services folder to set up all the services. -``` -kubectl apply -f . -``` - -To check your services, run -``` -kubectl get svc -``` - -To port-forward api-service, run -``` -kubectl port-forward svc/kernelci-api 8001:8001 -``` - -To port-forward ssh-service, run -``` -kubectl port-forward svc/kernelci-api-ssh 8022:8022 -``` - -To port-forward storage-service, run -``` -kubectl port-forward svc/kernelci-api-storage 8002:8002 -``` - -To port-forward to redis-service, run -``` -kubectl port-forward svc/kernelci-api-redis 6379:6379 -``` - -To port-forward to db-service, run -``` -kubectl port-forward svc/kernelci-api-db 27017:27017 -``` - -To ensure api connections are handled properly, assign the value ```kernelci-api-redis.default.svc.cluster.local``` to ```redis_host``` variable present in the file api/pubsub.py. - -## Getting deployments up and running - -It is important to run all the above given steps and wait for them to be executed successfully before getting your deployments up and running. - -Simply run the following command from the roots of kube/minikube/deployments folder to get all the deployments up and running. -``` -kubectl apply -f . -``` - -To monitor whether the deployments have setup the pods successfully or not you can use -``` -kubectl get pods -``` - -To log any accidental error persisting in your pods use -``` -kubectl logs -``` - -## Getting api-deployment up and running - -As kernelci-api relies on other deployments, it is important to get them up and running first and get kernelci-api up and running afterwards. Thus after completing all the above steps, you can apply ```api-deployment.yaml``` file that is present in the root of kube/minikube folder. To apply the YAML file in the minikube cluster, simply run -``` -kubectl apply -f api-deployment.yaml -``` - -## Cleaning up everything afterwards - -To clean up everything simply use the ```clean-all.sh``` script provided in the root of the kube/minikube/scripts folder by running -``` -./clean-all.sh -``` - -## Deploying all the resources at once - -To apply all the resources at once, you can use the ```deploy.sh``` script provided in the root of the kube/minikube/scripts folder by running -``` -./deploy.sh -``` -This script would also do the clean up and will deploy everything afresh. But it can be time-consuming to deploy everything afresh, so if you want to reconfigure some deployment maybe because the image is updated, just reapply that deployment or do the rolling update instead of running this script. diff --git a/kube/minikube/api-deployment.yaml b/kube/minikube/api-deployment.yaml deleted file mode 100644 index 3ab7c395..00000000 --- a/kube/minikube/api-deployment.yaml +++ /dev/null @@ -1,79 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: kernelci-api -spec: - replicas: 1 - selector: - matchLabels: - app: kernelci-api - template: - metadata: - labels: - app: kernelci-api - spec: - containers: - - name: api - image: sbdtu5498/kernelci-api:api - imagePullPolicy: Always - ports: - - containerPort: 8000 - env: - - name: SECRET_KEY - valueFrom: - secretKeyRef: - name: kernelci-api-secret - key: secret-key - - name: REDIS_HOST - valueFrom: - configMapKeyRef: - name: kernelci-api-config - key: redis_host - - name: MONGO_SERVICE - valueFrom: - configMapKeyRef: - name: kernelci-api-config - key: mongo_service - - name: EMAIL_SENDER - valueFrom: - configMapKeyRef: - name: kernelci-api-config - key: email_sender - - name: EMAIL_PASSWORD - valueFrom: - secretKeyRef: - name: kernelci-api-secret - key: email-password - - name: SMTP_HOST - valueFrom: - configMapKeyRef: - name: kernelci-api-config - key: smtp_host - - name: SMTP_PORT - valueFrom: - configMapKeyRef: - name: kernelci-api-config - key: smtp_port - volumeMounts: - - name: api-volume - mountPath: /home/kernelci/api - - name: tests-volume - mountPath: /home/kernelci/tests - - name: migrations-volume - mountPath: /home/kernelci/migrations - # Resource limits needs to be discussed. - resources: - volumes: - - name: api-volume - hostPath: - path: /home/docker/kernelci-api/api - - name: tests-volume - hostPath: - path: /home/docker/kernelci-api/tests - - name: migrations-volume - hostPath: - path: /home/docker/kernelci-api/migrations diff --git a/kube/minikube/configmap/api-configmap.yaml b/kube/minikube/configmap/api-configmap.yaml deleted file mode 100644 index b553edd9..00000000 --- a/kube/minikube/configmap/api-configmap.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Collabora Limited -# Author: Jeny Sadadia - -apiVersion: v1 -kind: ConfigMap -metadata: - name: kernelci-api-config - namespace: default -data: - redis_host: "kernelci-api-redis.default.svc.cluster.local" - mongo_service: "mongodb://kernelci-api-db.default.svc.cluster.local:27017" - email_sender: "sample@kernelci.org" - smtp_host: "smtp.gmail.com" - smtp_port: "465" diff --git a/kube/minikube/deployments/db-deployment.yaml b/kube/minikube/deployments/db-deployment.yaml deleted file mode 100644 index a7bbf130..00000000 --- a/kube/minikube/deployments/db-deployment.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: kernelci-api-db -spec: - replicas: 1 - selector: - matchLabels: - app: kernelci-api-db - template: - metadata: - labels: - app: kernelci-api-db - spec: - containers: - - name: kernelci-api-db - image: mongo:5.0 - volumeMounts: - - name: mongo-data - mountPath: /data/db - # Resource limits need to be discussed. - resources: - ports: - - containerPort: 27017 # Expose MongoDB standard port - volumes: - - name: mongo-data - persistentVolumeClaim: - claimName: mongo-data-pvc diff --git a/kube/minikube/deployments/redis-deployment.yaml b/kube/minikube/deployments/redis-deployment.yaml deleted file mode 100644 index 42b378e8..00000000 --- a/kube/minikube/deployments/redis-deployment.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: kernelci-api-redis -spec: - replicas: 1 - selector: - matchLabels: - app: kernelci-api-redis - template: - metadata: - labels: - app: kernelci-api-redis - spec: - containers: - - name: kernelci-api-redis - image: redis:6.2 - volumeMounts: - - name: redis-data - mountPath: /data - # Resource limits needs to be discussed. - resources: - ports: - - containerPort: 6379 # Expose Redis standard port - volumes: - - name: redis-data - hostPath: - path: /home/docker/kernelci-api/docker/redis/data diff --git a/kube/minikube/deployments/ssh-deployment.yaml b/kube/minikube/deployments/ssh-deployment.yaml deleted file mode 100644 index 35f4f2c6..00000000 --- a/kube/minikube/deployments/ssh-deployment.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -# This deployment may need some security checks. - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: kernelci-api-ssh -spec: - replicas: 1 - selector: - matchLabels: - app: kernelci-api-ssh - template: - metadata: - labels: - app: kernelci-api-ssh - spec: - containers: - - name: build - image: sbdtu5498/kernelci-api:ssh - ports: - - containerPort: 22 - volumeMounts: - - name: user-data - mountPath: /home/kernelci/.ssh - - name: storage-data - mountPath: /home/kernelci/data - # Resource limits needs to be discussed. - resources: - volumes: - - name: user-data - hostPath: - path: /home/docker/kernelci-api/docker/ssh/user-data - - name: storage-data - hostPath: - path: /home/docker/kernelci-api/docker/storage/data diff --git a/kube/minikube/deployments/storage-deployment.yaml b/kube/minikube/deployments/storage-deployment.yaml deleted file mode 100644 index 46c5b7e8..00000000 --- a/kube/minikube/deployments/storage-deployment.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: kernelci-api-storage -spec: - replicas: 1 - selector: - matchLabels: - app: kernelci-api-storage - template: - metadata: - labels: - app: kernelci-api-storage - spec: - containers: - - name: kernelci-api-storage - image: nginx:1.21.3 - ports: - - containerPort: 80 - volumeMounts: - - name: storage-data - mountPath: /usr/share/nginx/html - - name: storage-config - mountPath: /etc/nginx/conf.d/default.conf - # Resource limits needs to be discussed. - resources: - volumes: - - name: storage-data - hostPath: - path: /home/docker/kernelci-api/docker/storage/data - - name: storage-config - hostPath: - path: /home/docker/kernelci-api/docker/storage/config/default.conf diff --git a/kube/minikube/init/init-job.yaml b/kube/minikube/init/init-job.yaml deleted file mode 100644 index 28212a11..00000000 --- a/kube/minikube/init/init-job.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -apiVersion: batch/v1 -kind: Job -metadata: - name: github-cloning-job -spec: - template: - spec: - containers: - - name: github-cloning-container - image: alpine/git - command: ["git", "clone", "https://github.com/kernelci/kernelci-api.git", "/home/kernelci-api"] - volumeMounts: - - name: github-repo - mountPath: /home/kernelci-api - restartPolicy: Never - volumes: - - name: github-repo - hostPath: - path: /home/docker/kernelci-api - type: DirectoryOrCreate - backoffLimit: 1 diff --git a/kube/minikube/init/init-pod.yaml b/kube/minikube/init/init-pod.yaml deleted file mode 100644 index e825d034..00000000 --- a/kube/minikube/init/init-pod.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -apiVersion: v1 -kind: Pod -metadata: - name: git-clone-pod -spec: - containers: - - name: git-clone-container - image: alpine/git:latest - command: ["sh", "-c", "git clone https://github.com/kernelci/kernelci-api.git /data && tail -f /dev/null"] - volumeMounts: - - name: data-volume - mountPath: /data - # resource limits needs to be discussed - resources: - volumes: - - name: data-volume - hostPath: - path: /home/docker/kernelci-api diff --git a/kube/minikube/pvc/db-pvc.yaml b/kube/minikube/pvc/db-pvc.yaml deleted file mode 100644 index 841cd6cb..00000000 --- a/kube/minikube/pvc/db-pvc.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: mongo-data-pvc -spec: - # HostPath is only for single node testing only. - # For multi node testing local volume can be used. - # Need to create a storage class for local volume and test it on multi node cluster. - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi diff --git a/kube/minikube/scripts/clean-all.sh b/kube/minikube/scripts/clean-all.sh deleted file mode 100755 index 8f5d141e..00000000 --- a/kube/minikube/scripts/clean-all.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Clean up the existing /home/docker/kernelci-api directory in Minikube node -minikube ssh -- sudo rm -rf /home/docker/kernelci-api - -# Delete Deployments -kubectl delete -f ../api-deployment.yaml --ignore-not-found -kubectl delete -f ../deployments/db-deployment.yaml --ignore-not-found -kubectl delete -f ../deployments/redis-deployment.yaml --ignore-not-found -kubectl delete -f ../deployments/ssh-deployment.yaml --ignore-not-found -kubectl delete -f ../deployments/storage-deployment.yaml --ignore-not-found - -# Wait for pods associated with the deployments to be terminated -while kubectl get pods | grep -E "kernelci-api|kernelci-api-db|kernelci-api-redis|kernelci-api-ssh|kernelci-api-storage"; do - echo "Waiting for pods to be terminated..." - sleep 5 -done - -# Delete Services -kubectl delete -f ../services/api-service.yaml --ignore-not-found -kubectl delete -f ../services/db-service.yaml --ignore-not-found -kubectl delete -f ../services/redis-service.yaml --ignore-not-found -kubectl delete -f ../services/ssh-service.yaml --ignore-not-found -kubectl delete -f ../services/storage-service.yaml --ignore-not-found - -# Delete PersistentVolumeClaims -kubectl delete -f ../pvc/db-pvc.yaml --ignore-not-found - -# Delete Init Job and Pod -kubectl delete -f ../init/init-job.yaml --ignore-not-found -kubectl delete -f ../init/init-pod.yaml --ignore-not-found - -# Delete Secret -kubectl delete secret kernelci-api-secret --ignore-not-found diff --git a/kube/minikube/scripts/deploy.sh b/kube/minikube/scripts/deploy.sh deleted file mode 100755 index 3fcc51b6..00000000 --- a/kube/minikube/scripts/deploy.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash - -# Run the clean-all.sh script -source clean-all.sh - -# Function to check if a resource exists -check_resource_exist() { - local kind=$1 - local name=$2 - - # Wait for the resource to be available - while [[ -z "$(kubectl get $kind $name -o json)" ]]; do - echo "Waiting for $kind $name to be available..." - sleep 5 - done - - echo "$kind $name is available!" -} - -# Function to check if a resource is bound (for PVCs) -check_pvc_bound() { - local name=$1 - - # Wait for the PVC to be bound - while [[ "$(kubectl get pvc $name -o 'jsonpath={.status.phase}')" != "Bound" ]]; do - echo "Waiting for PVC $name to be bound..." - sleep 5 - done - - echo "PVC $name is bound!" -} - -# Function to check if a resource is ready (for Deployments) -check_deployment_ready() { - local name=$1 - - # Wait for the Deployment to have available replicas - while [[ "$(kubectl get deployment $name -o 'jsonpath={.status.availableReplicas}')" != "$(kubectl get deployment $name -o 'jsonpath={.status.replicas}')" ]]; do - echo "Waiting for Deployment $name to have available replicas..." - sleep 5 - done - - echo "Deployment $name is ready!" -} - -# Function to check if a resource is completed (for Jobs) -check_job_completed() { - local name=$1 - - # Wait for the Job to be completed - while [[ "$(kubectl get job $name -o 'jsonpath={.status.conditions[?(@.type=="Complete")].status}')" != "True" ]]; do - echo "Waiting for Job $name to be completed..." - sleep 5 - done - - echo "Job $name is completed!" -} - -# Function to apply a resource and check if it is ready or completed (for Jobs) -apply_and_check_resource() { - local file=$1 - - kubectl apply -f "$file" - - # Get the resource kind and name from the file - kind=$(kubectl get -f "$file" -o 'jsonpath={.kind}') - name=$(kubectl get -f "$file" -o 'jsonpath={.metadata.name}') - - case "$kind" in - "Job") - check_job_completed "$name" - ;; - "Deployment") - check_deployment_ready "$name" - ;; - *) - ;; - esac -} - -# Fork GitHub repository in Minikube node -kubectl apply -f ../init/init-job.yaml -check_job_completed "github-cloning-job" - -# Create Kubernetes secret -kubectl create secret generic kernelci-api-secret --from-literal=secret-key=$(openssl rand -hex 32) -check_resource_exist "Secret" "kernelci-api-secret" - -# Generate configmap -kubectl create -f ../configmap/api-configmap.yaml -check_resource_exist "configmaps" "kernelci-api-config" - -# Set up persistent volume claim -kubectl apply -f ../pvc/db-pvc.yaml -check_pvc_bound "mongo-data-pvc" - -# Apply all the services -for file in ../services/*.yaml; do - kubectl apply -f "$file" -done - -# Apply all the deployments -for file in ../deployments/*.yaml; do - apply_and_check_resource "$file" -done - -# Apply the api-deployment.yaml -kubectl apply -f ../api-deployment.yaml -check_deployment_ready "kernelci-api" # Assuming the deployment has the name "api-deployment" in api-deployment.yaml - -echo "All components deployed successfully!" diff --git a/kube/minikube/scripts/setup_admin_user.sh b/kube/minikube/scripts/setup_admin_user.sh deleted file mode 100644 index 2d628813..00000000 --- a/kube/minikube/scripts/setup_admin_user.sh +++ /dev/null @@ -1,2 +0,0 @@ -API_POD_NAME=$(kubectl get ep kernelci-api -o=jsonpath='{.subsets[*].addresses[*].ip}' | tr ' ' '\n' | xargs -I % kubectl get pods -o=name --field-selector=status.podIP=%) -kubectl exec -it $API_POD_NAME -- python3 -m api.admin --mongo mongodb://kernelci-api-db.default.svc.cluster.local:27017 --email bot@kernelci.org diff --git a/kube/minikube/services/api-service.yaml b/kube/minikube/services/api-service.yaml deleted file mode 100644 index a4e94b22..00000000 --- a/kube/minikube/services/api-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -apiVersion: v1 -kind: Service -metadata: - name: kernelci-api -spec: - selector: - app: kernelci-api - ports: - - protocol: TCP - port: 8001 - targetPort: 8000 - type: ClusterIP diff --git a/kube/minikube/services/db-service.yaml b/kube/minikube/services/db-service.yaml deleted file mode 100644 index fbb4447e..00000000 --- a/kube/minikube/services/db-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -apiVersion: v1 -kind: Service -metadata: - name: kernelci-api-db -spec: - selector: - app: kernelci-api-db - ports: - - protocol: TCP - port: 27017 - targetPort: 27017 diff --git a/kube/minikube/services/redis-service.yaml b/kube/minikube/services/redis-service.yaml deleted file mode 100644 index a4a595b5..00000000 --- a/kube/minikube/services/redis-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -apiVersion: v1 -kind: Service -metadata: - name: kernelci-api-redis -spec: - selector: - app: kernelci-api-redis - ports: - - protocol: TCP - port: 6379 - targetPort: 6379 diff --git a/kube/minikube/services/ssh-service.yaml b/kube/minikube/services/ssh-service.yaml deleted file mode 100644 index b0a09373..00000000 --- a/kube/minikube/services/ssh-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -apiVersion: v1 -kind: Service -metadata: - name: kernelci-api-ssh -spec: - selector: - app: kernelci-api-ssh - ports: - - protocol: TCP - port: 8022 - targetPort: 22 - type: ClusterIP diff --git a/kube/minikube/services/storage-service.yaml b/kube/minikube/services/storage-service.yaml deleted file mode 100644 index 4aed4251..00000000 --- a/kube/minikube/services/storage-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# -# Copyright (C) 2023 Sanskar Bhushan - -apiVersion: v1 -kind: Service -metadata: - name: kernelci-api-storage -spec: - selector: - app: kernelci-api-storage - ports: - - protocol: TCP - port: 8002 - targetPort: 80 - type: ClusterIP