-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(DMVP-1164) Add weave-scope module (#8)
Co-authored-by: Vahagn Martirosyan <[email protected]>
- Loading branch information
1 parent
4b9551e
commit ef81667
Showing
3 changed files
with
102 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Local .terraform directories | ||
**/.terraform/* | ||
|
||
# .tfstate files | ||
*.tfstate | ||
*.tfstate.* | ||
*.lock.hcl | ||
|
||
|
||
**/.idea/* | ||
|
||
.idea/ | ||
|
||
|
||
# Crash log files | ||
crash.log | ||
|
||
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most | ||
# .tfvars files are managed as part of configuration and so should be included in | ||
# version control. | ||
# | ||
# example.tfvars | ||
|
||
# Ignore override files as they are usually used to override resources locally and so | ||
# are not checked in | ||
override.tf | ||
override.tf.json | ||
*_override.tf | ||
*_override.tf.json | ||
|
||
# Include override files you do wish to add to version control using negated pattern | ||
# | ||
# !example_override.tf | ||
|
||
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan | ||
# example: *tfplan* | ||
|
||
.DS_Store | ||
.tool-versions |
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,49 @@ | ||
This module will enable `Weave-Scope` in EKS if `enable_weave_scope` is set to `true` | ||
## Usage | ||
``` | ||
module "terraform-aws-eks" { | ||
source = "../terraform-aws-eks" | ||
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"] | ||
cidr = "172.16.0.0/16" | ||
cluster_name = "my-cluster-sso" | ||
private_subnets = ["172.16.1.0/24", "172.16.2.0/24", "172.16.3.0/24"] | ||
public_subnets = ["172.16.4.0/24", "172.16.5.0/24", "172.16.6.0/24"] | ||
users = [{ | ||
username = "macos" | ||
}] | ||
vpc_name = "eks-vpc" | ||
alb_log_bucket_name = "bucket-eks-miandevops-temporary" | ||
enable_weave_scope = true | ||
} | ||
``` | ||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Requirements | ||
|
||
No requirements. | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_null"></a> [null](#provider\_null) | n/a | | ||
|
||
## Modules | ||
|
||
No modules. | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [null_resource.kubectl-apply](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource | | ||
| [null_resource.kubectl-version](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource | | ||
|
||
## Inputs | ||
|
||
No inputs. | ||
|
||
## Outputs | ||
|
||
No outputs. | ||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
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,14 @@ | ||
resource "null_resource" "kubectl-version" { | ||
provisioner "local-exec" { | ||
command = "kubectl version | base64 | tr -d '\n' > ./.terraform/kversion" | ||
interpreter = ["/bin/bash", "-c"] | ||
} | ||
} | ||
|
||
resource "null_resource" "kubectl-apply" { | ||
depends_on = [null_resource.kubectl-version] | ||
provisioner "local-exec" { | ||
command = "kubectl apply -f 'https://cloud.weave.works/k8s/scope.yaml?k8s-version=${file("./.terraform/kversion")}'" | ||
interpreter = ["/bin/bash", "-c"] | ||
} | ||
} |