Can you run lifecycle jobs from different namespaces?

Hey,

So i have a environment that runs a terraform lifecycle job, this is always created a randomstring- namespace.

I would like to add another lifecycle job that will call argo workflow, at present i have that working via running jobs in the argo namespace.

Is it possible to deploy different lifecycles in the same deployment to different namespaces?

Hello @Stephen_Bennett ,

Thank you for your question,
I’ll loop with the team and get back to you.

Regards,
Charles-Edouard

Hello @Stephen_Bennett,

The namespace where your job is deployed corresponds to your job’s environment: so 1 environment = 1 namespace from Qovery point of view (the randomstring is actually the short Qovery Environment ID)

I would like to add another lifecycle job that will call argo workflow

Do you have more details about this step ? e.g is it a simple HTTP call to your argo service ?

Thank you !

Hi,

so high level the approach is:

  • deploy some aws resources for a service
  • run a workflow job that does some funtional tests of the service

so we auth with workflows via cluster auth, which means if the argo cli is called from a pod within the namespace of argo it will auth.

If its not possible to run lifecycle jobs from different namespaces, we will need to add a middle step, which is to create a SA in the new namespace via terraform) and then run the workflow. but it just means extra clean up and delay in doing things

im looking at how to do this via adding a SA to the namespace that qovery creates,

but not sure how i can run terraform against a random gen namespace? is there a way to fix the namespace to something and make everything run from there instead?

ideally id like to create tf module that can be reused as the permissions for the SA will always be the same, not sure how to link it together at present

not pretty but doing a data call to the qovery data and then filtering on the qovery_kubernetes_namespace gets me it,

for anyone elses needs its:

data "qovery_environment" "env" {
  id = var.environment
}

resource "kubernetes_service_account" "sa" {
  metadata {
    name      = "workflows-sa"
    namespace = [for env_var in data.qovery_environment.env.built_in_environment_variables : env_var.value if env_var.key == "QOVERY_KUBERNETES_NAMESPACE_NAME"][0]
  }
}

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.