-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathflannel.tf
102 lines (87 loc) · 2.14 KB
/
flannel.tf
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
variable "enable_flannel" {
default = true
}
output "enable_flannel" {
value = "${var.enable_flannel}"
}
variable "flannel_public-ip" {
default = ""
}
output "flannel_public-ip" {
value = "${var.flannel_public-ip}"
}
variable "flannel_etcd-endpoints" {
default = ""
}
output "flannel_etcd-endpoints" {
value = "${var.flannel_etcd-endpoints}"
}
variable "flannel_etcd-prefix" {
default = ""
}
output "flannel_etcd-prefix" {
value = "${var.flannel_etcd-prefix}"
}
variable "flannel_etcd-keyfile" {
default = ""
}
output "flannel_etcd-keyfile" {
value = "${var.flannel_etcd-keyfile}"
}
variable "flannel_etcd-certfile" {
default = ""
}
output "flannel_etcd-certfile" {
value = "${var.flannel_etcd-certfile}"
}
variable "flannel_interface" {
default = ""
}
output "flannel_interface" {
value = "${var.flannel_interface}"
}
variable "flannel_subnet-file" {
default = ""
}
output "flannel_subnet-file" {
value = "${var.flannel_subnet-file}"
}
variable "flannel_ip-masq" {
default = ""
}
output "flannel_ip-masq" {
value = "${var.flannel_ip-masq}"
}
variable "flannel_config" {
default = "{ \"Network\": \"10.1.0.0/16\" }"
}
output "flannel_config" {
value = "${var.flannel_config}"
}
data "template_file" "flannel_config" {
template = "${file("${path.module}/templates/flannel-config.yml")}"
vars {
config = "${var.flannel_config}"
}
}
data "template_file" "flannel_unit" {
template = "${file("${path.module}/templates/enabled-unit.yml")}"
vars {
service = "flanneld"
enabled = "${var.enable_flannel}"
drop-ins = "${data.template_file.flannel_config.rendered}"
}
}
data "template_file" "flannel" {
template = "${file("${path.module}/templates/flannel.yml")}"
vars {
public-ip = "${var.flannel_public-ip}"
etcd-endpoints = "${var.flannel_etcd-endpoints}"
etcd-prefix = "${var.flannel_etcd-prefix}"
etcd-keyfile = "${coalesce(var.flannel_etcd-keyfile, var.etcd2_key-file)}"
etcd-certfile = "${coalesce(var.flannel_etcd-certfile, var.etcd2_cert-file)}"
interface = "${var.flannel_interface}"
subnet-file = "${var.flannel_subnet-file}"
ip-masq = "${var.flannel_ip-masq}"
}
}