Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nimbolus/tf-rancher
Deploy Rancher with Terraform on OpenStack
https://github.com/nimbolus/tf-rancher
openstack rancher terraform terraform-module
Last synced: 5 days ago
JSON representation
Deploy Rancher with Terraform on OpenStack
- Host: GitHub
- URL: https://github.com/nimbolus/tf-rancher
- Owner: nimbolus
- License: bsd-3-clause
- Created: 2020-09-16T18:30:55.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-19T22:59:23.000Z (15 days ago)
- Last Synced: 2024-12-19T23:35:56.005Z (15 days ago)
- Topics: openstack, rancher, terraform, terraform-module
- Language: HCL
- Homepage:
- Size: 167 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform Module - Rancher
Sets up a Rancher (Platform for Kubernetes Management) cluster on top of OpenStack.
For an overview of the options, checkout [variables.tf](./variables.tf)
## Example
```terraform
resource "openstack_compute_keypair_v2" "rancher_cluster" {
name = "rancher-cluster"
}module "rancher" {
source = "git::https://github.com/nimbolus/tf-rancher.git?ref=v0.7.0"cluster_availability_zone = "nova"
cluster_image_name = "ubuntu-20.04"
cluster_key_pair = openstack_compute_keypair_v2.rancher_cluster.name
cluster_server_group_policy = "anti-affinity"
cluster_network_id = data.openstack_networking_network_v2.rancher.id
cluster_subnet_id = data.openstack_networking_subnet_v2.rancher.id
rancher_hostname = "rancher.example.com"
}output "rancher_cluster_kubeconfig" {
value = module.rancher.kubeconfig
sensitive = true
}provider "rancher2" {
alias = "bootstrap"api_url = "https://rancher.example.com"
bootstrap = true
}resource "rancher2_bootstrap" "admin" {
provider = rancher2.bootstrapcurrent_password = module.rancher.rancher_bootstrap_password
password = module.rancher.rancher_bootstrap_password
telemetry = false
}provider "rancher2" {
api_url = rancher2_bootstrap.admin.url
token_key = rancher2_bootstrap.admin.token
}module "rancher_sa_test" {
source = "git::https://github.com/nimbolus/tf-rancher.git//service-account?ref=v0.7.0"name = "test"
email = "[email protected]"
}
```## Upgrade Notes
### v0.7.0
Upgrade to `v0.6.1` first and migrate kubectl provider resources if needed:
```sh
tofu state rm module.rancher.kubectl_manifest.cluster_issuer
tofu state rm module.rancher.kubectl_manifest.rancher_certificate
tofu import 'module.rancher.kubernetes_manifest.cluster_issuer[0]' \
"apiVersion=cert-manager.io/v1kind=ClusterIssuser,name=letsencrypt"
tofu import 'module.rancher.kubernetes_manifest.rancher_certificate[0]' \
"apiVersion=cert-manager.iov1,kind=Certificate,namespace=cattle-system,name=rancher"
```Then upgrade to `v0.7.0`