Skip to content

Commit 58c84d6

Browse files
authored
Support bring your own (sassoftware#128)
1 parent cc13998 commit 58c84d6

File tree

20 files changed

+543
-236
lines changed

20 files changed

+543
-236
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ docs/
33
*.txt
44
terraform.tfstate*
55
examples/
6-
6+
.terraform/

docs/CONFIG-VARS.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Supported configuration variables are listed in the table below. All variables
99
- [Required Variables](#required-variables)
1010
- [Azure Authentication](#azure-authentication)
1111
- [Admin Access](#admin-access)
12+
- [Networking](#networking)
13+
- [Use Existing](#use-existing)
1214
- [General](#general)
1315
- [Nodepools](#nodepools)
1416
- [Default Nodepool](#default-nodepool)
@@ -68,6 +70,69 @@ You can use `default_public_access_cidrs` to set a default range for all created
6870
| postgres_access_cidrs | IP Ranges allowed to access the Azure PostgreSQL Server | list of strings |||
6971
| acr_access_cidrs | IP Ranges allowed to access the ACR instance | list of strings |||
7072

73+
## Networking
74+
| Name | Description | Type | Default | Notes |
75+
| :--- | ---: | ---: | ---: | ---: |
76+
| vnet_address_space | Address space for created vnet | string | "192.168.0.0/16" | This variable is ignored when vnet_name is set (aka bring your own vnet) |
77+
| subnets | Subnets to be created and their settings | map(object) | *check below* | This variable is ignored when subnet_names is set (aka bring your own subnets). All defined subnets must exist within the vnet address space. |
78+
79+
The default values for the subnets variable are:
80+
81+
```yaml
82+
{
83+
aks = {
84+
"prefixes": ["192.168.0.0/23"],
85+
"service_endpoints": ["Microsoft.Sql"],
86+
"enforce_private_link_endpoint_network_policies": false,
87+
"enforce_private_link_service_network_policies": false,
88+
"service_delegations": {},
89+
}
90+
misc = {
91+
"prefixes": ["192.168.2.0/24"],
92+
"service_endpoints": ["Microsoft.Sql"],
93+
"enforce_private_link_endpoint_network_policies": false,
94+
"enforce_private_link_service_network_policies": false,
95+
"service_delegations": {},
96+
}
97+
## If using ha storage then the following is also added
98+
netapp = {
99+
"prefixes": ["192.168.3.0/24"],
100+
"service_endpoints": [],
101+
"enforce_private_link_endpoint_network_policies": false,
102+
"enforce_private_link_service_network_policies": false,
103+
"service_delegations": {
104+
netapp = {
105+
"name" : "Microsoft.Netapp/volumes"
106+
"actions" : ["Microsoft.Network/networkinterfaces/*", "Microsoft.Network/virtualNetworks/subnets/join/action"]
107+
}
108+
}
109+
}
110+
}
111+
```
112+
113+
### Use Exisiting
114+
When desiring to deploy into exising resource group, vnet, subnets, or network security group the varaiables below can be used to define the exsting resources
115+
116+
| Name | Description | Type | Default | Notes |
117+
| :--- | ---: | ---: | ---: | ---: |
118+
| resource_group_name | Name of pre-existing resource group | string | null | Only required if deploying into existing resource group|
119+
| vnet_name | Name of pre-existing vnet | string | null | Only required if deploying into existing vnet |
120+
| nsg_name | Name of pre-existing network security group | string | null | Only required if deploying into existing nsg |
121+
| subnet_names | Existing subnets mapped to desired usage | map(string) | null | Only required if deploying into existing subnets. See example below |
122+
123+
Example subnet_names variable:
124+
125+
```yaml
126+
subnet_names = {
127+
## Required subnets
128+
'aks': '<my_aks_subnet_name>',
129+
'misc': '<my_misc_subnet_name>',
130+
131+
## If using ha storage then the following is also required
132+
'netapp': '<my_netapp_subnet_name>'
133+
}
134+
```
135+
71136
## General
72137

73138
Ubuntu 18.04 LTS is the operating system used on the Jump/NFS servers. Ubuntu creates the `/mnt` location as an ephemeral drive and cannot be used as the root location of the `jump_rwx_filestore_path` variable.

examples/sample-input-byo.tfvars

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# !NOTE! - These are only a subset of variables.tf provided for sample.
2+
# Customize this file to add any variables from 'variables.tf' that you want
3+
# to change their default values.
4+
5+
# **************** REQUIRED VARIABLES ****************
6+
# These required variables' values MUST be provided by the User
7+
prefix = "<prefix-value>"
8+
location = "<azure-location-value>" # e.g., "eastus2"
9+
ssh_public_key = "~/.ssh/id_rsa.pub"
10+
# **************** REQUIRED VARIABLES ****************
11+
12+
# Bring your own existing resources
13+
resource_group_name = "<existing-resource-group-name>" # only needed if using pre-existing
14+
vnet_name = "<existing-vnet-name>" # only needed if using pre-existing
15+
nsg_name = "<existing-nsg-name>" # only needed if using pre-existing
16+
subnet_names = {
17+
"aks": "<existing-subnet-name-1>",
18+
"misc": "<existing-subnet-name-2>",
19+
"netapp": "<existing-subnet-name-3>" # only needed if using ha storage (aka netapp)
20+
}
21+
22+
# !NOTE! - Without specifying your CIDR block access rules, ingress traffic
23+
# to your cluster will be blocked by default.
24+
25+
# ************** RECOMMENDED VARIABLES ***************
26+
default_public_access_cidrs = [] # e.g., ["123.45.6.89/32"]
27+
# ************** RECOMMENDED VARIABLES ***************
28+
29+
# Tags for all taggable items in your cluster.
30+
tags = {} # e.g., { "key1" = "value1", "key2" = "value2" }
31+
32+
# Azure Postgres config
33+
create_postgres = true # set this to "false" when using internal Crunchy Postgres
34+
postgres_ssl_enforcement_enabled = false
35+
postgres_administrator_password = "mySup3rS3cretPassw0rd"
36+
37+
# Azure Container Registry config
38+
create_container_registry = false
39+
container_registry_sku = "Standard"
40+
container_registry_admin_enabled = false
41+
container_registry_geo_replica_locs = null
42+
43+
# AKS config
44+
kubernetes_version = "1.18.14"
45+
default_nodepool_min_nodes = 2
46+
default_nodepool_vm_type = "Standard_D8s_v4"
47+
48+
# AKS Node Pools config
49+
node_pools = {
50+
cas = {
51+
"machine_type" = "Standard_E16s_v3"
52+
"os_disk_size" = 200
53+
"min_nodes" = 1
54+
"max_nodes" = 1
55+
"max_pods" = 110
56+
"node_taints" = ["workload.sas.com/class=cas:NoSchedule"]
57+
"node_labels" = {
58+
"workload.sas.com/class" = "cas"
59+
}
60+
},
61+
compute = {
62+
"machine_type" = "Standard_E16s_v3"
63+
"os_disk_size" = 200
64+
"min_nodes" = 1
65+
"max_nodes" = 1
66+
"max_pods" = 110
67+
"node_taints" = ["workload.sas.com/class=compute:NoSchedule"]
68+
"node_labels" = {
69+
"workload.sas.com/class" = "compute"
70+
"launcher.sas.com/prepullImage" = "sas-programming-environment"
71+
}
72+
},
73+
connect = {
74+
"machine_type" = "Standard_E16s_v3"
75+
"os_disk_size" = 200
76+
"min_nodes" = 1
77+
"max_nodes" = 1
78+
"max_pods" = 110
79+
"node_taints" = ["workload.sas.com/class=connect:NoSchedule"]
80+
"node_labels" = {
81+
"workload.sas.com/class" = "connect"
82+
"launcher.sas.com/prepullImage" = "sas-programming-environment"
83+
}
84+
},
85+
stateless = {
86+
"machine_type" = "Standard_D16s_v3"
87+
"os_disk_size" = 200
88+
"min_nodes" = 1
89+
"max_nodes" = 2
90+
"max_pods" = 110
91+
"node_taints" = ["workload.sas.com/class=stateless:NoSchedule"]
92+
"node_labels" = {
93+
"workload.sas.com/class" = "stateless"
94+
}
95+
},
96+
stateful = {
97+
"machine_type" = "Standard_D8s_v3"
98+
"os_disk_size" = 200
99+
"min_nodes" = 1
100+
"max_nodes" = 3
101+
"max_pods" = 110
102+
"node_taints" = ["workload.sas.com/class=stateful:NoSchedule"]
103+
"node_labels" = {
104+
"workload.sas.com/class" = "stateful"
105+
}
106+
}
107+
}
108+
109+
# Jump Box
110+
create_jump_public_ip = true
111+
jump_vm_admin = "jumpuser"
112+
jump_vm_machine_type = "Standard_B2s"
113+
114+
# Storage for SAS Viya CAS/Compute
115+
storage_type = "standard"
116+
# required ONLY when storage_type is "standard" to create NFS Server VM
117+
create_nfs_public_ip = false
118+
nfs_vm_admin = "nfsuser"
119+
nfs_vm_machine_type = "Standard_D8s_v4"
120+
nfs_raid_disk_size = 128
121+
nfs_raid_disk_type = "Standard_LRS"
122+
123+
# Azure Monitor
124+
create_aks_azure_monitor = false

0 commit comments

Comments
 (0)