-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
202 lines (198 loc) · 6.86 KB
/
template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
_version: &module_version 5.7.5
_globals: &global_settings
default_region: "region1"
regions:
region1: {{ .variables.location }}
prefixes: ["dev"]
random_length: 4
passthrough: false
use_slug: false
inherit_tags: false
# Define common used anchors
_p: &provider_azurerm
- azurerm:
features:
resource_group:
prevent_deletion_if_contains_resources: false
# Define template
kind: StackTemplate
name: azure-aks
# Define units itself
units:
-
name: aks-cluster
type: tfmodule
providers:
- azurerm:
features:
resource_group:
prevent_deletion_if_contains_resources: false
skip_provider_registration: true
alias: vhub
- azurerm:
features:
resource_group:
prevent_deletion_if_contains_resources: false
skip_provider_registration: true
source: aztfmod/caf/azurerm
version: "5.7.8"
inputs:
global_settings:
default_region: "region1"
regions:
region1: {{ .variables.location }}
tags:
project: "system services"
providers:
azurerm.vhub: azurerm.vhub
resource_groups:
aks_re1:
name: "aks-re1"
region: "region1"
dns_re1:
name: "dns-re1"
region: "region1"
compute:
aks_clusters:
cluster_re1:
name: "akscluster-re1-001"
resource_group_key: "aks_re1"
os_type: "Linux"
identity:
type: "SystemAssigned"
kubernetes_version: {{ .variables.kubernetes_version }}
vnet_key: "spoke_aks_re1"
network_policy:
network_plugin: "azure"
load_balancer_sku: "Standard"
enable_rbac: true
load_balancer_profile:
managed_outbound_ip_count: 1
{{- if .variables.aks_default_node_pool }}
default_node_pool: {{ insertYAML .variables.aks_default_node_pool }}
{{- end }}
{{- if .variables.aks_node_pools }}
node_pools: {{ insertYAML .variables.aks_node_pools }}
{{- end }}
node_resource_group_name: "aks-nodes-re1"
oidc_issuer_enabled: true
workload_identity_enabled: true
networking:
vnets:
spoke_aks_re1:
resource_group_key: "aks_re1"
region: "region1"
vnet:
name: "aks"
address_space:
- "100.64.48.0/22"
specialsubnets: {}
subnets:
aks_nodepool_system:
name: "aks_nodepool_system"
cidr:
- "100.64.48.0/24"
nsg_key: "azure_kubernetes_cluster_nsg"
private_endpoints:
name: "private_endpoints"
cidr:
- "100.64.51.0/27"
enforce_private_link_endpoint_network_policies: true
network_security_group_definition:
# This entry is applied to all subnets with no NSG defined
empty_nsg: {}
azure_kubernetes_cluster_nsg:
nsg:
- name: "aks-http-in-allow"
priority: "100"
direction: "Inbound"
access: "Allow"
protocol: "tcp"
source_port_range: "*"
destination_port_range: "80"
source_address_prefix: "*"
destination_address_prefix: "*"
- name: "aks-https-in-allow"
priority: "110"
direction: "Inbound"
access: "Allow"
protocol: "tcp"
source_port_range: "*"
destination_port_range: "443"
source_address_prefix: "*"
destination_address_prefix: "*"
- name: "aks-api-out-allow-1194"
priority: "100"
direction: "Outbound"
access: "Allow"
protocol: "udp"
source_port_range: "*"
destination_port_range: "1194"
source_address_prefix: "*"
destination_address_prefix: "AzureCloud"
- name: "aks-api-out-allow-9000"
priority: "110"
direction: "Outbound"
access: "Allow"
protocol: "tcp"
source_port_range: "*"
destination_port_range: "9000"
source_address_prefix: "*"
destination_address_prefix: "AzureCloud"
- name: "aks-ntp-out-allow"
priority: "120"
direction: "Outbound"
access: "Allow"
protocol: "udp"
source_port_range: "*"
destination_port_range: "123"
source_address_prefix: "*"
destination_address_prefix: "*"
- name: "aks-https-out-allow-443"
priority: "130"
direction: "Outbound"
access: "Allow"
protocol: "tcp"
source_port_range: "*"
destination_port_range: "443"
source_address_prefix: "*"
destination_address_prefix: "*"
dns_zones:
dns_zone1:
name: {{ .variables.domain_name }}
resource_group_key: "dns_re1"
-
name: aks-addons
type: tfmodule
providers:
- azurerm:
features:
resource_group:
prevent_deletion_if_contains_resources: false
skip_provider_registration: true
- azurerm:
features:
resource_group:
prevent_deletion_if_contains_resources: false
skip_provider_registration: true
alias: vhub
source: "github.com/shalb/terraform-azurerm-aks-addons?ref=v0.0.1"
depends_on: this.aks-cluster
inputs:
location: {{ .variables.location }}
cluster_name: {{ remoteState "this.aks-cluster.aks_clusters.cluster_re1.cluster_name" }}
cluster_resource_group_name: {{ remoteState "this.aks-cluster.aks_clusters.cluster_re1.resource_group_name" }}
domain_name: {{ .variables.domain_name }}
dns_zone_resource_group_name: {{ remoteState "this.aks-cluster.dns_zones.dns_zone1.resource_group_name" }}
{{- if .variables.aks_addons }} {{- .variables.aks_addons | toYaml | nindent 6 }} {{ end }}
-
name: outputs
type: printer
outputs:
location: {{ .variables.location }}
kubeconfig_cmd: {{ remoteState "this.aks-cluster.aks_clusters.cluster_re1.aks_kubeconfig_cmd" }}
resource_group_name: {{ remoteState "this.aks-cluster.aks_clusters.cluster_re1.resource_group_name" }}
cluster_name: {{ remoteState "this.aks-cluster.aks_clusters.cluster_re1.cluster_name" }}
kube_config: {{ remoteState "this.aks-cluster.aks_clusters.cluster_re1.kube_config" }}
domain: {{ .variables.domain_name }}
name_servers: {{ remoteState "this.aks-cluster.dns_zones.dns_zone1.name_servers" }}