You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
2.3 KiB

  1. #######################################################
  2. #### Incomplete
  3. ####
  4. #### By Sagnik Bhattacharya, 2024
  5. ####
  6. #######################################################
  7. terraform {
  8. required_providers {
  9. openstack = {
  10. source = "terraform-provider-openstack/openstack"
  11. version = "~> 1.0"
  12. }
  13. kubernetes = {
  14. source = "hashicorp/kubernetes"
  15. version = "~> 2.0"
  16. }
  17. }
  18. }
  19. provider "openstack" {
  20. auth_url = var.auth_url
  21. region = var.region
  22. tenant_name = var.tenant_name
  23. user_name = var.user_name
  24. password = var.password
  25. domain_name = var.domain_name
  26. }
  27. provider "kubernetes" {
  28. host = var.kubernetes_host
  29. client_certificate = file(var.client_certificate)
  30. client_key = file(var.client_key)
  31. cluster_ca_certificate = file(var.cluster_ca_certificate)
  32. }
  33. # Define variables without default values
  34. variable "auth_url" {
  35. description = "OpenStack authentication URL"
  36. type = string
  37. }
  38. variable "region" {
  39. description = "OpenStack region"
  40. type = string
  41. }
  42. variable "tenant_name" {
  43. description = "OpenStack tenant name"
  44. type = string
  45. }
  46. variable "user_name" {
  47. description = "OpenStack username"
  48. type = string
  49. }
  50. variable "password" {
  51. description = "OpenStack password"
  52. type = string
  53. sensitive = true
  54. }
  55. variable "domain_name" {
  56. description = "OpenStack domain name"
  57. type = string
  58. }
  59. variable "ssh_public_key" {
  60. description = "Path to the SSH public key"
  61. type = string
  62. }
  63. variable "kubernetes_host" {
  64. description = "Kubernetes API server URL"
  65. type = string
  66. }
  67. variable "client_certificate" {
  68. description = "Path to the client certificate for Kubernetes"
  69. type = string
  70. }
  71. variable "client_key" {
  72. description = "Path to the client key for Kubernetes"
  73. type = string
  74. }
  75. variable "cluster_ca_certificate" {
  76. description = "Path to the cluster CA certificate for Kubernetes"
  77. type = string
  78. }
  79. variable "num_worker_nodes" {
  80. description = "Number of worker nodes to create"
  81. type = number
  82. }
  83. variable "master_flavor" {
  84. description = "Flavor for the master node"
  85. type = string
  86. }
  87. variable "worker_flavor" {
  88. description = "Flavor for the worker nodes"
  89. type = string
  90. }
  91. variable "os_image" {
  92. description = "OS image to use for instances"
  93. type = string
  94. }