Skip to content

Commit

Permalink
Merge pull request #27 from Saetch/25-kubernetes-integration
Browse files Browse the repository at this point in the history
updated necessary name for kubernetes deploy
  • Loading branch information
Saetch authored Jun 26, 2024
2 parents f8552ce + d05e009 commit fbef51b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cluster/Master/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Net;
using System.Net;
using System.Text.Json.Serialization;
using System.Globalization;
using System.Text.Json;
Expand Down Expand Up @@ -356,7 +356,7 @@ static async Task<List<WanderingPosition>> FindAbandonedValuesFromNode(String no
}

static async Task<List<Position>> GetPositions(List<Tuple<int, int>> positions, HttpClient httpClient){
String url = "http://hasher_service:8080/hash_multiple?vec=";
String url = "http://hasher-service:8080/hash_multiple?vec=";
foreach(Tuple<int, int> position in positions){
url += "x:"+position.Item1 + "," + "y:"+position.Item2 + ";";
}
Expand Down
2 changes: 1 addition & 1 deletion Cluster/Node_cs/NodeBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ private static async Task<List<HashedPosition>> QueryHasherForPoints(List<Point>
TypeInfoResolver = AppJsonSerializerContext.Default
};
using (HttpClient httpClient = new HttpClient()){
string baseUrl = "http://hasher_service:8080/hash_multiple";
string baseUrl = "http://hasher-service:8080/hash_multiple";
Console.WriteLine("Making request to: " + baseUrl);
var json = JsonSerializer.Serialize(positions, options);
var query = "?vec=" + json.Replace("[{","").Replace("}]","").Replace("},{",";").Replace("\"","");
Expand Down
2 changes: 1 addition & 1 deletion Cluster/coordinator/src/post_requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rand::Rng;

use crate::{communication::{HashedPosition, NodeRegisterResponse, Position}, deal_with_nodes::{self, distribute_value}, state::{InteriorMutableState, NodeOccupation, NodeState}};

pub const HASHER_SERVICE_URL : &str = "http://hasher_service:8080/hash/";
pub const HASHER_SERVICE_URL : &str = "http://hasher-service:8080/hash/";

pub async fn register(path: web::Path<String>, data: web::Data<InteriorMutableState>) -> impl Responder {
let client = Client::default();
Expand Down
2 changes: 1 addition & 1 deletion Cluster/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ services:
depends_on:
- coordinator
- hasher_service
hasher_service:
hasher-service:
image: ghcr.io/saetch/hasher_service:latest
ports:
- "5002:8080" ## this is for debug purposes, the service does not need to be exposed to the host at all
Expand Down
43 changes: 43 additions & 0 deletions deploy/deploy-nodes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: d-nodecs
spec:
replicas: 4
selector:
matchLabels:
app: d-nodecs
template:
metadata:
labels:
app: d-nodecs
spec:
containers:
- name: app
image: ghcr.io/saetch/deightma_nodecs:latest
ports:
- containerPort: 5552
name: d-nodecs-p
env:
- name: DB_HOST
value: test-db
resources:
requests:
memory: "20Mi"
cpu: "10m"
limits:
memory: "100Mi"
cpu: "100m"
---
apiVersion: v1
kind: Service
metadata:
name: d-nodecs
spec:
selector:
app: d-nodecs
ports:
- name: d-nodecs-p
protocol: TCP
port: 5552
targetPort: d-nodecs-p

0 comments on commit fbef51b

Please sign in to comment.