{"id":19210353,"url":"https://github.com/seniverse/kube_dist","last_synced_at":"2025-05-12T19:24:05.832Z","repository":{"id":57514311,"uuid":"191725911","full_name":"seniverse/kube_dist","owner":"seniverse","description":"Erlang Distribution inside Kubernetes Cluster","archived":false,"fork":false,"pushed_at":"2020-12-31T11:36:43.000Z","size":20,"stargazers_count":29,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-20T16:39:11.505Z","etag":null,"topics":["erlang","kubernetes"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seniverse.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}},"created_at":"2019-06-13T08:49:01.000Z","updated_at":"2024-10-10T14:30:37.000Z","dependencies_parsed_at":"2022-09-06T04:00:51.059Z","dependency_job_id":null,"html_url":"https://github.com/seniverse/kube_dist","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seniverse%2Fkube_dist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seniverse%2Fkube_dist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seniverse%2Fkube_dist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seniverse%2Fkube_dist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seniverse","download_url":"https://codeload.github.com/seniverse/kube_dist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253806659,"owners_count":21967205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["erlang","kubernetes"],"created_at":"2024-11-09T13:35:48.808Z","updated_at":"2025-05-12T19:24:05.811Z","avatar_url":"https://github.com/seniverse.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"## kube_dist\n\n[![Build Status](https://travis-ci.org/seniverse/kube_dist.svg?branch=master)](https://travis-ci.org/seniverse/kube_dist)\n[![hex.pm version](https://img.shields.io/hexpm/v/kube_dist.svg)](https://hex.pm/packages/kube_dist)\n[![hex.pm downloads](https://img.shields.io/hexpm/dt/kube_dist.svg)](https://hex.pm/packages/kube_dist)\n![hex.pm license](https://img.shields.io/hexpm/l/kube_dist.svg)\n![GitHub top language](https://img.shields.io/github/languages/top/seniverse/kube_dist.svg)\n\nErlang Distribution inside Kubernetes Cluster\n\nWith `kube_dist` properly configured, name of erlang node is set to `${CONTAINER_NAME}@${POD_NAME}`.\n\nMoreover, you may use Kubernetes's Service as your process registry.\n\n```\ngen_server:call({via, kube_endpoints, ServiceName}, Request)\n```\n\nRequest would be sent to one randomly chosen pod listed in the endpoints list. If `ServiceName` is an atom, it would be sent to the container with same name. Or `ServiceName` could a tuple of two atom `{ServiceName, ContainerName}`, it would be sent to the container which name is specified in the second element of the tuple.\n\n\n### Installation\n\nadd `kube_dist` dependency to your project's `rebar.config`\n\n```\n{deps, [kube_dist]}.\n```\n\nset `start_distribution` to `false` and enable `httpc` service of inets\n\n```\n[\n  {kernel,\n   [{start_distribution, false}]\n  },\n  {inets,\n   [{services, [{httpc, []}]}]\n  }\n].\n```\n\ndisable epmd daemon and set `epmd_module` to `kube_epmd` and `proto_dist` to `kube_tcp`\n\n```\n-start_epmd false\n-epmd_module kube_epmd\n-proto_dist kube_tcp\n```\n\ngrant permission of `get` to `pods/status` and `watch` to `endpoints` to the service account of the pods\n\n```\n---\n\napiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: erlang-node\n\n---\n\napiVersion: rbac.authorization.k8s.io/v1beta1\nkind: Role\nmetadata:\n  name: erlang-node\nrules:\n- apiGroups: [\"\"]\n  resources: [\"pods/status\"]\n  verbs: [\"get\"]\n- apiGroups: [\"\"]\n  resources: [\"endpoints\"]\n  verbs: [\"watch\"]\n\n---\n\napiVersion: rbac.authorization.k8s.io/v1beta1\nkind: RoleBinding\nmetadata:\n  name: erlang-node\nroleRef:\n  apiGroup: rbac.authorization.k8s.io\n  kind: Role\n  name: erlang-node\nsubjects:\n- kind: ServiceAccount\n  name: erlang-node\n```\n\nand set environment variable `CONTAINER_NAME` to container's name and add a distribution port named `${CONTAINER_NAME}-dist`\n\n```\nspec:\n  serviceAccountName: erlang-node\n  containers:\n  - name: foo\n    env:\n    - name: CONTAINER_NAME\n      value: foo\n    ports:\n    - containerPort: 4370\n      name: foo-dist\n```\n\n### License\n\nkube_dist is released under Apache 2 License. Check [LICENSE](./LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseniverse%2Fkube_dist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseniverse%2Fkube_dist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseniverse%2Fkube_dist/lists"}