{"id":50108920,"url":"https://github.com/valexsantos/mkit","last_synced_at":"2026-05-23T12:04:09.196Z","repository":{"id":214651724,"uuid":"736972767","full_name":"valexsantos/mkit","owner":"valexsantos","description":"micro kubernetes in ruby... and a docker client","archived":false,"fork":false,"pushed_at":"2026-02-15T18:45:25.000Z","size":107,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-18T16:48:54.594Z","etag":null,"topics":["docker","haproxy","haproxy-configuration","kubectl","kubernetes","kubernetes-cluster","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valexsantos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-29T12:19:11.000Z","updated_at":"2025-04-06T17:23:26.000Z","dependencies_parsed_at":"2024-12-15T19:18:54.379Z","dependency_job_id":"e2d6066e-c061-4f3d-8b13-cb4f12f9fdec","html_url":"https://github.com/valexsantos/mkit","commit_stats":null,"previous_names":["valexsantos/mkit"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/valexsantos/mkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valexsantos%2Fmkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valexsantos%2Fmkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valexsantos%2Fmkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valexsantos%2Fmkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valexsantos","download_url":"https://codeload.github.com/valexsantos/mkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valexsantos%2Fmkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33394677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","haproxy","haproxy-configuration","kubectl","kubernetes","kubernetes-cluster","ruby","ruby-gem"],"created_at":"2026-05-23T12:03:46.345Z","updated_at":"2026-05-23T12:04:09.189Z","avatar_url":"https://github.com/valexsantos.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MKIt - Micro Kubernetes on Ruby\n\nThis is micro kubernetes(tm) on Ruby(tm), a simple tool to deploy containers to mimic a (very) minimalistic k8 cluster with a nice REST API.\n\nIt's also a frontend for `docker`, providing an easier way for your services to be locally available, without the need to care about local `ports` availability.\n\nIt contains an internal DNS and uses HAProxy as ingress for Pod access.\nThe database is a simple sqlite3 db and the server is a Sinatra based application.\n\nA client is also included to access the API, e.g. `mkit ps`.\n\nThe daemon is responsible for HAProxy pods routing configuration. It also provides the cluster DNS and manages the internal host interface and the pod instances. \n\n## Requirements\n\n* Ruby\n* HAProxy\n* Docker\n* Linux (iproute2 package)\n\n**Note:** in order to have **ssl support**, you must install `openssl-dev` package (e.g. `libssl-dev` on Ubuntu) prior to install MKIt gem, due to `eventmachine` gem native extensions.\n\n## Install\n\nThis is a simple ruby gem, so to install execute:\n```\n# gem install mkit\n```\n\n## Configuration\n\n### Server configuration\n\nOn startup, [the server configuration](config) will be created on `/etc/mkit`.\n\nThe server will available by default on `https://localhost:4567` but you can configure server startup parameters on `/etc/mkit/mkitd_config.sh`\n\nPlease check [systemd](samples/systemd) or [daemontools](samples/daemontools) directories for more details.\n\n```\n# /etc/mkit/mkitd_config.sh\n#\n# mkitd server options (for systemd unit | daemontools)\n#\nOPTIONS=\"\"\n# e.g. OPTIONS=\"-b 0.0.0.0\"\n```\nHAProxy config directory and control commands are defined on [mkit_config.yml](config/mkit_config.yml)\n\n```\n# /etc/mkit/mkit_config.yml - mkit server configuration file. \nmkit:\n  my_network:\n    ip: 10.210.198.1\n  haproxy:\n    config_dir: /etc/haproxy/haproxy.d\n    ctrl:\n      start:   systemctl start   haproxy\n      stop:    systemctl stop    haproxy\n      reload:  systemctl reload  haproxy\n      restart: systemctl restart haproxy\n      status:  systemctl status  haproxy\n  database:\n    env: development\n  clients:\n    - id: client_1_id\n    - id: client_2_id\n    - ...\n```\n\nYou must configure `haproxy` to use config directory. for example on Ubuntu:\n\n```\n# /etc/default/haproxy\n\n# Defaults file for HAProxy\n#\n# This is sourced by both, the initscript and the systemd unit file, so do not\n# treat it as a shell script fragment.\n\n# Change the config file location if needed\nCONFIG=\"/etc/haproxy/haproxy.d\"\n\n# Add extra flags here, see haproxy(1) for a few options\n#EXTRAOPTS=\"-de -m 16\"\n```\n\n#### Authorization\n\nTo access MKIt server API, you must add each client `id` to server configuration:\n\n```\n# /etc/mkit/mkit_config.yml - mkit server configuration file. \nmkit:\n  my_network:\n...\n  clients:\n    - id: client_1_id\n    - id: client_2_id\n    - ...\n```\n\n### Client configuration\n\nOn `mkit` first call, default configuration will be copied to `$HOME/.mkit` with `local`default profile set.\n\nYou must call `mkit init` to initialize client configuration.\n\nClient identification key (`my_id`) will be generated, printed out to console and saved to the client's configuration file.\n\nYou may edit the local configuration file to add more servers and change active profile with `$mkit profile set \u003cprofile_name\u003e`, e.g. `$mkit profile set server_2`\n\n```\n# ~/.mkit/mkitc_config.yml\nmkit:\n  local: \n    server.uri: https://localhost:4567\n  server_2:  # you can add more servers. change the client active profile with mkit profile command\n    server.uri: https://192.168.29.232:4567\nmy_id: unique_id # this id is generated running mkit init\n```\n\n### Service\n\n```\nservice:\n  name: rabbitmq # unique. Available on internal DNS as 'rabbitmq'\n  image: rabbitmq:3-management-alpine # image\n  network: bridge # docker network - it will be created if it does not exists\n  ingress:\n    # ingress configuration\n    # see https://docs.haproxy.org/3.1/configuration.html\n    frontend: # frontend section\n      - name: http-in-ssl # frontend name - must be unique\n        options: # frontend global section options\n          - option httpclose\n          - option forwardfor\n        bind:\n          port: 443 # to define a range (e.g. 8000-8080), backend `port` must be blank\n          ssl: true # ssl support - default is false\n          mode: http # tcp|http\n          cert: /etc/ssl/certs/server.crt # if empty uses mkit default crt file (mkit.pem)\n          options: # frontend bind section options\n            - accept-proxy\n            - transparent\n            - defer-accept\n        default_backend: admin # backend to use - must point to a backend name\n      - name: http-in\n        bind:\n          port: 80\n          mode: http\n        default_backend: admin\n      - name: server-in\n        bind:\n          port: 5672\n          mode: tcp\n        default_backend: server\n    backend: # backend section\n      - name: admin # backend name - must be unique\n        balance: round_robin # round_robin|least_conn - default is round_robin\n        options: # backend global section options\n          - option httpclose\n          - option forwardfor\n          - cookie JSESSIONID prefix\n        bind:\n          port: 15672 # if this backend is used by a frontend with a range port, this port must be blank\n          mode: http\n          options: # backend bind section options\n            - cookie A\n            - check\n      - name: server\n        balance: round_robin\n        bind:\n          port: 5672\n          mode: tcp\n  resources:\n    min_replicas: 1 # default value. Pods will be available on internal DNS as '\u003cservice_name\u003e.internal'\n    max_replicas: 1 # default value\n    limits:\n      cpu: 250m # cpu limit - 1000m represents 1 cpu core. minimum 10m. default is empty\n      memory: 250m # memory limit - default is empty\n      memory_swap: 250m # memory + swap limit - default is empty\n  volumes:\n    - docker://mkit_rabbitmq_data:/var/lib/rabbitmq # a docker volume - it will be created if it does not exists\n    - /var/log/rabbitmq/logs:/var/log/rabbitmq # a local volume\n  environment:\n    RABBITMQ_DEFAULT_USER: admin\n    RABBITMQ_DEFAULT_PASS: admin\n    RABBITMQ_DEFAULT_VHOST: mkit\n```\n\n## Running\n\nThe `mkitd server daemon` requires `root` user (due to `ip` and `haproxy`).\nAfter installing the gem, server and client will be available on host.\n```\n# mkitd  --help\nUsage: mkitd [options]\n    -c config-dir                    set the config dir (default is /etc/mkit)\n    -p port                          set the port (default is 4567)\n    -b bind                          specify bind address (e.g. 0.0.0.0)\n    -e env                           set the environment (default is development)\n    -o addr                          alias for '-b' option\n    --no-ssl                         disable ssl - use http for local server. (default is https)\n    --ssl-key-file PATH              Path to private key (default mkit internal)\n    --ssl-cert-file PATH             Path to certificate (default mkit internal)\n```\n\nThere's also samples for [systemd](samples/systemd) and [daemontools](samples/daemontools) as well for some miscellaneous [spps](samples/apps).\n\n### Accessing the API\n\nA client is provided to interact with MKIt server.\n\nRun `mkit help` for a list of current supported commands.\n\n```\nUsage: mkit \u003ccommand\u003e [options]\n\nMicro k8s on Ruby - a simple tool to mimic a (very) minimalistic k8 cluster\n\nCommands:\n\ninit         init mkit client\nps           show services status (alias for status)\nstatus       show services status\nstart        start service\nstop         stop service\nrestart      restart service\ncreate       create new service\nupdate       update service\nget          print service configuration\nrm           remove service\nmigrate      migrate local service definition to the new schema version\nexec         execute a command in a running pod\nlogs         view service logs\nversion      prints mkit client and server version\nproxy        haproxy status and control\nprofile      mkit client configuration profile\n\nRun ' mkit help \u003ccommand\u003e' for specific command information.\n```\n\nExample:\n\n```\n$ mkit ps\n+----+-------+---------------+-------------------+--------------+---------+\n| id | name  |     addr      |       ports       |     pods     | status  |\n+----+-------+---------------+-------------------+--------------+---------+\n| 1  | mongo | 10.210.198.10 | tcp/27017         | 106e2b59cb11 | RUNNING |\n| 2  | nexus | 10.210.198.11 | http/80,https/443 | 68e239e5102a | RUNNING |\n+----+-------+---------------+-------------------+--------------+---------+\n```\nThe service `mongo` is available on IP `10.210.198.10:27017`\nThe service `nexus` is available on IP `10.210.198.11:80` and on port `443` with ssl.\n\n**Note:** Don't forget to call `mkit init` to initialize client configuration and to add the `client-id`\nto the server authorized clients list.\n\n## Development\n\n* build the gem\n  * `rake package`\n* console\n  * `rake console`\n\n# Contributing\n * Fork it\n * Create your feature branch (git checkout -b my-new-feature)\n * Commit your changes (git commit -am 'Add some feature')\n * Push to the branch (git push origin my-new-feature)\n * Create new Pull Request\n\n# Thanks\n\nFor my kids. :) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalexsantos%2Fmkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalexsantos%2Fmkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalexsantos%2Fmkit/lists"}