File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ $ KUBECONFIG=secrets/admin.conf kubectl expose deploy nginx --port=80 --type Nod
42
42
| ` docker_version ` | ` 18.06 ` | Docker CE version that will be installed | No |
43
43
| ` kubernetes_version ` | ` 1.12.0 ` | Kubernetes version that will be installed | No |
44
44
| ` core_dns ` | ` false ` | Enables CoreDNS as Service Discovery | No |
45
-
45
+ | ` calico_enabled ` | ` false ` | Installs Calico Network Provider after the master comes up | No |
46
46
All variables cloud be passed through ` environment variables ` or a ` tfvars ` file.
47
47
48
48
An example for a ` tfvars ` file would be the following ` terraform.tfvars `
Original file line number Diff line number Diff line change
1
+ resource "null_resource" "calico" {
2
+ count = " ${ var . calico_enabled ? 1 : 0 } "
3
+
4
+ connection {
5
+ host = " ${ hcloud_server . master . * . ipv4_address } "
6
+ private_key = " ${ file (var. ssh_private_key )} "
7
+ }
8
+
9
+ provisioner "remote-exec" {
10
+ inline = << EOF
11
+ kubectl apply -f https://docs.projectcalico.org/v3.2/getting-started/kubernetes/installation/hosted/etcd.yaml
12
+ kubectl apply -f https://docs.projectcalico.org/v3.2/getting-started/kubernetes/installation/rbac.yaml
13
+ kubectl apply -f https://docs.projectcalico.org/v3.2/getting-started/kubernetes/installation/hosted/calico.yaml
14
+ EOF
15
+ }
16
+
17
+ depends_on = [" hcloud_server.master" ]
18
+ }
Original file line number Diff line number Diff line change @@ -43,5 +43,9 @@ variable "kubernetes_version" {
43
43
}
44
44
45
45
variable "core_dns" {
46
- default = " false"
46
+ default = false
47
+ }
48
+
49
+ variable "calico_enabled" {
50
+ default = false
47
51
}
You can’t perform that action at this time.
0 commit comments