terraform-provider-kubernetes/_examples/cross-cluster
hashicorp-copywrite[bot] 53d15085ea
[COMPLIANCE] Add Copyright and License Headers (#1982)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-03-03 10:15:24 +01:00
..
main.tf [COMPLIANCE] Add Copyright and License Headers (#1982) 2023-03-03 10:15:24 +01:00
README.md Refactor kubernetes client config initialization and fix in-cluster config (#690) 2020-02-03 13:56:09 +01:00

Example: Cross-cluster

Running terraform in a kubernetes cluster but targetting another cluster, i.e. not using in-cluster config.

Prerequisites

This example uses syntax elements specific to Terraform version 0.12+. It will not work out-of-the-box with Terraform 0.11.x and lower.

Standard run:

# terraform apply \
  -var "minikube_host_ip=$(minikube --profile kubernetes-1.16 ip)" \
  -var "minikube_target_ip=$(minikube --profile kubernetes-1.15 ip)"

With a custom build:

# terraform apply \
  -var "minikube_host_ip=$(minikube --profile kubernetes-1.16 ip)" \
  -var "minikube_target_ip=$(minikube --profile kubernetes-1.15 ip)" \
  -var "in_cluster_provider_version=v1.10.1-dev" \
  -var "in_cluster_provider_url=https://storage.googleapis.com/my-custom-bucket/terraform-provider-kubernetes"