Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
We don't have cloud anymore replace it with provider (#54)
Browse files Browse the repository at this point in the history
* We dont have cloud anymore replace it with provider

 update the example for azure

* fix the variable name

* Update the readme file to reflect the changes
  • Loading branch information
rakesh-garimella authored Feb 5, 2020
1 parent 4fa5d92 commit 96c9cb7
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 39 deletions.
63 changes: 47 additions & 16 deletions examples/azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,56 @@ Currently, values for the following CIDRs are obtained from the similar clusters

You can define multiple workers using the following configuration:

```bash
```hcl-terraform
worker {
name = "cpu-worker1"
machinetype = "Standard_D2_v3"
autoscalermin = 2
autoscalermax = 4
maxsurge = 1
maxunavailable = 0
volumesize = "35Gi"
volumetype = "standard"
}
minimum = 2
maximum = 4
max_surge = 1
max_unavailable = 0
volume {
size = "50Gi"
type = "Standard_LRS"
}
machine {
image {
name = "coreos"
version = "2303.3.0"
}
type = "Standard_A4_v2"
}
}
worker {
name = "cpu-worker2"
machinetype = "Standard_D2_v3"
autoscalermin = 2
autoscalermax = 4
maxsurge = 1
maxunavailable = 0
volumesize = "20Gi"
volumetype = "standard"
minimum = 2
maximum = 4
max_surge = 1
max_unavailable = 0
volume {
size = "50Gi"
type = "Standard_LRS"
}
machine {
image {
name = "coreos"
version = "2303.3.0"
}
type = "Standard_A4_v2"
}
}
```

The infrastructure config allows to pass extra information to the cloud provider. It can be done in following way:
```hcl-terraform
infrastructure_config {
azure {
networks {
vnet {
cidr = "10.250.0.0/16"
}
workers = "10.250.0.0/19"
service_endpoints = ["microsoft.test"]
}
}
}
```
68 changes: 46 additions & 22 deletions examples/azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,59 @@ resource "gardener_shoot" "test_cluster" {
}

spec {
cloud {
profile = "az"
region = "westeurope"

secret_binding_ref {
name = "<secret_binding>"
cloud_profile_name = "az"
secret_binding_name = "<secret_binding>"
purpose = "evaluation"
networking {
nodes = "10.250.0.0/19"
pods= "100.96.0.0/11"
services= "100.64.0.0/13"
type= "calico"
}
maintenance {
auto_update{
kubernetes_version = true
machine_image_version = true
}

azure {
networks {
vnet {
cidr = "10.250.0.0/16"
time_window {
begin = "030000+0000"
end = "040000+0000"
}
}
provider {
type = "azure"
infrastructure_config {
azure {
networks {
vnet {
cidr = "10.250.0.0/16"
}
workers = "10.250.0.0/19"
# service_endpoints = ["microsoft.test"]
}
workers = "10.250.0.0/19"
}

worker {
name = "cpu-worker"
machine_type = "Standard_D2_v3"
auto_scaler_min = 3
auto_scaler_max = 3
max_surge = 1
max_unavailable = 0
volume_type = "standard"
volume_size = "50Gi"
}
worker {
max_surge = 1
max_unavailable = 0
maximum = 2
minimum = 2
volume {
size = "50Gi"
type = "Standard_LRS"
}
name = "cpu-worker"
machine {
image {
name = "coreos"
version = "2303.3.0"
}
type = "Standard_A4_v2"
}
}
}

region = "westeurope"
kubernetes {
version = "1.15.4"
}
Expand Down
2 changes: 1 addition & 1 deletion flatten/flatten_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func FlattenShoot(in corev1beta1.ShootSpec, d *schema.ResourceData, specPrefix .
}
configProvider := d.Get(prefix + "spec.0.provider").([]interface{})
flattenedProvider := flattenProvider(in.Provider)
att["cloud"] = expand.RemoveInternalKeysArraySpec(flattenedProvider, configProvider)
att["provider"] = expand.RemoveInternalKeysArraySpec(flattenedProvider, configProvider)
configDNS := d.Get(prefix + "spec.0.dns").([]interface{})
flattenedDNS := flattenDNS(in.DNS)
att["dns"] = expand.RemoveInternalKeysArraySpec(flattenedDNS, configDNS)
Expand Down

0 comments on commit 96c9cb7

Please sign in to comment.