MCPcopy Index your code
hub / github.com/albertrdixon/romulus

github.com/albertrdixon/romulus @0.1.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.1.3 ↗ · + Follow
10,154 symbols 37,154 edges 807 files 4,146 documented · 41%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

romulusd

GoDoc

Automagically register your kubernetes services in vulcan proxy!

Usage

$ romulusd --help
usage: romulusd [<flags>]

Flags:
  --help           Show help (also see --help-long and --help-man).
  -v, --vulcand-key="vulcand"
                   vulcand etcd key
  -e, --etcd=http://127.0.0.1:2379
                   etcd peers
  -t, --etcd-timeout=5s
                   etcd request timeout
  -k, --kube=http://127.0.0.1:8080
                   kubernetes endpoint
  -U, --kube-user=KUBE-USER
                   kubernetes username
  -P, --kube-pass=KUBE-PASS
                   kubernetes password
  --kube-api="v1"  kubernetes api version
  -C, --kubecfg=/path/to/.kubecfg
                   path to kubernetes cfg file
  -s, --svc-selector=key=value[,key=value]
                   service selectors. Leave blank for Everything(). Form: key=value
  -d, --debug      Enable debug logging. e.g. --log-level debug
  -l, --log-level=info
                   log level. One of: fatal, error, warn, info, debug
  --debug-etcd     Enable cURL debug logging for etcd
  --version        Show application version.

Set up your kubernetes service with a label and some options annotations:

NOTE: all labels and annotations are under the prefix romulus/

apiVersion: v1
kind: Service
metadata:
  name: example
  annotations:
    romulus/host: 'www.example.com'
    romulus/pathRegexp: '/guestbook/.*'
    romulus/frontendSettings: '{"FailoverPredicate":"(IsNetworkError() || ResponseCode() == 503) && Attempts() <= 2"}}'
    romulus/backendSettings: '{"KeepAlive": {"MaxIdleConnsPerHost": 128, "Period": "4s"}}'
  labels:
    name: example
    romulus/type: external # <-- Will ensure SVC-SELECTORs specified (e.g. 'type=external') are present in either Labels or Annotations.
spec: 
...

When you create the service, romulusd will create keys in etcd for vulcan!

NOTE: IDs for backends and frontends are constructed as follows: [<port name>.]<kube resource name>.<namespace>

$ kubectl.sh get svc,endpoints -l romulus/type=external
NAME           LABELS                            SELECTOR            IP(S)           PORT(S)
frontend       name=frontend,type=external       name=frontend       10.247.242.50   80/TCP
NAME           ENDPOINTS
frontend       10.246.1.7:80,10.246.1.8:80,10.246.1.9:80

$ etcdctl get /vulcan/backends/example.default/backend
{"Id":"example.default","Type":"http","Settings":{"KeepAlive":{"MaxIdleConnsPerHost":128,"Period": "4s"}}}

$ etcdctl get /vulcan/frontends/example.default/frontend
{"Id": "example.default","Type":"http","BackendId":"example.default","Route":"Host(`www.example.com`) && PathRegexp(`/guestbook/.*`)","Settings":{"FailoverPredicate":"(IsNetworkError() || ResponseCode() == 503) && Attempts() <= 2"}}

$ etcdctl ls /vulcan/backends/example.default/servers
/vulcan/backends/example.default/servers/10.246.1.8
/vulcan/backends/example.default/servers/10.246.1.9
/vulcan/backends/example.default/servers/10.246.1.7

Multi Port Services

If your service has multiple ports, romulusd will create a frontend for each.

Separate options by appending the port name as a suffix (e.g. romulus/path.api). If no matching romulus/<opt>.<port_name> option exists, then the romulus/<opt> option will be used.

apiVersion: v1
kind: Service
metadata:
  name: example
  annotations:
    romulus/host: 'www.example.com'
    romulus/path.api: '/api'
    romulus/path.web: '/web'
  labels:
    name: example
    romulus/type: external
spec:
  ports:
  - port: 80
    name: web
  - port: 8888
    name: api
...
$ etcdctl ls /vulcand/backends
/vulcand/backends/api.example.default
/vulcand/backends/web.example.default

$ etcdctl ls /vulcand/frontends
/vulcand/frontends/web.example.default
/vulcand/frontends/api.example.default

$ etcdctl get /vulcand/frontends/api.example.default/frontend
{"Id":"api.example.default","Type":"http","BackendId":"api.example.default","Route":"Host(`www.example.com`) && Path(`/api`)"}

Extension points exported contracts — how you extend this code

Message (Interface)
Message is implemented by generated protocol buffer messages. [54 implementers]
Godeps/_workspace/src/github.com/golang/protobuf/proto/lib.go
VulcanObject (Interface)
VulcanObject represents a vulcand component [5 implementers]
romulus/vulcan.go
EtcdClient (Interface)
(no doc) [1 implementers]
romulus/etcd.go
WatchFunc (FuncType)
(no doc)
romulus/events.go
Metric (Interface)
A Metric models a single sample value with its meta data being exported to Prometheus. Implementers of Metric in this pa [9 …
Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/metric.go
Collector (Interface)
Collector is the interface implemented by anything that can be used by Prometheus to collect metrics. A Collector has to [7 …
Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus/collector.go
Hook (Interface)
A hook to be fired when logging on the logging levels returned from `Levels()` on your implementation of the interface. [8 …
Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks.go
ResourceQuotaInterface (Interface)
ResourceQuotaInterface has methods to work with ResourceQuota resources. [10 implementers]
Godeps/_workspace/src/k8s.io/kubernetes/pkg/client/resource_quotas.go

Core symbols most depended-on inside this repo

Errorf
called by 2828
Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/fake_handler.go
Fatalf
called by 767
Godeps/_workspace/src/github.com/Sirupsen/logrus/logrus.go
Sprintf
called by 728
Godeps/_workspace/src/github.com/davecgh/go-spew/spew/config.go
New
called by 434
Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/rest/rest.go
Error
called by 420
Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/exec/exec.go
String
called by 332
Godeps/_workspace/src/github.com/golang/protobuf/proto/lib.go
DefaultingInterface
called by 270
Godeps/_workspace/src/k8s.io/kubernetes/pkg/conversion/converter.go
Fatal
called by 237
Godeps/_workspace/src/github.com/Sirupsen/logrus/logrus.go

Shape

Function 4,166
Method 4,155
Struct 1,250
TypeAlias 301
Interface 226
FuncType 56

Languages

Go100%

Modules by API surface

Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/test.pb.go337 symbols
Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go243 symbols
Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/types.go153 symbols
Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/v1/types.go151 symbols
Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/v1/deep_copy_generated.go128 symbols
Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/deep_copy_generated.go127 symbols
Godeps/_workspace/src/github.com/alecthomas/template/parse/node.go120 symbols
Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/validation/validation.go104 symbols
Godeps/_workspace/src/gopkg.in/alecthomas/kingpin.v2/values.go100 symbols
Godeps/_workspace/src/github.com/golang/protobuf/proto/all_test.go97 symbols
Godeps/_workspace/src/github.com/golang/glog/glog.go90 symbols
Godeps/_workspace/src/github.com/golang/protobuf/proto/encode.go86 symbols

For agents

$ claude mcp add romulus \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact