Skip to content

Commit

Permalink
remove kubernetes_dashboard from google_container_cluster (#2551)
Browse files Browse the repository at this point in the history
  • Loading branch information
megan07 authored and rileykarson committed Nov 13, 2019
1 parent 246b383 commit a330af8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 25 deletions.
21 changes: 2 additions & 19 deletions third_party/terraform/resources/resource_container_cluster.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,14 @@ func resourceContainerCluster() *schema.Resource {
},
"kubernetes_dashboard": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Deprecated: "The Kubernetes Dashboard addon is deprecated for clusters on GKE.",
Optional: true,
Removed: "The Kubernetes Dashboard addon is removed for clusters on GKE.",
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"disabled": {
Type: schema.TypeBool,
Optional: true,
Default: true,
},
},
},
Expand Down Expand Up @@ -2135,14 +2133,6 @@ func expandClusterAddonsConfig(configured interface{}) *containerBeta.AddonsConf
}
}

if v, ok := config["kubernetes_dashboard"]; ok && len(v.([]interface{})) > 0 {
addon := v.([]interface{})[0].(map[string]interface{})
ac.KubernetesDashboard = &containerBeta.KubernetesDashboard{
Disabled: addon["disabled"].(bool),
ForceSendFields: []string{"Disabled"},
}
}

if v, ok := config["network_policy_config"]; ok && len(v.([]interface{})) > 0 {
addon := v.([]interface{})[0].(map[string]interface{})
ac.NetworkPolicyConfig = &containerBeta.NetworkPolicyConfig{
Expand Down Expand Up @@ -2543,13 +2533,6 @@ func flattenClusterAddonsConfig(c *containerBeta.AddonsConfig) []map[string]inte
},
}
}
if c.KubernetesDashboard != nil {
result["kubernetes_dashboard"] = []map[string]interface{}{
{
"disabled": c.KubernetesDashboard.Disabled,
},
}
}
if c.NetworkPolicyConfig != nil {
result["network_policy_config"] = []map[string]interface{}{
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1906,7 +1906,6 @@ resource "google_container_cluster" "primary" {
addons_config {
http_load_balancing { disabled = true }
horizontal_pod_autoscaling { disabled = true }
kubernetes_dashboard { disabled = true }
network_policy_config { disabled = true }
<% unless version == 'ga' -%>
istio_config {
Expand All @@ -1928,7 +1927,6 @@ resource "google_container_cluster" "primary" {

addons_config {
http_load_balancing { disabled = false }
kubernetes_dashboard { disabled = false }
horizontal_pod_autoscaling { disabled = false }
network_policy_config { disabled = false }
<% unless version == 'ga' -%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ Before updating, remove it from your config.

## Resource: `google_container_cluster`

### `addons_config.kubernetes_dashboard` is now removed

The `kubernetes_dashboard` addon is deprecated for clusters on GKE and
will soon be removed. It is recommended to use alternative GCP Console
dashboards.

### `zone`, `region` and `additional_zones` are now removed

`zone` and `region` have been removed in favor of `location` and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,6 @@ The `addons_config` block supports:
controller addon, which makes it easy to set up HTTP load balancers for services in a
cluster. It is enabled by default; set `disabled = true` to disable.

* `kubernetes_dashboard` - (Optional, Deprecated) The status of the Kubernetes Dashboard
add-on, which controls whether the Kubernetes Dashboard is enabled for this cluster.
It is disabled by default; set `disabled = false` to enable.

* `network_policy_config` - (Optional) Whether we should enable the network policy addon
for the master. This must be enabled in order to enable network policy for the nodes.
To enable this, you must also define a [`network_policy`](#network_policy) block,
Expand Down

0 comments on commit a330af8

Please sign in to comment.