Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the schema creation from the module #33

Open
pditommaso opened this issue Jan 25, 2024 · 0 comments
Open

Remove the schema creation from the module #33

pditommaso opened this issue Jan 25, 2024 · 0 comments
Assignees

Comments

@pditommaso
Copy link
Contributor

pditommaso commented Jan 25, 2024

The Tower schema will be managed independently by the Terraform module, therefore the following code should be removed

resource "kubernetes_job_v1" "seqera_schema_job" {
count = var.create_db_cluster && var.create_db_cluster && var.create_eks_cluster ? 1 : 0
metadata {
name = var.db_setup_job_name
namespace = var.seqera_namespace_name
}
spec {
backoff_limit = 1
template {
metadata {
name = var.db_setup_job_name
}
spec {
container {
name = var.db_setup_job_name
image = var.db_setup_job_image
command = ["mysql"]
args = [
"--host=${module.db[0].db_instance_address}",
"--user=${var.db_root_username}",
"--password=${local.db_root_password}",
"-e", <<-EOT
ALTER DATABASE ${var.db_app_schema_name} CHARACTER SET utf8 COLLATE utf8_bin;
CREATE USER IF NOT EXISTS ${var.db_app_username} IDENTIFIED BY "${local.db_app_password}";
GRANT ALL PRIVILEGES ON ${var.db_app_schema_name}.* TO ${var.db_app_username}@'%';
EOT
]
}
restart_policy = "Never"
dns_config {
searches = ["kube-dns.kube-system.svc.cluster.local"]
}
}
}
}
wait_for_completion = true
timeouts {
create = "10m"
update = "5m"
}
depends_on = [
module.eks,
module.db
]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants