Skip to content

v0.6.0

Latest

Choose a tag to compare

@mruoss mruoss released this 06 Mar 15:05
· 1 commit to main since this release
74411b9

This release revamps the runner pod manifest configuration. The migration steps depend on the value you are currently passing:

  • If you are currently passing a map or a callback to :runner_pod_tpl, you can simply rename the option to :manifest and it should maintain the current behaviour.

  • If you are using %FLAMEK8sBackend.RunnerPodTemplate{} with :env and/or :resources fields, you need to convert it into a manifest map.

    manifest = %{
      "spec" => %{
        "containers" => [
          %{
            "env" => [
              %{"name" => "FOO", "value" => "bar"}
            ],
            "resources" => %{
              "requests" => %{"memory" => "256Mi", "cpu" => "100m"},
              "limits" => %{"memory" => "256Mi", "cpu" => "400m"}
            }
          }
        ]
      }
    }
    
    {FLAME.Pool,
      name: MyApp.SamplePool,
      backend: {FLAMEK8sBackend, manifest: manifest}}

    Note that, by default, using %FLAMEK8sBackend.RunnerPodTemplate{} implied that envs and resources were copied from the parent pod. If you want to maintain that behaviour, you can use a manifest function, as fallows:

      manifest_fun = fn parent_pod_manifest, app_container ->
        %{
          "spec" => %{
            "containers" => [
              %{
                # Copy env vars and resources from the parent container definition.
                # For fields that you don't want to copy, you can specify the desired
                # values here.
                "env" => app_container["env"] || [],
                "envFrom" => app_container["envFrom"] || [],
                "resources" => app_container["resources"] || %{}
              }
            ]
          }
        }
      end
    
    {FLAME.Pool,
      name: MyApp.SamplePool,
      backend: {FLAMEK8sBackend, manifest: manifest_fun}}

Added

  • Added :manifest backend option
  • Added :env backend option for passing extra runner environment variables as a key-value map

Changed

  • If a container image is specified in the runner manifest, it is no longer overridden by the parent image

Removed

  • Removed :runner_pod_tpl option in favour of the the new :manifest option
  • Removed the %FLAMEK8sBackend.RunnerPodTemplate{} struct

Chores

Full Changelog: v0.5.7...v0.6.0