diff --git a/Kubernetes/k8s-deployment.yaml b/Kubernetes/k8s-deployment.yaml index eddf79b..70cb492 100644 --- a/Kubernetes/k8s-deployment.yaml +++ b/Kubernetes/k8s-deployment.yaml @@ -37,6 +37,16 @@ spec: env: - name: PHX_HOST value: raspberry5b.local # Make this the IP or CNAME of the main host or LB + - name: RELEASE_DISTRIBUTION + value: name + - name: NODE_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: RELEASE_NODE + value: "counter@$(NODE_IP)" + - name: DNS_CLUSTER_QUERY + value: "counter-headless-svc.default.svc.cluster.local" resources: {} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File diff --git a/Kubernetes/k8s-headless-svc.yaml b/Kubernetes/k8s-headless-svc.yaml new file mode 100644 index 0000000..e69de29 diff --git a/config/dev.exs b/config/dev.exs index 2335524..b3efd66 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -9,7 +9,7 @@ import Config config :counter, CounterWeb.Endpoint, # Binding to loopback ipv4 address prevents access from other machines. # Change to `ip: {0, 0, 0, 0}` to allow access from other machines. - http: [ip: {127, 0, 0, 1}, port: 4000], + http: [ip: {127, 0, 0, 1}, port: System.get_env("PORT") || 4000], check_origin: false, code_reloader: true, debug_errors: true, diff --git a/lib/counter_web/live/counter_state.ex b/lib/counter_web/live/counter_state.ex index c23905f..855844b 100644 --- a/lib/counter_web/live/counter_state.ex +++ b/lib/counter_web/live/counter_state.ex @@ -1,7 +1,7 @@ defmodule Counter.Count do use GenServer alias Phoenix.PubSub - @name :count_server + @name {:global, :count_server} @start_value 0 diff --git a/mix.exs b/mix.exs index c798d9a..2872305 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Counter.MixProject do def project do [ app: :counter, - version: "0.1.0", + version: "0.2.0", elixir: "~> 1.14", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, @@ -30,6 +30,7 @@ defmodule Counter.MixProject do [ mod: {Counter.Application, []}, extra_applications: [:logger, :runtime_tools] + # extra_applications: [:logger, :runtime_tools, :observer, :wx] ] end