question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module with Websocket or Kestrel Server not deploying to Kubernetes Cluster

See original GitHub issue

I have managed to setup an instance of AKS, with namespaces linking to my Edge Devices. I deploy the modules I require and the majority of them deploy without issue. However, the two modules I have created which run a websocket server or a Kestrel server will not deploy.

Expected Behavior

The Edge Agent should pull the module, create the service, pod and any other items it needs to setup the module. The module should then be deployed and clients able to connect to it.

Current Behavior

The Edge Agent appears to try to pull the module from the repository, create a service and then throws the following exception:

2019-07-25 12:55:49.702 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Core.Agent] - Edge agent created. 
2019-07-25 12:55:49.713 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Core.Agent] - Starting reconcile operation 
2019-07-25 12:55:49.744 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Core.Agent] - Getting edge agent config... 
2019-07-25 12:55:49.843 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Kubernetes.EdgeOperator] - Deployment 'iothub1.azure-devices.net-edgedevice1', status'Added' 
2019-07-25 12:55:49.857 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Kubernetes.EdgeOperator] - Expected a valid '' creation string in k8s Object 'edgeagent'. 
2019-07-25 12:55:50.004 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Kubernetes.EdgeOperator] - Creating service object 'websocketmodule' 
2019-07-25 12:55:50.012 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Agent.Kubernetes.EdgeOperator] - Creating edge deployment 'websocketmodule' 
2019-07-25 12:55:50.013 +00:00 [INF] [Microsoft.Azure.Devices.Edge.Agent.Kubernetes.EdgeOperator] - Creating service websocketmodule
Unhandled Exception: Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'UnprocessableEntity' 
   at k8s.Kubernetes.CreateNamespacedServiceWithHttpMessagesAsync(V1Service body, String namespaceParameter, String pretty, Dictionary`2 customHeaders, CancellationToken cancellationToken) 
   at k8s.KubernetesExtensions.CreateNamespacedServiceAsync(IKubernetes operations, V1Service body, String namespaceParameter, String pretty, CancellationToken cancellationToken) 
   at Microsoft.Azure.Devices.Edge.Agent.Kubernetes.EdgeOperator.ManageDeployments(V1ServiceList currentServices, V1DeploymentList currentDeployments, EdgeDeploymentDefinition customObject) in /home/vsts/work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Kubernetes/EdgeOperator.cs:line 732 
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) 
--- End of stack trace from previous location where exception was thrown --- 
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Steps to Reproduce

  1. Install IoTEdge onto Kubernetes cluster using edgek8s/edge-kubernetes
  2. Create namespace linked to Edge Device
  3. Add modules to be deployed
  4. Add websocket or Kestrel module

Context (Environment)

Device (Host) Operating System

Ubuntu 18.04

Architecture

amd64

Container Operating System

Linux containers - traefik:v1.7-alpine

Runtime Versions

edge-kubernetes-0.1.6

iotedged

iotedged:0.1.0-alpha

Edge Agent

azureiotedge-agent:0.1.0-alpha

Edge Hub

azureiotedge-hub:1.0

Docker

18.09.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
darobscommented, Jul 30, 2019

A potential fix has been checked into master, but we have not back ported this to the preview.

0reactions
lt72commented, Mar 4, 2020

Public preview refresh will be out next week, please re-open as needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is my service "Unable to start Kestrel" in EKS only?
The pods then start logging things, which is normal. However, Kestrel should work and as does work, but only on my "own" Kubernetes...
Read more >
Host and deploy Blazor Server - ASP.NET Core
In the following example: Kestrel server is running on the host machine. The app listens for traffic on port 5000.
Read more >
Deploy to Kubernetes - websockets 11.0.3 documentation
This guide describes how to deploy a websockets server to Kubernetes. It assumes familiarity with Docker and Kubernetes. We're going to deploy a...
Read more >
What Is Kubernetes?
Kubernetes, also known as K8s, is an open source container orchestration platform for automating deployment, scaling, and management of containerized apps.
Read more >
A Minimal Full-Feature Kestrel WebSocket Server
A Kestrel WebSocket server with realistic features using .NET Core 3.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found