{"id":15065575,"url":"https://github.com/remche/terraform-openstack-rke","last_synced_at":"2025-04-10T16:40:53.720Z","repository":{"id":55609117,"uuid":"232664819","full_name":"remche/terraform-openstack-rke","owner":"remche","description":"Terraform Openstack RKE","archived":false,"fork":false,"pushed_at":"2021-10-08T12:22:54.000Z","size":154,"stargazers_count":37,"open_issues_count":3,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T14:21:24.809Z","etag":null,"topics":["kubernetes","kubernetes-deployment","openstack","rke","terraform","terraform-module"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remche.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-08T21:37:13.000Z","updated_at":"2024-03-30T05:04:43.000Z","dependencies_parsed_at":"2022-08-15T04:20:27.144Z","dependency_job_id":null,"html_url":"https://github.com/remche/terraform-openstack-rke","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remche%2Fterraform-openstack-rke","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remche%2Fterraform-openstack-rke/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remche%2Fterraform-openstack-rke/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remche%2Fterraform-openstack-rke/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remche","download_url":"https://codeload.github.com/remche/terraform-openstack-rke/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248252727,"owners_count":21072702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kubernetes","kubernetes-deployment","openstack","rke","terraform","terraform-module"],"created_at":"2024-09-25T00:42:00.749Z","updated_at":"2025-04-10T16:40:53.695Z","avatar_url":"https://github.com/remche.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-openstack-rke\n\n[![Terraform Registry](https://img.shields.io/badge/terraform-registry-blue.svg)](https://registry.terraform.io/modules/remche/rke/openstack)\n[![Build Status](https://travis-ci.com/remche/terraform-openstack-rke.svg?branch=master)](https://travis-ci.com/remche/terraform-openstack-rke)\n\n[Terraform](https://www.terraform.io/) module to deploy [Kubernetes](https://kubernetes.io) with [RKE](https://rancher.com/docs/rke/latest/en/) on [OpenStack](https://www.openstack.org/).\n\nInspired by [Marco Capuccini](https://github.com/mcapuccini/terraform-openstack-rke) work, rewritten from scratch for Terraform 0.12+ and new [terraform-rke-provider](https://github.com/rancher/terraform-provider-rke).\n\n\u003e 💥 You can now use the next generation rke/openstack module, go to [terraform-openstack-rke2](https://github.com/remche/terraform-openstack-rke2/) :boom:\n\n## Table of contents\n- [Prerequisites](#prerequisites)\n- [Upgrading to Terraform 0.13](#terraform-0.13-upgrade)\n- [Examples](#examples)\n- [Documentation](#documentation)\n\n## Prerequisites\n\n- [Terraform](https://www.terraform.io/) 0.13+. For Terraform 0.12.x, use terraform/v0.12 branch.\n- [OpenStack](https://docs.openstack.org/zh_CN/user-guide/common/cli-set-environment-variables-using-openstack-rc.html) environment properly sourced.\n- A Openstack image fullfiling [RKE requirements](https://rancher.com/docs/rke/latest/en/os/).\n- At least one Openstack floating IP.\n\n## Terraform 0.13 upgrade\n\nterraform-openstack-rke \u003e= 0.5 supports Terraform \u003e= 0.13. Some changes in the way Terraform manage providers require manual operations.\n\n```hcl\nterraform 0.13upgrade\nterraform  state replace-provider 'registry.terraform.io/-/rke' 'registry.terraform.io/rancher/rke'\nterraform init\n```\n\nFor more informations see [Upgrading to Terraform v0.13](https://www.terraform.io/upgrade-guides/0-13.html)\n\n\u003e :warning: There is some deep changes between 0.4 and 0.5 branches. This may lead to a replacement of the nodes and the rke cluster resources :warning:\n\n## Examples\n### Minimal example with master node as egde node and two worker nodes\n\n```hcl\n# Consider using 'export TF_VAR_os_auth_url=$OS_AUTH_URL'\nvariable \"os_auth_url\"{}\n# Consider using 'export TF_VAR_os_password=$OS_PASSWORD'\nvariable \"os_password\"{}\n\n module \"rke\" {\n  source  = \"remche/rke/openstack\"\n  image_name          = \"ubuntu-18.04-docker-x86_64\"\n  public_net_name     = \"public\"\n  master_flavor_name  = \"m1.small\"\n  worker_flavor_name  = \"m1.small\"\n  os_auth_url         = var.os_auth_url\n  os_password         = var.os_password\n}\n```\n\n###  Minimal example with two egde nodes and one worker nodes\n\n```hcl\n# Consider using 'export TF_VAR_os_auth_url=$OS_AUTH_URL'\nvariable \"os_auth_url\"{}\n# Consider using 'export TF_VAR_os_password=$OS_PASSWORD'\nvariable \"os_password\"{}\n\n module \"rke\" {\n  source  = \"remche/rke/openstack\"\n  image_name          = \"ubuntu-18.04-docker-x86_64\"\n  public_net_name     = \"public\"\n  master_flavor_name  = \"m1.small\"\n  worker_flavor_name  = \"m1.small\"\n  edge_count          = 2\n  worker_count        = 1\n  master_labels       = {\"node-role.kubernetes.io/master\" = \"true\"}\n  edge_labels         = {\"node-role.kubernetes.io/edge\" = \"true\"}\n  os_auth_url         = var.os_auth_url\n  os_password         = var.os_password\n}\n```\n\n## Documentation\n\nSee [USAGE.md](USAGE.md) for all available options.\n\n### Keypair\n\nYou can either specify a ssh key file to generate new keypair via `ssh_key_file` (default) or specify already existent keypair via `ssh_keypair_name`.\n\n\u003e :warning: Default config will try to use  [ssh agent](https://linux.die.net/man/1/ssh-agent) for ssh connections to the nodes. Add `use_ssh_agent = false` if you don't use it.\n\n### Secgroup\n\nYou can define your own rules (e.g. limiting port 22 and 6443 to admin box).\n\n```hcl\nsecgroup_rules      = [ { \"source\" = \"x.x.x.x\", \"protocol\" = \"tcp\", \"port\" = 22 },\n                        { \"source\" = \"x.x.x.x\", \"protocol\" = \"tcp\", \"port\" = 6443 },\n                        { \"source\" = \"0.0.0.0/0\", \"protocol\" = \"tcp\", \"port\" = 80 },\n                        { \"source\" = \"0.0.0.0/0\", \"protocol\" = \"tcp\", \"port\" = 443}\n                      ]\n```\n\n### Nodes\n\nDefault config will deploy one master and two worker nodes. It will use Traefik (nginx not supported in this case).\nYou can define edge nodes (see [above](#minimal-example-with-two-egde-nodes-and-one-worker-nodes)).\n\nYou can set [affinity policy](https://www.terraform.io/docs/providers/openstack/r/compute_servergroup_v2.html#policies) for each nodes group (master, worker, edge) via `{master,worker,edge}_server_affinity`. Default is `soft-anti-affinity`.\n\n\u003e :warning: `soft-anti-affinity` and `soft-affinity` needs Compute service API 2.15 or above.\n\nYou can use `wait_for_commands` to specify a list of commands to be run before invoking RKE. It can be useful when installing Docker at provision time (note that cooking your image embedding Docker with [Packer](https://packer.io) is a better practice though) :\n`wait_for_commands = [\"while docker info ; [ $? -ne 0 ]; do echo wait for docker; sleep 30 ; done\"]`\n\n#### Boot from volume\n\nSome providers require to boot the instances from an attached boot volume instead of the nova ephemeral volume.\nTo enable this feature, provide the variables to the config file:\n\n```hcl\nboot_from_volume = true\nboot_volume_size = 20\n```\n### Loadbalancer\n\nIf `enable_loadbalancer = true` this module will create a layer 4 loadbalancer using LBaaS or LBaaSv2 in front of the master nodes or the edge nodes if there are any.\nIt creates appropriate TCP listeners and monitors for HTTP (:80), HTTPS (:443) and Kubernetes API (:6443).\n\nTo use Octavia instead of Neutron Networking as LBaaS, use\n\n```hcl\nuse_octavia = true\n```\n\n### Kubernetes version\n\nYou can specify kubernetes version with `kubernetes_version` variables. Refer to RKE supported version.\n\n### Cloud provider\n\nThe module will deploy [Openstack Cloud Provider](https://rancher.com/docs/rke/latest/en/config-options/cloud-providers/openstack/). \nIt will create the [Kubernetes Storageclasses](https://kubernetes.io/docs/concepts/storage/storage-classes/) for Cinder. If you have many Cinder storage type, you can specify it in [storage_types](variables.tf#L164) variable.\n\nYou can disable cloud provider via `cloud_provider` variable.\n\n### Reverse Proxy\n\nThe module will deploy Traefik by default but you can use nginx-ingress instead. Note that nginx is not supported when master node is the edge node.\n\n### User Add-Ons\n\nYou can specify you own [User Add_Ons](https://rancher.com/docs/rke/latest/en/config-options/add-ons/user-defined-add-ons/) with [addons_include](variables.tf#176) variable.\n\n### Usage with [RancherOS](https://rancher.com/rancher-os/)\n\nRancherOS **needs** a node config drive to be configured. You can also provide a cloud config file :\n\n```hcl\nimage_name          = \"rancheros-1.5.5-x86_64\"\nsystem_user         = \"rancher\"\nnodes_config_drive  = \"true\"\nuser_data_file      = \"rancher.yml\"\n```\n\n### Usage with [Terraform Kubernetes Provider](https://www.terraform.io/docs/providers/kubernetes/index.html) and [Helm Provider](https://www.terraform.io/docs/providers/helm/index.html)\n\n\u003e :warning: **Interpolating provider variables from module output is not the recommended way to achieve integration**. See [here](https://www.terraform.io/docs/providers/kubernetes/index.html) and [here](https://www.terraform.io/docs/configuration/providers.html#provider-configuration).\n\u003e\n\u003e Use of a data sources is recommended.\n\n(Not recommended) You can use this module to populate [Terraform Kubernetes Provider](https://www.terraform.io/docs/providers/kubernetes/index.html) :\n\n```hcl\nprovider \"kubernetes\" {\n  host     = module.rke.rke_cluster.api_server_url\n  username = module.rke.rke_cluster.kube_admin_user\n\n  client_certificate     = module.rke.rke_cluster.client_cert\n  client_key             = module.rke.rke_cluster.client_key\n  cluster_ca_certificate = module.rke.rke_cluster.ca_crt\n}\n```\n\nRecommended way needs two `apply` operations, and setting the proper `terraform_remote_state` data source :\n\n```hcl\nprovider \"kubernetes\" {\n  host     = data.terraform_remote_state.rke.outputs.cluster.api_server_url\n  username = data.terraform_remote_state.rke.outputs.cluster.kube_admin_user\n  client_certificate     = data.terraform_remote_state.rke.outputs.cluster.client_cert\n  client_key             = data.terraform_remote_state.rke.outputs.cluster.client_key\n  cluster_ca_certificate = data.terraform_remote_state.rke.outputs.cluster.ca_crt\n  load_config_file = \"false\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremche%2Fterraform-openstack-rke","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremche%2Fterraform-openstack-rke","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremche%2Fterraform-openstack-rke/lists"}