From 6455bf14de33eb8c6915551a14a3b4d208bf0ba9 Mon Sep 17 00:00:00 2001 From: Elias Arruda Date: Sun, 2 Mar 2025 00:02:08 -0300 Subject: [PATCH 1/3] pull secret on deployments --- .../lib/spawn_operator/k8s/proxy/deployment.ex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spawn_operator/spawn_operator/lib/spawn_operator/k8s/proxy/deployment.ex b/spawn_operator/spawn_operator/lib/spawn_operator/k8s/proxy/deployment.ex index 000ae50b..30ffec35 100644 --- a/spawn_operator/spawn_operator/lib/spawn_operator/k8s/proxy/deployment.ex +++ b/spawn_operator/spawn_operator/lib/spawn_operator/k8s/proxy/deployment.ex @@ -195,6 +195,7 @@ defmodule SpawnOperator.K8s.Proxy.Deployment do } |> maybe_put_node_selector(topology) |> maybe_put_node_tolerations(topology) + |> maybe_put_image_pull_secrets(topology) |> maybe_put_volumes(params, erlang_mtls_enabled) |> maybe_set_termination_period(params) } @@ -456,6 +457,12 @@ defmodule SpawnOperator.K8s.Proxy.Deployment do defp maybe_put_node_tolerations(spec, _), do: spec + defp maybe_put_image_pull_secrets(spec, %{"imagePullSecrets" => image_pull_secrets} = _topology) do + Map.merge(spec, %{"imagePullSecrets" => image_pull_secrets}) + end + + defp maybe_put_image_pull_secrets(spec, _), do: spec + defp maybe_put_ports_to_host_container(spec, %{"ports" => ports}) do Map.put(spec, "ports", ports) end From 40509f791ef37eecee89caef03ce0cc2fc8c65bd Mon Sep 17 00:00:00 2001 From: Elias Arruda Date: Mon, 3 Mar 2025 11:31:14 -0300 Subject: [PATCH 2/3] pull secret fix --- .../lib/spawn_operator/k8s/proxy/deployment.ex | 7 +++++-- .../lib/spawn_operator/versions/api/v1/actor_host.ex | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/spawn_operator/spawn_operator/lib/spawn_operator/k8s/proxy/deployment.ex b/spawn_operator/spawn_operator/lib/spawn_operator/k8s/proxy/deployment.ex index 30ffec35..e7d7bd1a 100644 --- a/spawn_operator/spawn_operator/lib/spawn_operator/k8s/proxy/deployment.ex +++ b/spawn_operator/spawn_operator/lib/spawn_operator/k8s/proxy/deployment.ex @@ -195,7 +195,7 @@ defmodule SpawnOperator.K8s.Proxy.Deployment do } |> maybe_put_node_selector(topology) |> maybe_put_node_tolerations(topology) - |> maybe_put_image_pull_secrets(topology) + |> maybe_put_image_pull_secrets(host_params) |> maybe_put_volumes(params, erlang_mtls_enabled) |> maybe_set_termination_period(params) } @@ -457,7 +457,10 @@ defmodule SpawnOperator.K8s.Proxy.Deployment do defp maybe_put_node_tolerations(spec, _), do: spec - defp maybe_put_image_pull_secrets(spec, %{"imagePullSecrets" => image_pull_secrets} = _topology) do + defp maybe_put_image_pull_secrets( + spec, + %{"imagePullSecrets" => image_pull_secrets} = _host_params + ) do Map.merge(spec, %{"imagePullSecrets" => image_pull_secrets}) end diff --git a/spawn_operator/spawn_operator/lib/spawn_operator/versions/api/v1/actor_host.ex b/spawn_operator/spawn_operator/lib/spawn_operator/versions/api/v1/actor_host.ex index 4bf8d611..75c07410 100644 --- a/spawn_operator/spawn_operator/lib/spawn_operator/versions/api/v1/actor_host.ex +++ b/spawn_operator/spawn_operator/lib/spawn_operator/versions/api/v1/actor_host.ex @@ -193,6 +193,13 @@ defmodule SpawnOperator.Versions.Api.V1.ActorHost do properties: image: type: string + imagePullSecrets: + type: array + items: + type: object + properties: + name: + type: string volumeMounts: type: array items: From d8185d4db52b1cb6245d9e478c8726f78a302be0 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Tue, 4 Mar 2025 00:33:37 -0300 Subject: [PATCH 3/3] fix: correct semantic for image pull secrets --- .../lib/spawn_operator/k8s/proxy/deployment.ex | 4 ++-- .../lib/spawn_operator/versions/api/v1/actor_host.ex | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/spawn_operator/spawn_operator/lib/spawn_operator/k8s/proxy/deployment.ex b/spawn_operator/spawn_operator/lib/spawn_operator/k8s/proxy/deployment.ex index e7d7bd1a..fb797f5e 100644 --- a/spawn_operator/spawn_operator/lib/spawn_operator/k8s/proxy/deployment.ex +++ b/spawn_operator/spawn_operator/lib/spawn_operator/k8s/proxy/deployment.ex @@ -459,9 +459,9 @@ defmodule SpawnOperator.K8s.Proxy.Deployment do defp maybe_put_image_pull_secrets( spec, - %{"imagePullSecrets" => image_pull_secrets} = _host_params + %{"pullSecretRef" => secret_name} = _host_params ) do - Map.merge(spec, %{"imagePullSecrets" => image_pull_secrets}) + Map.merge(spec, %{"imagePullSecrets" => %{"name" => secret_name}}) end defp maybe_put_image_pull_secrets(spec, _), do: spec diff --git a/spawn_operator/spawn_operator/lib/spawn_operator/versions/api/v1/actor_host.ex b/spawn_operator/spawn_operator/lib/spawn_operator/versions/api/v1/actor_host.ex index 75c07410..ecf86be8 100644 --- a/spawn_operator/spawn_operator/lib/spawn_operator/versions/api/v1/actor_host.ex +++ b/spawn_operator/spawn_operator/lib/spawn_operator/versions/api/v1/actor_host.ex @@ -193,13 +193,8 @@ defmodule SpawnOperator.Versions.Api.V1.ActorHost do properties: image: type: string - imagePullSecrets: - type: array - items: - type: object - properties: - name: - type: string + pullSecretsRef: + type: string volumeMounts: type: array items: