Skip to content

Commit ef5578f

Browse files
authored
feat(k8s): remove dashboard and ingress fields (#798)
Signed-off-by: Patrik Cyvoct <[email protected]>
1 parent cca1467 commit ef5578f

File tree

4 files changed

+0
-133
lines changed

4 files changed

+0
-133
lines changed

docs/data-sources/k8s_cluster.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ In addition to all above arguments, the following attributes are exported:
6464

6565
- `cni` - The Container Network Interface (CNI) for the Kubernetes cluster.
6666

67-
- `enable_dashboard` - True if the [Kubernetes dashboard](https://github.com/kubernetes/dashboard) is enabled for the Kubernetes cluster.
68-
69-
- `ingress` - The [ingress controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/) deployed on the Kubernetes cluster.
70-
7167
- `tags` - The tags associated with the Kubernetes cluster.
7268

7369
- `autoscaler_config` - The configuration options for the [Kubernetes cluster autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler).

docs/resources/k8s_cluster.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ resource "scaleway_k8s_cluster" "john" {
3535
description = "my awesome cluster"
3636
version = "1.18.0"
3737
cni = "calico"
38-
enable_dashboard = true
39-
ingress = "traefik"
4038
tags = ["i'm an awsome tag", "yay"]
4139
4240
autoscaler_config {
@@ -114,10 +112,6 @@ The following arguments are supported:
114112
- `cni` - (Required) The Container Network Interface (CNI) for the Kubernetes cluster.
115113
~> **Important:** Updates to this field will recreate a new resource.
116114

117-
- `enable_dashboard` - (Defaults to `false`) Enables the [Kubernetes dashboard](https://github.com/kubernetes/dashboard) for the Kubernetes cluster.
118-
119-
- `ingress` - (Defaults to `none`) The [ingress controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/) to be deployed on the Kubernetes cluster.
120-
121115
- `tags` - (Optional) The tags associated with the Kubernetes cluster.
122116

123117
- `autoscaler_config` - (Optional) The configuration options for the [Kubernetes cluster autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler).

scaleway/resource_k8s_cluster.go

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,6 @@ func resourceScalewayK8SCluster() *schema.Resource {
5555
k8s.CNIWeave.String(),
5656
}, false),
5757
},
58-
"enable_dashboard": {
59-
Type: schema.TypeBool,
60-
Optional: true,
61-
Default: false,
62-
Description: "Enable the dashboard on the cluster",
63-
},
64-
"ingress": {
65-
Type: schema.TypeString,
66-
Optional: true,
67-
Default: k8s.IngressNone.String(),
68-
Description: "The ingress to be deployed on the cluster",
69-
ValidateFunc: validation.StringInSlice([]string{
70-
k8s.IngressNone.String(),
71-
k8s.IngressTraefik.String(),
72-
k8s.IngressTraefik2.String(),
73-
k8s.IngressNginx.String(),
74-
}, false),
75-
},
7658
"tags": {
7759
Type: schema.TypeList,
7860
Elem: &schema.Schema{
@@ -258,14 +240,6 @@ func resourceScalewayK8SClusterCreate(ctx context.Context, d *schema.ResourceDat
258240
ApiserverCertSans: expandStrings(d.Get("apiserver_cert_sans")),
259241
}
260242

261-
if dashboard, ok := d.GetOk("enable_dashboard"); ok {
262-
req.EnableDashboard = dashboard.(bool)
263-
}
264-
265-
if ingress, ok := d.GetOk("ingress"); ok {
266-
req.Ingress = k8s.Ingress(ingress.(string))
267-
}
268-
269243
autoscalerReq := &k8s.CreateClusterRequestAutoscalerConfig{}
270244

271245
if scaleDownDisabled, ok := d.GetOk("autoscaler_config.0.disable_scale_down"); ok {
@@ -532,14 +506,6 @@ func resourceScalewayK8SClusterUpdate(ctx context.Context, d *schema.ResourceDat
532506
updateRequest.AdmissionPlugins = scw.StringsPtr(expandStrings(d.Get("admission_plugins")))
533507
}
534508

535-
if d.HasChange("ingress") {
536-
updateRequest.Ingress = k8s.Ingress(d.Get("ingress").(string))
537-
}
538-
539-
if d.HasChange("enable_dashboard") {
540-
updateRequest.EnableDashboard = scw.BoolPtr(d.Get("enable_dashboard").(bool))
541-
}
542-
543509
updateRequest.AutoUpgrade = &k8s.UpdateClusterRequestAutoUpgrade{}
544510
autoupgradeEnabled := d.Get("auto_upgrade.0.enable").(bool)
545511

scaleway/resource_k8s_cluster_test.go

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -147,83 +147,6 @@ func TestAccScalewayK8SCluster_Basic(t *testing.T) {
147147
})
148148
}
149149

150-
func TestAccScalewayK8SCluster_IngressDashboard(t *testing.T) {
151-
tt := NewTestTools(t)
152-
defer tt.Cleanup()
153-
154-
latestK8SVersion := testAccScalewayK8SClusterGetLatestK8SVersion(tt)
155-
156-
resource.ParallelTest(t, resource.TestCase{
157-
PreCheck: func() {
158-
testAccPreCheck(t)
159-
},
160-
ProviderFactories: tt.ProviderFactories,
161-
CheckDestroy: testAccCheckScalewayK8SClusterDestroy(tt),
162-
Steps: []resource.TestStep{
163-
{
164-
Config: testAccCheckScalewayK8SClusterConfigIngressDashboard(latestK8SVersion, "nginx", false),
165-
Check: resource.ComposeTestCheckFunc(
166-
testAccCheckScalewayK8SClusterExists(tt, "scaleway_k8s_cluster.ingressdashboard"),
167-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "version", latestK8SVersion),
168-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "cni", "calico"),
169-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "ingress", "nginx"),
170-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "enable_dashboard", "false"),
171-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "status", k8s.ClusterStatusPoolRequired.String()),
172-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "kubeconfig.0.config_file"),
173-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "kubeconfig.0.host"),
174-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "kubeconfig.0.cluster_ca_certificate"),
175-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "kubeconfig.0.token"),
176-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "apiserver_url"),
177-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "wildcard_dns"),
178-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "tags.0", "terraform-test"),
179-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "tags.1", "scaleway_k8s_cluster"),
180-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "tags.2", "ingressdashboard"),
181-
),
182-
},
183-
{
184-
Config: testAccCheckScalewayK8SClusterConfigIngressDashboard(latestK8SVersion, "traefik", true),
185-
Check: resource.ComposeTestCheckFunc(
186-
testAccCheckScalewayK8SClusterExists(tt, "scaleway_k8s_cluster.ingressdashboard"),
187-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "version", latestK8SVersion),
188-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "cni", "calico"),
189-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "ingress", "traefik"),
190-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "enable_dashboard", "true"),
191-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "status", k8s.ClusterStatusPoolRequired.String()),
192-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "kubeconfig.0.config_file"),
193-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "kubeconfig.0.host"),
194-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "kubeconfig.0.cluster_ca_certificate"),
195-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "kubeconfig.0.token"),
196-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "apiserver_url"),
197-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "wildcard_dns"),
198-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "tags.0", "terraform-test"),
199-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "tags.1", "scaleway_k8s_cluster"),
200-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "tags.2", "ingressdashboard"),
201-
),
202-
},
203-
{
204-
Config: testAccCheckScalewayK8SClusterConfigIngressDashboard(latestK8SVersion, "traefik2", true),
205-
Check: resource.ComposeTestCheckFunc(
206-
testAccCheckScalewayK8SClusterExists(tt, "scaleway_k8s_cluster.ingressdashboard"),
207-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "version", latestK8SVersion),
208-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "cni", "calico"),
209-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "ingress", "traefik2"),
210-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "enable_dashboard", "true"),
211-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "status", k8s.ClusterStatusPoolRequired.String()),
212-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "kubeconfig.0.config_file"),
213-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "kubeconfig.0.host"),
214-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "kubeconfig.0.cluster_ca_certificate"),
215-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "kubeconfig.0.token"),
216-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "apiserver_url"),
217-
resource.TestCheckResourceAttrSet("scaleway_k8s_cluster.ingressdashboard", "wildcard_dns"),
218-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "tags.0", "terraform-test"),
219-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "tags.1", "scaleway_k8s_cluster"),
220-
resource.TestCheckResourceAttr("scaleway_k8s_cluster.ingressdashboard", "tags.2", "ingressdashboard"),
221-
),
222-
},
223-
},
224-
})
225-
}
226-
227150
func TestAccScalewayK8SCluster_Autoscaling(t *testing.T) {
228151
tt := NewTestTools(t)
229152
defer tt.Cleanup()
@@ -506,18 +429,6 @@ resource "scaleway_k8s_cluster" "minimal" {
506429
}`, version)
507430
}
508431

509-
func testAccCheckScalewayK8SClusterConfigIngressDashboard(version string, ingress string, dashboard bool) string {
510-
return fmt.Sprintf(`
511-
resource "scaleway_k8s_cluster" "ingressdashboard" {
512-
cni = "calico"
513-
version = "%s"
514-
name = "ingress-dashboard"
515-
ingress = "%s"
516-
enable_dashboard = %t
517-
tags = [ "terraform-test", "scaleway_k8s_cluster", "ingressdashboard" ]
518-
}`, version, ingress, dashboard)
519-
}
520-
521432
func testAccCheckScalewayK8SClusterConfigAutoscaler(version string) string {
522433
return fmt.Sprintf(`
523434
resource "scaleway_k8s_cluster" "autoscaler" {

0 commit comments

Comments
 (0)