Skip to content

Commit fff4272

Browse files
authored
feat: Add support for setting var.istio_auth (terraform-google-modules#462)
* add istio mtls support * docs * fix test * keep istio config flat * lint * fix examples * fix examples
1 parent f48eb32 commit fff4272

File tree

20 files changed

+61
-4
lines changed

20 files changed

+61
-4
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ resource "google_container_cluster" "primary" {
147147

148148
istio_config {
149149
disabled = ! var.istio
150+
auth = var.istio_auth
150151
}
151152

152153
dynamic "cloudrun_config" {

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,12 @@ variable "istio" {
393393
default = false
394394
}
395395

396+
variable "istio_auth" {
397+
type = string
398+
description = "(Beta) The authentication type between services in Istio."
399+
default = "AUTH_MUTUAL_TLS"
400+
}
401+
396402
variable "database_encryption" {
397403
description = "Application-layer Secrets Encryption settings. The object format is {state = string, key_name = string}. Valid values of state are: \"ENCRYPTED\"; \"DECRYPTED\". key_name is the name of a CloudKMS key."
398404
type = list(object({ state = string, key_name = string }))

autogen/safer-cluster/main.tf.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ module "gke" {
116116
master_ipv4_cidr_block = var.master_ipv4_cidr_block
117117

118118
// Istio is recommended for pod-to-pod communications.
119-
istio = var.istio
119+
istio = var.istio
120+
istio_auth = var.istio_auth
121+
120122
cloudrun = var.cloudrun
121123

122124
default_max_pods_per_node = var.default_max_pods_per_node

autogen/safer-cluster/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,12 @@ variable "istio" {
231231
default = false
232232
}
233233

234+
variable "istio_auth" {
235+
type = string
236+
description = "(Beta) The authentication type between services in Istio."
237+
default = "AUTH_MUTUAL_TLS"
238+
}
239+
234240
variable "default_max_pods_per_node" {
235241
description = "The maximum number of pods to schedule per node"
236242
default = 110

modules/beta-private-cluster-update-variant/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ Then perform the following commands on the root folder:
187187
| ip\_range\_services | The _name_ of the secondary subnet range to use for services | string | n/a | yes |
188188
| issue\_client\_certificate | Issues a client certificate to authenticate to the cluster endpoint. To maximize the security of your cluster, leave this option disabled. Client certificates don't automatically rotate and aren't easily revocable. WARNING: changing this after cluster creation is destructive! | bool | `"false"` | no |
189189
| istio | (Beta) Enable Istio addon | string | `"false"` | no |
190+
| istio\_auth | (Beta) The authentication type between services in Istio. | string | `"AUTH_MUTUAL_TLS"` | no |
190191
| kubernetes\_version | The Kubernetes version of the masters. If set to 'latest' it will pull latest available version in the selected region. | string | `"latest"` | no |
191192
| logging\_service | The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none | string | `"logging.googleapis.com/kubernetes"` | no |
192193
| maintenance\_end\_time | Time window specified for recurring maintenance operations in RFC3339 format | string | `""` | no |

modules/beta-private-cluster-update-variant/cluster.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ resource "google_container_cluster" "primary" {
132132

133133
istio_config {
134134
disabled = ! var.istio
135+
auth = var.istio_auth
135136
}
136137

137138
dynamic "cloudrun_config" {

modules/beta-private-cluster-update-variant/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,12 @@ variable "istio" {
386386
default = false
387387
}
388388

389+
variable "istio_auth" {
390+
type = string
391+
description = "(Beta) The authentication type between services in Istio."
392+
default = "AUTH_MUTUAL_TLS"
393+
}
394+
389395
variable "database_encryption" {
390396
description = "Application-layer Secrets Encryption settings. The object format is {state = string, key_name = string}. Valid values of state are: \"ENCRYPTED\"; \"DECRYPTED\". key_name is the name of a CloudKMS key."
391397
type = list(object({ state = string, key_name = string }))

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ Then perform the following commands on the root folder:
165165
| ip\_range\_services | The _name_ of the secondary subnet range to use for services | string | n/a | yes |
166166
| issue\_client\_certificate | Issues a client certificate to authenticate to the cluster endpoint. To maximize the security of your cluster, leave this option disabled. Client certificates don't automatically rotate and aren't easily revocable. WARNING: changing this after cluster creation is destructive! | bool | `"false"` | no |
167167
| istio | (Beta) Enable Istio addon | string | `"false"` | no |
168+
| istio\_auth | (Beta) The authentication type between services in Istio. | string | `"AUTH_MUTUAL_TLS"` | no |
168169
| kubernetes\_version | The Kubernetes version of the masters. If set to 'latest' it will pull latest available version in the selected region. | string | `"latest"` | no |
169170
| logging\_service | The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none | string | `"logging.googleapis.com/kubernetes"` | no |
170171
| maintenance\_end\_time | Time window specified for recurring maintenance operations in RFC3339 format | string | `""` | no |

modules/beta-private-cluster/cluster.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ resource "google_container_cluster" "primary" {
132132

133133
istio_config {
134134
disabled = ! var.istio
135+
auth = var.istio_auth
135136
}
136137

137138
dynamic "cloudrun_config" {

modules/beta-private-cluster/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,12 @@ variable "istio" {
386386
default = false
387387
}
388388

389+
variable "istio_auth" {
390+
type = string
391+
description = "(Beta) The authentication type between services in Istio."
392+
default = "AUTH_MUTUAL_TLS"
393+
}
394+
389395
variable "database_encryption" {
390396
description = "Application-layer Secrets Encryption settings. The object format is {state = string, key_name = string}. Valid values of state are: \"ENCRYPTED\"; \"DECRYPTED\". key_name is the name of a CloudKMS key."
391397
type = list(object({ state = string, key_name = string }))

0 commit comments

Comments
 (0)