You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: Tried posting this on discourse and got an error regarding link limits in posts by new users, but there are no links in this post...
We're having an extraordinary amount of trouble trying to set up linkerd-tcp on k8s with a simple websocket application. The closest we've been able to get to a working request is having linkerd-tcp spit out some errors like error parsing response: missing field addrs at line 1 column 14 and our test application throwing ECONNREFUSED. Without linkerd, our sample app works as expected.
We have some questions regarding namerd config:
Namerd "namespace": does this need to be the same as the k8s namespace running linkerd-tcp, or the k8s namespace running the backend service pods, or does namerd have it's own concept of namespaces?
Namerd "label": should this match the name of any k8s services or namespaces, or is this purely an internal value used to configure namerd?
More generally, does anyone see any issues with our config?
#!/usr/bin/env node
var WebSocketServer = require('websocket').server;
var http = require('http');
var server = http.createServer(function(request, response) {
console.log((new Date()) + ' Received request for ' + request.url);
response.writeHead(404);
response.end();
});
server.listen(80, function() {
console.log((new Date()) + ' Server is listening on port 80');
});
wsServer = new WebSocketServer({
httpServer: server,
// You should not use autoAcceptConnections for production
// applications, as it defeats all standard cross-origin protection
// facilities built into the protocol and the browser. You should
// *always* verify the connection's origin and decide whether or not
// to accept it.
autoAcceptConnections: false
});
function originIsAllowed(origin) {
// put logic here to detect whether the specified origin is allowed.
return true;
}
wsServer.on('request', function(request) {
if (!originIsAllowed(request.origin)) {
// Make sure we only accept requests from an allowed origin
request.reject();
console.log((new Date()) + ' Connection from origin ' + request.origin + ' rejected.');
return;
}
var connection = request.accept('echo-protocol', request.origin);
console.log((new Date()) + ' Connection accepted.');
connection.on('message', function(message) {
if (message.type === 'utf8') {
console.log('Received Message: ' + message.utf8Data);
connection.sendUTF(message.utf8Data);
}
else if (message.type === 'binary') {
console.log('Received Binary Message of ' + message.binaryData.length + ' bytes');
connection.sendBytes(message.binaryData);
}
});
connection.on('close', function(reasonCode, description) {
console.log((new Date()) + ' Peer ' + connection.remoteAddress + ' disconnected.');
});
});
The text was updated successfully, but these errors were encountered:
error parsing response: missing fieldaddrsat line 1 column 14
makes me think that this is a problem talking to namerd
Namerd "namespace": does this need to be the same as the k8s namespace running linkerd-tcp, or the k8s namespace running the backend service pods, or does namerd have it's own concept of namespaces?
The latter! I suspect this is the problem. (It's definitely confusing.) I think, per:
@olix0r Thanks for looking into this, sorry it took me a while to get back to you, had to hop on a call.
It seems like this fixed our problems! Thanks for clarifying the various uses of namespace config options within namerd.
We're having an extraordinary amount of trouble trying to set up linkerd-tcp on k8s with a simple websocket application. The closest we've been able to get to a working request is having linkerd-tcp spit out some errors like
error parsing response: missing field
addrsat line 1 column 14
and our test application throwingECONNREFUSED
. Without linkerd, our sample app works as expected.We have some questions regarding namerd config:
More generally, does anyone see any issues with our config?
Linkerd-tcp/namerd configs:
Websocket client source:
Websocket server source:
The text was updated successfully, but these errors were encountered: