Skip to content

Commit 87c41bd

Browse files
committed
add more variables
1 parent 5692a98 commit 87c41bd

File tree

4 files changed

+110
-13
lines changed

4 files changed

+110
-13
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ There are some pre-made certificates in the module. This is necessary to make it
7676
| Name | Description | Type | Default | Required |
7777
|------|-------------|------|---------|:--------:|
7878
| automount\_service\_account\_token | Enable automatic mounting of the service account token | `bool` | `true` | no |
79+
| container\_log\_level | container log level | `string` | `"info"` | no |
80+
| controller\_image | docker image name for the controller | `string` | `"gcr.io/linkerd-io/controller"` | no |
81+
| controller\_image\_tag | docker image tag for the controller | `string` | `"stable-2.8.1"` | no |
7982
| controlplane\_ha\_replicas | amount of replicas for the controlplane components when High Availability is enabled | `number` | `3` | no |
8083
| create\_namespace | create the namespace resource or not | `bool` | `true` | no |
8184
| enable\_web\_ingress | enable the ingress object for the web component | `bool` | `false` | no |
@@ -85,6 +88,10 @@ There are some pre-made certificates in the module. This is necessary to make it
8588
| module\_depends\_on | Variable to pass dependancy on external module | `any` | `null` | no |
8689
| namespace\_name | name of the namespace | `string` | `"linkerd"` | no |
8790
| prometheus\_replicas | number of replicas for prometheus component | `number` | `1` | no |
91+
| proxy\_image | docker image name for the proxy | `string` | `"gcr.io/linkerd-io/proxy"` | no |
92+
| proxy\_image\_tag | docker image tag for the proxy | `string` | `"stable-2.8.1"` | no |
93+
| proxy\_init\_image | docker image name for the proxy\_init | `string` | `"gcr.io/linkerd-io/proxy-init"` | no |
94+
| proxy\_init\_image\_tag | docker image tag for the proxy\_init | `string` | `"v1.3.3"` | no |
8895
| proxy\_injector\_pem | custom proxy injector pem file. See example file in certs folder on how to pass it as string | `string` | `""` | no |
8996
| sp\_validator\_pem | custom sp validator pem file. See example file in certs folder on how to pass it as string | `string` | `""` | no |
9097
| trust\_anchors\_pem\_value | PEM value used as trust anchors | `string` | `""` | no |

doc.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## Requirements
2+
3+
| Name | Version |
4+
|------|---------|
5+
| terraform | >= 0.12.9 |
6+
| kubernetes | >= 1.11.1 |
7+
8+
## Providers
9+
10+
| Name | Version |
11+
|------|---------|
12+
| kubernetes | >= 1.11.1 |
13+
| null | n/a |
14+
| template | n/a |
15+
16+
## Inputs
17+
18+
| Name | Description | Type | Default | Required |
19+
|------|-------------|------|---------|:--------:|
20+
| automount\_service\_account\_token | Enable automatic mounting of the service account token | `bool` | `true` | no |
21+
| container\_log\_level | container log level | `string` | `"info"` | no |
22+
| controller\_image | docker image name for the controller | `string` | `"gcr.io/linkerd-io/controller"` | no |
23+
| controller\_image\_tag | docker image tag for the controller | `string` | `"stable-2.8.1"` | no |
24+
| controlplane\_ha\_replicas | amount of replicas for the controlplane components when High Availability is enabled | `number` | `3` | no |
25+
| create\_namespace | create the namespace resource or not | `bool` | `true` | no |
26+
| enable\_web\_ingress | enable the ingress object for the web component | `bool` | `false` | no |
27+
| external\_identity\_issuer | Use true in Production! If left to false, it will use the certificates coming with this module. For more information: https://linkerd.io/2/tasks/automatically-rotating-control-plane-tls-credentials/ | `bool` | `false` | no |
28+
| grafana\_replicas | number of replicas for grafana component | `number` | `1` | no |
29+
| high\_availability | Enable high availability | `bool` | `false` | no |
30+
| module\_depends\_on | Variable to pass dependancy on external module | `any` | `null` | no |
31+
| namespace\_name | name of the namespace | `string` | `"linkerd"` | no |
32+
| prometheus\_replicas | number of replicas for prometheus component | `number` | `1` | no |
33+
| proxy\_image | docker image name for the proxy | `string` | `"gcr.io/linkerd-io/proxy"` | no |
34+
| proxy\_image\_tag | docker image tag for the proxy | `string` | `"stable-2.8.1"` | no |
35+
| proxy\_init\_image | docker image name for the proxy\_init | `string` | `"gcr.io/linkerd-io/proxy-init"` | no |
36+
| proxy\_init\_image\_tag | docker image tag for the proxy\_init | `string` | `"v1.3.3"` | no |
37+
| proxy\_injector\_pem | custom proxy injector pem file. See example file in certs folder on how to pass it as string | `string` | `""` | no |
38+
| sp\_validator\_pem | custom sp validator pem file. See example file in certs folder on how to pass it as string | `string` | `""` | no |
39+
| trust\_anchors\_pem\_value | PEM value used as trust anchors | `string` | `""` | no |
40+
| trust\_domain | trust domain for TLS certificates | `string` | `"cluster.local"` | no |
41+
| web\_ingress\_annotations | eventual ingress annotations for the ingress-controller | `map(string)` | `{}` | no |
42+
| web\_ingress\_host | host name for the web component | `string` | `""` | no |
43+
| web\_replicas | number of replicas for web component | `number` | `1` | no |
44+
45+
## Outputs
46+
47+
No output.
48+

