Coder Social home page Coder Social logo

janekbaraniewski / kubeserial Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 4.0 3.28 MB

k8s operator for managing serial devices.

License: Apache License 2.0

Dockerfile 0.64% Shell 3.55% Go 82.62% Makefile 7.70% Smarty 4.71% Python 0.77%
controller-runtime golang kubernetes kubernetes-controller kubernetes-operator networking serial-communication serial-port

kubeserial's Introduction

kubeserial's People

Contributors

janekbaraniewski avatar ssmiller25 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kubeserial's Issues

Fix hardcoded values

Some values are hardcoded, they should be stored in some common place for const values:

  • template file paths

DaemonSet apiVersion should be updated

On Kubernetes 1.17, I get the below crashloop when running this:

{"level":"error","ts":1585579148.2771335,"logger":"cmd","msg":"Manager exited non-zero","error":"no matches for kind \"DaemonSet\" in version \"apps/v1beta2\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/janek/go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:128\nmain.main\n\tkubeserial/cmd/manager/main.go:150\nruntime.main\n\t/usr/lib/go/src/runtime/proc.go:203"}

apps/v1 is the stable apiVersion since at least K8S v1.14

interested in branching this to more serial devices

I have been working on alot of home automation stuff in kubernetes.

Was wondering if there was any way of reaching you to ask some questions regarding how to possible work with this to port some stuff like my serial zwave device over so i could use it in k8s.

thanks

Namespace not created as part of the kubeserial.yaml

kubectl create -f kubeserial.yaml

clusterrole.rbac.authorization.k8s.io/kubeserial created
clusterrolebinding.rbac.authorization.k8s.io/kubeserial created
customresourcedefinition.apiextensions.k8s.io/kubeserials.app.kubeserial.com created
Error from server (NotFound): error when creating "kubeserial.yaml": namespaces "kubeserial" not found
Error from server (NotFound): error when creating "kubeserial.yaml": namespaces "kubeserial" not found

Improved metrics + default dashboard

Dummy metrics are in place, once everything is working they should be improved to provide some actual data.

It would also be cool to include some default dashboard in chart

Use CRDs for devices

Instead of keeping all configuration in one crd, devices should be defined in separate objects, one per device

Release CI should update version in project files

ATM version in project files is always APP_VERSION or 0.0.1 and then it's substituted using hack/update-chart-version.sh

This results in local dev images always build with tag 0.0.1-<git-sha>, even though they are modifying different version

Would be good to commit bump of this version as part of release workflow

Make manager optional, support injecting devices to other workloads

Need to support scenario where user wants to manage software that's using serial device on their own. Example can be home automation using HomeAssistant:

  • we want to use device like Zigbee bridge
  • we don't want to remove HomeAssistant deployment when this device will be disconnected
  • we want to manage HomeAssistant config separately
  • ...

in such cases KubeSerial would schedule device gateway which then would be mounted by dedicated sidecar container running in management software pod on shared volume

Q:

  • can this be done automatically? I give KubeSerial name of deployment I want to expose my device to and operator adds sidecar, volumes and everything else. How would it behave when deployment is upgraded by helm?
  • maybe mutating webhook is the way to go?

Update images of other components when deploying new version

Currently when running helm upgrade with new version, managers and other components that are created by operator are not updated.

➜  VERSION=0.1.5 make deploy-dev
controller-gen... Done!
helm upgrade --install kubeserial-crds ./deploy/chart/kubeserial-crds
Release "kubeserial-crds" has been upgraded. Happy Helming!
NAME: kubeserial-crds
LAST DEPLOYED: Tue Apr 26 14:36:56 2022
NAMESPACE: default
STATUS: deployed
REVISION: 11
TEST SUITE: None
helm upgrade --install kubeserial ./deploy/chart/kubeserial -f ./deploy/chart/kubeserial/values-local.yaml
Release "kubeserial" has been upgraded. Happy Helming!
NAME: kubeserial
LAST DEPLOYED: Tue Apr 26 14:37:00 2022
NAMESPACE: default
STATUS: deployed
REVISION: 11
TEST SUITE: None

➜  k get deploy kubeserial -o=jsonpath='{.spec.template.spec.containers[0].image}'
janekbaraniewski/kubeserial:0.1.5

➜  k get daemonset kubeserial-monitor -o=jsonpath='{.spec.template.spec.containers[0].image}'
janekbaraniewski/kubeserial-device-monitor:0.0.1-de8647a

Use CRDs for managers

Current implementation requires managers to be hardcoded. This makes it difficult to test and extend and impossible for end users to add their own managers according to their needs.

Would be much easier to add separate CRD to define new managers as k8s objects

Add project docs

Would be good to have small docs site (gh pages) describing

  • components
  • CRDs
  • configuration
  • installation
  • examples

More control over where device monitors are scheduled

ATM device monitor will be scheduled to all cluster nodes. It's possible that we don't really want that - some nodes are running in cloud, some are running physically and we want only physical ones to monitor for devices.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.