Azure / iot-edge-virtual-kubelet-provider

Kubernetes virtual kubelet provider for managing Azure IoT Edge deployments
MIT License
94 stars 25 forks source link

Deleting deployment does not clean up IoT Edge deployments #35

Open radoye opened 5 years ago

radoye commented 5 years ago

After deleting the sample deployment my IoT devices are still running the tempsensor container. Moreover, the IoT Edge Deployment that was defined was not cleaned up in the IoT Hub, which would trigger any new device that satisfies the target condition to install the deployment.

[! 638] $ kubectl get all
NAME                                           READY   STATUS    RESTARTS   AGE
pod/hub0-iot-edge-connector-775d5f5c79-n9ktl   2/2     Running   0          36m
pod/tempsensor-7dccc9b8cc-wnqls                0/1     Running   0          24m

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.0.0.1     <none>        443/TCP   3h51m

NAME                                      READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/hub0-iot-edge-connector   1/1     1            1           36m
deployment.apps/tempsensor                1/1     1            1           24m

NAME                                                 DESIRED   CURRENT   READY   AGE
replicaset.apps/hub0-iot-edge-connector-775d5f5c79   1         1         1       36m
replicaset.apps/tempsensor-7dccc9b8cc                1         1         1       24m

[! 640] $ kubectl delete deployment.apps/tempsensor
deployment.apps "tempsensor" deleted

[! 641] $ kubectl get all
NAME                                           READY   STATUS    RESTARTS   AGE
pod/hub0-iot-edge-connector-775d5f5c79-n9ktl   2/2     Running   0          37m

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.0.0.1     <none>        443/TCP   3h52m

NAME                                      READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/hub0-iot-edge-connector   1/1     1            1           37m

NAME                                                 DESIRED   CURRENT   READY   AGE
replicaset.apps/hub0-iot-edge-connector-775d5f5c79   1         1         1       37m

[! 642] $ 
veyalla commented 5 years ago

@radoye Thanks for trying this out and providing feedback. I will put these items on the backlog, however the IoT Edge engineering team doesn't have many cycles to spend here.

We're happy to accept contributions from the community for these enhancements/fixes!

radoye commented 4 years ago

@veyalla is there any actual dev documentation for this or "code as documentation"? specifically, design decisions around modeling the hub as a node and not actual devices? Thanks!

veyalla commented 4 years ago

It is the latter :)

The main reason model for modeling IoT Hub as a node is that IoT Hub is designed to host hundreds of thousands of actual devices. Exposing each device as a virtual node at this scale is not one of Kubernetes' design goals.