-
Notifications
You must be signed in to change notification settings - Fork 988
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
add the fields "serviceAccountName" and "serviceAccount" in the "kubernetes_cron_job" resource. #2070
Comments
Hi @aloosnetmatch,
Here is some documentation that should explain further and assist with implementing this: Job Template Spec and Cron_Job_v1 Resource. |
@sheneska |
Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you! |
It seems that resource "kubernetes_cron_job_v1" "replica" {
metadata {
name = "my-job"
namespace = "default"
}
spec {
schedule = "0 */2 * * *" # Every 2 hours
job_template {
metadata {
name = "test"
namespace = "default"
}
spec {
template {
metadata {
name = "test"
}
spec {
restart_policy = "Never"
# Use well known service account that have permissions to write state into kubernetes
service_account_name = "xxx"
container {
name = "terraform"
image = "hashicorp/terraform:1.9"
# args = ["apply", "-auto-approve"]
args = ["plan"]
working_dir = "/app"
env {
name = "TF_INPUT"
value = "0"
}
}
}
}
}
}
}
} |
Description
I want to use my own serviceaccount to run a Cronjob in Kubernetes.
Now it looks like the cronjob uses the "default" account from the namespace it's located in.
add the fields "serviceAccountName" and "serviceAccount" in the "kubernetes_cron_job" resource.
Potential Terraform Configuration
The text was updated successfully, but these errors were encountered: