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

feat!: dynamic operator yaml #693

Merged
merged 6 commits into from
Jan 12, 2021
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions modules/k8s-operator-crd-support/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,18 @@ data "template_file" "k8sop_config" {
}
}

resource "local_file" "operator_cr" {
content = data.template_file.k8sop_config.rendered
filename = "${path.module}/${var.project_id}-${var.cluster_name}/operator_cr.yaml"
}

module "k8sop_config" {
source = "terraform-google-modules/gcloud/google//modules/kubectl-wrapper"
version = "~> 2.0.2"
module_depends_on = [module.k8s_operator.wait, module.k8sop_creds_secret.wait]
cluster_name = var.cluster_name
cluster_location = var.location
project_id = var.project_id
create_cmd_triggers = { configmanagement = local_file.operator_cr.content }
create_cmd_triggers = { configmanagement = data.template_file.k8sop_config.rendered }
service_account_key_file = var.service_account_key_file

kubectl_create_command = "kubectl apply -f ${local_file.operator_cr.filename}"
kubectl_destroy_command = "kubectl delete -f ${local_file.operator_cr.filename}"
kubectl_create_command = "kubectl apply -f - <<EOF\n${data.template_file.k8sop_config.rendered}EOF"
kubectl_destroy_command = "kubectl delete -f - <<EOF\n${data.template_file.k8sop_config.rendered}EOF"
}

module "wait_for_gatekeeper" {
Expand Down