locals.tf

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,33 +40,33 @@ locals {
4040

4141
# annotations
4242
linkerd_annotation_created_by = {
43-
"linkerd.io/created-by" = "linkerd/helm stable-2.8.1"
43+
"linkerd.io/created-by" = format("linkerd/helm %s", var.controller_image_tag)
4444
}
4545

4646
linkerd_annotations_for_deployment = {
47-
"linkerd.io/created-by" = "linkerd/helm stable-2.8.1",
47+
"linkerd.io/created-by" = format("linkerd/helm %s", var.controller_image_tag),
4848
"linkerd.io/identity-mode" = "default",
49-
"linkerd.io/proxy-version" = "stable-2.8.1"
49+
"linkerd.io/proxy-version" = var.controller_image_tag
5050
}
5151

5252
# labels
5353
linkerd_label_control_plane_ns = {
54-
"linkerd.io/control-plane-ns" = "linkerd"
54+
"linkerd.io/control-plane-ns" = local.linkerd_namespace
5555
}
5656

5757
linkerd_label_workload_ns = {
58-
"linkerd.io/workload-ns" = "linkerd"
58+
"linkerd.io/workload-ns" = local.linkerd_namespace
5959
}
6060

6161
linkerd_label_partof_version = {
6262
"app.kubernetes.io/part-of" = "Linkerd",
63-
"app.kubernetes.io/version" = "stable-2.8.1"
63+
"app.kubernetes.io/version" = var.controller_image_tag
6464
}
6565

6666
# deployment images
67-
linkerd_deployment_proxy_image = "gcr.io/linkerd-io/proxy:stable-2.8.1"
68-
linkerd_deployment_proxy_init_image = "gcr.io/linkerd-io/proxy-init:v1.3.3"
69-
linkerd_deployment_controller_image = "gcr.io/linkerd-io/controller:stable-2.8.1"
67+
linkerd_deployment_proxy_image = format("%s:%s", var.proxy_image, var.proxy_image_tag)
68+
linkerd_deployment_proxy_init_image = format("%s:%s", var.proxy_init_image, var.proxy_init_image_tag)
69+
linkerd_deployment_controller_image = format("%s:%s", var.controller_image, var.controller_image_tag)
7070

7171
# deployment security context
7272
linkerd_deployment_security_context_user = 2013
@@ -87,7 +87,7 @@ locals {
8787
linkerd_deployment_container_env_variables = [
8888
{
8989
name = "LINKERD2_PROXY_LOG"
90-
value = "warn,linkerd=info"
90+
value = format("warn,linkerd=%s", var.container_log_level)
9191
},
9292
{
9393
name = "LINKERD2_PROXY_DESTINATION_GET_NETWORKS"
@@ -167,9 +167,9 @@ locals {
167167
}
168168
]
169169

170-
linkerd_proxy_destination_svc_addr = "linkerd-dst.linkerd.svc.${local.linkerd_trust_domain}:8086"
171-
linkerd_proxy_identity_svc_addr = "linkerd-identity.linkerd.svc.${local.linkerd_trust_domain}:8080"
170+
linkerd_proxy_destination_svc_addr = "linkerd-dst.${local.linkerd_namespace}.svc.${local.linkerd_trust_domain}:8086"
171+
linkerd_proxy_identity_svc_addr = "linkerd-identity.${local.linkerd_namespace}.svc.${local.linkerd_trust_domain}:8080"
172172

173173
#log level
174-
linkerd_container_log_level = "debug" # TODO: change level to info before deploying to prod
174+
linkerd_container_log_level = var.container_log_level
175175
}

variables.tf

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,48 @@ variable "namespace_name" {
1010
default = "linkerd"
1111
}
1212

13+
variable "controller_image" {
14+
type = string
15+
description = "docker image name for the controller"
16+
default = "gcr.io/linkerd-io/controller"
17+
}
18+
19+
variable "controller_image_tag" {
20+
type = string
21+
description = "docker image tag for the controller"
22+
default = "stable-2.8.1"
23+
}
24+
25+
variable "proxy_init_image" {
26+
type = string
27+
description = "docker image name for the proxy_init"
28+
default = "gcr.io/linkerd-io/proxy-init"
29+
}
30+
31+
variable "proxy_init_image_tag" {
32+
type = string
33+
description = "docker image tag for the proxy_init"
34+
default = "v1.3.3"
35+
}
36+
37+
variable "proxy_image" {
38+
type = string
39+
description = "docker image name for the proxy"
40+
default = "gcr.io/linkerd-io/proxy"
41+
}
42+
43+
variable "proxy_image_tag" {
44+
type = string
45+
description = "docker image tag for the proxy"
46+
default = "stable-2.8.1"
47+
}
48+
49+
variable "container_log_level" {
50+
type = string
51+
description = "container log level"
52+
default = "info"
53+
}
54+
1355
variable "trust_domain" {
1456
type = string
1557
description = "trust domain for TLS certificates"

0 commit comments

Comments
 (0)