Skip to content

Commit

Permalink
Use api group flame.org
Browse files Browse the repository at this point in the history
  • Loading branch information
sleipnir committed Dec 15, 2023
1 parent ea5c6df commit 1314ae5
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ spec:
template:
metadata:
annotations:
flame-eigr.io/enabled: "true"
flame-eigr.io/dist-auto-config: "true"
flame-eigr.io/otp-app: "my_app_release_name"
flame.org/enabled: "true"
flame.org/dist-auto-config: "true"
flame.org/otp-app: "my_app_release_name"
spec:
containers:
- image: eigr/spawn-operator:1.1.1
Expand All @@ -72,20 +72,20 @@ The most important part is:
template:
metadata:
annotations:
flame-eigr.io/enabled: "true"
flame-eigr.io/dist-auto-config: "true"
flame-eigr.io/otp-app: "my_app_release_name"
flame.org/enabled: "true"
flame.org/dist-auto-config: "true"
flame.org/otp-app: "my_app_release_name"
```
See what each annotation means in the following table:
| Annotation | Default | Detail |
| ---------------------------------------- | -----------------| ------------- |
| flame-eigr.io/enabled | "false" | Enable Flame. |
| flame-eigr.io/dist-auto-config | "false" | Auto configure RELEASE_DISTRIBUTION and RELEASE_NODE based on otp application name. |
| flame-eigr.io/otp-app | | Application release name. Required if dist-auto-config is set to "true". |
| flame-eigr.io/pool-config-ref | "default-pool" | Flame Pool configuration reference name. See more in the Configuration section. |
| flame-eigr.io/runner-termination-timeout | 60000 | Timeout in milliseconds that the Runner will have to finish before the controller sends the POD delete command.
| Annotation | Default | Detail |
| -------------------------------------| -----------------| ------------- |
| flame.org/enabled | "false" | Enable Flame. |
| flame.org/dist-auto-config | "false" | Auto configure RELEASE_DISTRIBUTION and RELEASE_NODE based on otp application name. |
| flame.org/otp-app | | Application release name. Required if dist-auto-config is set to "true". |
| flame.org/pool-config-ref | "default-pool" | Flame Pool configuration reference name. See more in the Configuration section. |
| flame.org/runner-termination-timeout | 60000 | Timeout in milliseconds that the Runner will have to finish before the controller sends the POD delete command.
Now you can start scaling your applications with [Flame](https://github.com/phoenixframework/flame)... with a little help from [eigr](https://github.com/eigr) \0/
Expand Down
2 changes: 1 addition & 1 deletion flame_k8s_controller/config/bonny.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ config :bonny,
get_conn: {FlameK8sController.K8sConn, :get!, [config_env()]},

# Set the Kubernetes API group for this operator.
group: "flame-eigr.io",
group: "flame.org",

# Name must only consist of only lowercase letters and hyphens.
# Defaults to hyphenated mix app name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule FlameK8sController.Handler.FlamePoolHandler do
@moduledoc """
---
apiVersion: flame-eigr.io/v1
apiVersion: flame.org/v1
kind: FlamePool
metadata:
name: my-runner-pool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule FlameK8sController.Handler.FlameRunnerHandler do
@moduledoc """
---
apiVersion: flame-eigr.io/v1
apiVersion: flame.org/v1
kind: FlameRunner
metadata:
name: my-runner
Expand Down
4 changes: 2 additions & 2 deletions flame_k8s_controller/lib/flame_k8s_controller/operator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule FlameK8sController.Operator do
def controllers(watching_namespace, _opts) do
[
%{
query: K8s.Client.watch("flame-eigr.io/v1", "FlameRunner", namespace: watching_namespace),
query: K8s.Client.watch("flame.org/v1", "FlameRunner", namespace: watching_namespace),
controller: FlameK8sController.Controller.FlameRunner
}
]
Expand All @@ -36,7 +36,7 @@ defmodule FlameK8sController.Operator do
"runner",
"runners"
]),
group: "flame-eigr.io",
group: "flame.org",
scope: :Namespaced,
versions: [FlameK8sController.Versions.Api.V1.FlameRunner]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ defmodule FlameK8sController.Webhooks.MutatingControlHandler do

defp is_flame_enabled?(metadata) do
annotations = Map.get(metadata, "annotations", %{})
Map.get(annotations, "flame-eigr.io/enabled", "false") |> to_bool()
Map.get(annotations, "flame.org/enabled", "false") |> to_bool()
end

defp patch_obj(spec, metadata) do
annotations = Map.get(metadata, "annotations", %{})
pool_cfg_ref = Map.get(annotations, "flame-eigr.io/pool-config-ref", "default-pool")
pool_cfg_ref = Map.get(annotations, "flame.org/pool-config-ref", "default-pool")

timeout_to_shoot_headhead =
Map.get(annotations, "flame-eigr.io/runner-termination-timeout", 60000)
Map.get(annotations, "flame.org/runner-termination-timeout", 60000)

container =
spec
Expand Down Expand Up @@ -103,11 +103,11 @@ defmodule FlameK8sController.Webhooks.MutatingControlHandler do
end

defp maybe_put_distribution(envs, annotations) do
auto_dist? = Map.get(annotations, "flame-eigr.io/dist-auto-config", "false") |> to_bool()
auto_dist? = Map.get(annotations, "flame.org/dist-auto-config", "false") |> to_bool()

updated_envs =
if auto_dist? do
case Map.get(annotations, "flame-eigr.io/otp-app", nil) do
case Map.get(annotations, "flame.org/otp-app", nil) do
nil ->
envs

Expand Down

0 comments on commit 1314ae5

Please sign in to comment.