neiam
/diogramos
diogramos
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
boop
155fe18 · gmorell · 2026-04-28 01:11
Files changed
modified
config/config.exs
+2
−21
@@ -92,27 +92,8 @@ config :sentry,
| 92 | 92 | root_source_code_paths: [File.cwd!()], |
| 93 | 93 | environment_name: Mix.env() |
| 94 | 94 | |
| 95 | −# libcluster — uses the Kubernetes plugin to find peer pods via the API | |
| 96 | −# and form an Erlang cluster. RBAC for the diogramos ServiceAccount is | |
| 97 | −# defined in app.yml. In dev/test the topology is empty, so no clustering | |
| 98 | −# happens locally. | |
| 99 | −config :libcluster, | |
| 100 | − topologies: [ | |
| 101 | − diogramos: [ | |
| 102 | − strategy: Cluster.Strategy.Kubernetes, | |
| 103 | − config: [ | |
| 104 | − mode: :ip, | |
| 105 | − # Default :endpoints lookup. Pairs with the diogramos-headless | |
| 106 | − # Service in app.yml — Kubernetes builds the Endpoints object | |
| 107 | − # automatically from that service's selector, so we just point | |
| 108 | − # libcluster at the service name. | |
| 109 | − kubernetes_service_name: "diogramos-headless", | |
| 110 | − kubernetes_node_basename: "diogramos", | |
| 111 | − kubernetes_namespace: "diogramos", | |
| 112 | − polling_interval: 10_000 | |
| 113 | − ] | |
| 114 | − ] | |
| 115 | − ] | |
| 95 | +# libcluster topology is configured in runtime.exs (prod-only) so it | |
| 96 | +# never tries to talk to the k8s API in dev/test. | |
| 116 | 97 | |
| 117 | 98 | # Import environment specific config. This must remain at the bottom |
| 118 | 99 | # of this file so it overrides the configuration defined above. |
modified
config/dev.exs
+0
−3
@@ -11,9 +11,6 @@ config :diogramos, Diogramos.Repo,
| 11 | 11 | pool_size: 10, |
| 12 | 12 | port: 54329 |
| 13 | 13 | |
| 14 | −# No clustering in local dev. | |
| 15 | −config :libcluster, topologies: [] | |
| 16 | − | |
| 17 | 14 | # For development, we disable any cache and enable |
| 18 | 15 | # debugging and code reloading. |
| 19 | 16 | # |
modified
config/runtime.exs
+17
−0
@@ -76,6 +76,23 @@ if config_env() == :prod do
| 76 | 76 | |
| 77 | 77 | config :diogramos, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY") |
| 78 | 78 | |
| 79 | + # libcluster — Kubernetes endpoints lookup against the headless | |
| 80 | + # service we deploy alongside the app. RBAC (pods + endpoints) is | |
| 81 | + # granted to the `diogramos` ServiceAccount in app.yml. | |
| 82 | + config :libcluster, | |
| 83 | + topologies: [ | |
| 84 | + diogramos: [ | |
| 85 | + strategy: Cluster.Strategy.Kubernetes, | |
| 86 | + config: [ | |
| 87 | + mode: :ip, | |
| 88 | + kubernetes_service_name: "diogramos-headless", | |
| 89 | + kubernetes_node_basename: "diogramos", | |
| 90 | + kubernetes_namespace: "diogramos", | |
| 91 | + polling_interval: 10_000 | |
| 92 | + ] | |
| 93 | + ] | |
| 94 | + ] | |
| 95 | + | |
| 79 | 96 | # Sentry: only emits when DSN is non-empty, so the secret can be left |
| 80 | 97 | # blank in environments where reporting is off. |
| 81 | 98 | config :sentry, |
modified
config/test.exs
+0
−3
@@ -29,9 +29,6 @@ config :diogramos, DiogramosWeb.Endpoint,
| 29 | 29 | # flow flip this back via Application.put_env/3 and then restore it. |
| 30 | 30 | config :diogramos, :registration_open, true |
| 31 | 31 | |
| 32 | −# Disable libcluster in test — we don't try to talk to the k8s API. | |
| 33 | −config :libcluster, topologies: [] | |
| 34 | − | |
| 35 | 32 | # In test we don't send emails |
| 36 | 33 | config :diogramos, Diogramos.Mailer, adapter: Swoosh.Adapters.Test |
| 37 | 34 |
Parents: 32120db