-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[module] move ofas deployer resources out of the ocean-spark module &…
… update examples [examples/gcp-from-scratch] update examples to use v3 of the ofas module [examples/azure-from-scratch] fix azure ocean module and update ocean-spark to latest [module] remove local kubeconfig file after apply [examples/import-ocean-cluster] update example to use latest version of the module [examples] terraform fmt [examples] update all examples to use the recent version of the module [docs] add upgrades guides add validation for cluster_config variable and update the docs [examples/azure-from-scrach] revert provider changes [examples] update all examples following cluster_config var validation
- Loading branch information
Showing
22 changed files
with
333 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
### v1 upgrade guide | ||
|
||
*This upgrade revolves around one topic:* | ||
|
||
The use of the `spotinst_ocean_spark` resource to manage the cluster state instead of relying on a `kubernetes job` on the first apply. | ||
|
||
To upgrade to v1 please follow the steps bellow: | ||
|
||
1- Upgrade `spotinst provider` to `>= 1.89` | ||
|
||
2- [Retrieve from the UI](https://console.spotinst.com/ocean/spark/clusters) your Ocean Spark `Cluster ID` | ||
|
||
3- Import the resource into your `terraform state`: | ||
|
||
``` | ||
terraform import module.ocean-spark.spotinst_ocean_spark.example osc-abcd1234 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Upgrade to v2.x.x from v1.x.x | ||
|
||
By default the Ocean Spark deployer jobs now run in the kube-system namespace. | ||
|
||
To avoid issues for existing clusters you will need to set the following line: | ||
|
||
```diff | ||
module "ocean-spark" { | ||
"spotinst/ocean-spark/spotinst" | ||
|
||
ocean_cluster_id = var.ocean_cluster_id | ||
+ deployer_namespace = "spot-system" | ||
} | ||
``` | ||
|
||
|
||
#### Deprecated : | ||
|
||
- `ofas_managed_load_balancer` variable has been deleted. Use `ingress_managed_load_balancer` instead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
## Upgrade to v3.x.x from v2.x.x | ||
|
||
To migrate from *v2.xx* to *v3.x.x*, please follow the steps bellow: | ||
|
||
1- If you specified the spot-system namespace for the deployer job to run, then you will need to remove it from the terraform state: | ||
|
||
`terraform state rm module.ocean-spark.kubernetes_namespace.spot-system` | ||
|
||
2- Remove the deployer RBAC service-account and role-binding from the terraform state as well: | ||
|
||
- `terraform state rm module.ocean-spark.kubernetes_service_account.deployer` | ||
|
||
- `terraform state rm module.ocean-spark.kubernetes_cluster_role_binding.deployer` | ||
|
||
3- Add the new required `cluster_config` variable depending on your cloud provider | ||
|
||
- for *AWS*: | ||
|
||
```diff | ||
module "ocean-spark" { | ||
source = "spotinst/ocean-spark/spotinst" | ||
version = "3.0.0" | ||
|
||
ocean_cluster_id = var.ocean_cluster_id | ||
|
||
+ cluster_config = { | ||
+ cluster_name = var.cluster_name | ||
+ certificate_authority_data = data.aws_eks_cluster.this.certificate_authority[0].data | ||
+ server_endpoint = data.aws_eks_cluster.this.endpoint | ||
+ token = data.aws_eks_cluster_auth.this.token | ||
+ } | ||
} | ||
``` | ||
|
||
- for *GCP*: | ||
|
||
```diff | ||
module "ocean-spark" { | ||
source = "spotinst/ocean-spark/spotinst" | ||
version = "3.0.0" | ||
|
||
ocean_cluster_id = var.ocean_cluster_id | ||
|
||
+ cluster_config = { | ||
+ cluster_name = google_container_cluster.cluster.name | ||
+ certificate_authority_data = google_container_cluster.cluster.master_auth[0].cluster_ca_certificate | ||
+ server_endpoint = "https://${google_container_cluster.cluster.endpoint}" | ||
+ token = data.google_client_config.default.access_token | ||
+ } | ||
} | ||
``` | ||
|
||
- for *Azure*: | ||
|
||
```diff | ||
module "ocean-spark" { | ||
source = "spotinst/ocean-spark/spotinst" | ||
version = "3.0.0" | ||
|
||
ocean_cluster_id = var.ocean_cluster_id | ||
|
||
+ cluster_config = { | ||
+ cluster_name = var.cluster_name | ||
+ certificate_authority_data = module.aks.admin_cluster_ca_certificate | ||
+ server_endpoint = module.aks.admin_host | ||
+ client_certificate = module.aks.admin_client_certificate | ||
+ client_key = module.aks.admin_client_key | ||
+ } | ||
} | ||
``` | ||
|
||
4- Run `terraform init` then `terraform apply` and that's it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.