Skip to content

Commit

Permalink
updates support for overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
3pings committed Mar 20, 2024
1 parent 75852b3 commit 4efed4f
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.88.2
rev: v1.74.1
hooks:
- id: terraform_fmt
- id: terraform_docs
# - id: terraform_validate
- id: terraform_tflint
args:
- --minimum-failure-severity=notice --recursive --config
- --args=--disable-rule=terraform_module_version
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Additionally, with the "VIP" tag, we enable Kubevip for HA. The Edge Host is no
```
module "edge-demo-module" {
source = "spectrocloud/edge/spectrocloud"
version = "1.2.1"
version = "1.3.1"
# Store Number/Location
name = "demo"
# add tags to the cluster (optional) list(strings)
Expand All @@ -46,6 +46,9 @@ module "edge-demo-module" {
# Cluster VIP to be used with KubeVIP
cluster_vip = "10.100.100.32"
# Overlay CIDR Range
# overlay_cidr_range = "100.64.128.0/18"
# Node Pools for Cluster
machine_pools = [
# Control Plane Node Pool
Expand Down Expand Up @@ -155,15 +158,14 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_binding_role"></a> [binding\_role](#input\_binding\_role) | Role binding type to be created with the cluster. | `map(string)` | `null` | no |
| <a name="input_binding_type"></a> [binding\_type](#input\_binding\_type) | Role binding type to be created with the cluster. | `string` | `null` | no |
| <a name="input_cluster_profiles"></a> [cluster\_profiles](#input\_cluster\_profiles) | Values for the profile(s) to be used for cluster creation. For `context` a value of [project tenant system] is expected. | <pre>list(object({<br> name = string<br> tag = optional(string)<br> context = string # project tenant system<br> packs = optional(list(object({<br> name = string<br> tag = string<br> values = optional(string)<br> manifest = optional(list(object({<br> name = string<br> tag = string<br> content = string<br> })))<br> })))<br> }))</pre> | n/a | yes |
| <a name="input_cluster_tags"></a> [cluster\_tags](#input\_cluster\_tags) | Tags to be added to the profile. key:value | `list(string)` | `[]` | no |
| <a name="input_cluster_vip"></a> [cluster\_vip](#input\_cluster\_vip) | IP Address for Cluster VIP for HA. Must be unused on on the same layer 2 segment as the node IPs. | `string` | n/a | yes |
| <a name="input_cluster_vip"></a> [cluster\_vip](#input\_cluster\_vip) | IP Address for Cluster VIP for HA. Must be unused on on the same layer 2 segment as the node IPs. | `string` | `""` | no |
| <a name="input_location"></a> [location](#input\_location) | Optional - If used Latitude and Longitude represent the coordinates of the location you wish to assign to the cluster. https://www.latlong.net/ is one tool that can be used to find this. | <pre>object({<br> latitude = optional(number)<br> longitude = optional(number)<br> })</pre> | <pre>{<br> "latitude": 0,<br> "longitude": 0<br>}</pre> | no |
| <a name="input_machine_pools"></a> [machine\_pools](#input\_machine\_pools) | Values for the attributes of the Node Pools. 'edge\_host\_tags' is used to lookup the Edge Host already registered with Palette. | <pre>list(object({<br> name = string<br> additional_labels = optional(map(string))<br> control_plane = optional(bool)<br> control_plane_as_worker = optional(bool)<br> taints = optional(list(object({<br> effect = string<br> key = string<br> value = string<br> })))<br> edge_host = list(object({<br> host_uid = string<br> static_ip = optional(string)<br><br> }))<br> }))</pre> | n/a | yes |
| <a name="input_name"></a> [name](#input\_name) | Name of the cluster to be created. | `string` | n/a | yes |
| <a name="input_ntp_servers"></a> [ntp\_servers](#input\_ntp\_servers) | n/a | `list(string)` | `[]` | no |
| <a name="input_overlay_cidr_range"></a> [overlay\_cidr\_range](#input\_overlay\_cidr\_range) | CIDR range for the overlay network. | `string` | `""` | no |
| <a name="input_rbac_bindings"></a> [rbac\_bindings](#input\_rbac\_bindings) | RBAC Bindings to be added to the cluster | <pre>list(object({<br> rbac_type = string<br> namespace = optional(string)<br> rbac_role = optional(map(string))<br> subjects = optional(list(object({<br> name = string<br> rbac_type = string<br> namespace = optional(string)<br> })))<br> }))</pre> | `[]` | no |
| <a name="input_skip_wait_for_completion"></a> [skip\_wait\_for\_completion](#input\_skip\_wait\_for\_completion) | n/a | `bool` | `true` | no |
| <a name="input_ssh_keys"></a> [ssh\_keys](#input\_ssh\_keys) | n/a | `list(string)` | `[]` | no |
Expand Down
7 changes: 5 additions & 2 deletions examples/cluster.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "edge-demo-module" {
source = "spectrocloud/edge/spectrocloud"
version = "1.2.1"
version = "1.3.1"
# Store Number/Location
name = "demo"
# add tags to the cluster (optional) list(strings)
Expand All @@ -13,9 +13,12 @@ module "edge-demo-module" {
"10.10.10.2"
]

# Cluster VIP to be used with KubeVIP
# Cluster VIP to be used with KubeVIP
cluster_vip = "10.100.100.32"

# Overlay CIDR Range
# overlay_cidr_range = "100.64.128.0/18"

# Node Pools for Cluster
machine_pools = [
# Control Plane Node Pool
Expand Down
15 changes: 12 additions & 3 deletions examples/variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Spectro Cloud
variable "sc_host" {}
variable "sc_api_key" {}
variable "sc_project_name" {}
variable "sc_host" {
description = "Spectro Cloud API Host"
type = string
}
variable "sc_api_key" {
description = "Spectro Cloud API Key"
type = string
}
variable "sc_project_name" {
description = "Spectro Cloud Project Name"
type = string
}
7 changes: 4 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ resource "spectrocloud_cluster_edge_native" "this" {
tags = var.cluster_tags
skip_completion = var.skip_wait_for_completion
cloud_config {
ssh_keys = var.ssh_keys
vip = var.cluster_vip
ntp_servers = var.ntp_servers
ssh_keys = var.ssh_keys
vip = var.cluster_vip
overlay_cidr_range = var.overlay_cidr_range
ntp_servers = var.ntp_servers
}
location_config {
latitude = var.location.latitude
Expand Down
26 changes: 16 additions & 10 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ variable "rbac_bindings" {
variable "cluster_vip" {
type = string
description = "IP Address for Cluster VIP for HA. Must be unused on on the same layer 2 segment as the node IPs."
default = ""
}
variable "overlay_cidr_range" {
type = string
description = "CIDR range for the overlay network."
default = ""
}
variable "ssh_keys" {
type = list(string)
Expand All @@ -87,14 +93,14 @@ variable "location" {
description = "Optional - If used Latitude and Longitude represent the coordinates of the location you wish to assign to the cluster. https://www.latlong.net/ is one tool that can be used to find this."
}

variable "binding_type" {
type = string
description = "Role binding type to be created with the cluster."
default = null
}
# variable "binding_type" {
# type = string
# description = "Role binding type to be created with the cluster."
# default = null
# }

variable "binding_role" {
type = map(string)
description = "Role binding type to be created with the cluster."
default = null
}
# variable "binding_role" {
# type = map(string)
# description = "Role binding type to be created with the cluster."
# default = null
# }

0 comments on commit 4efed4f

Please sign in to comment.