-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from mckornfield/solr-install
Add solr helm terraform deployment
- Loading branch information
Showing
17 changed files
with
181 additions
and
1 deletion.
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,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
my_env=${1:?Environment is required} | ||
line=$(grep "digitalocean.${my_env}.treetracker.org" ~/.netrc) | ||
export DIGITALOCEAN_TOKEN=$(echo $line | awk '{print $6}') | ||
|
||
netrc_string=$(grep "sfo2.${my_env}.digitaloceanspaces.com" ~/.netrc) | ||
export AWS_ACCESS_KEY_ID=$(echo $netrc_string | awk '{print $4}') | ||
export AWS_SECRET_ACCESS_KEY=$(echo $netrc_string | awk '{print $6}') |
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,3 @@ | ||
#!/usr/bin/env bash | ||
kubectl delete clusterrole solr-operator-role solr-operator-zookeeper-operator | ||
kubectl delete clusterrolebinding solr-operator-rolebinding solr-operator-zookeeper-operator |
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 @@ | ||
|
||
terraform { | ||
# DigitalOcean uses the S3 spec. | ||
backend "s3" { | ||
bucket = "treetracker-dev-terraform" | ||
key = "terraform-solr.tfstate" | ||
endpoint = "https://sfo2.digitaloceanspaces.com" | ||
# DO uses the S3 format | ||
# eu-west-1 is used to pass TF validation | ||
# Region is ACTUALLY sfo2 on DO | ||
region = "eu-west-1" | ||
# Deactivate a few checks as TF will attempt these against AWS | ||
skip_credentials_validation = true | ||
skip_metadata_api_check = true | ||
skip_region_validation = true | ||
} | ||
} |
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,4 @@ | ||
module "solr" { | ||
source = "../solr_chart" | ||
cluster_name = "dev-k8s-treetracker" | ||
} |
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,10 @@ | ||
terraform { | ||
required_providers { | ||
digitalocean = { | ||
source = "digitalocean/digitalocean" | ||
version = "2.28.1" | ||
} | ||
kubernetes = "2.16.1" | ||
helm = "2.8.0" | ||
} | ||
} |
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 @@ | ||
|
||
terraform { | ||
# DigitalOcean uses the S3 spec. | ||
backend "s3" { | ||
bucket = "treetracker-test-terraform" | ||
key = "terraform-solr.tfstate" | ||
endpoint = "https://sfo2.digitaloceanspaces.com" | ||
# DO uses the S3 format | ||
# eu-west-1 is used to pass TF validation | ||
# Region is ACTUALLY sfo2 on DO | ||
region = "eu-west-1" | ||
# Deactivate a few checks as TF will attempt these against AWS | ||
skip_credentials_validation = true | ||
skip_metadata_api_check = true | ||
skip_region_validation = true | ||
} | ||
} |
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,4 @@ | ||
module "solr" { | ||
source = "../solr_chart" | ||
cluster_name = "prod-k8s-treetracker" | ||
} |
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,10 @@ | ||
terraform { | ||
required_providers { | ||
digitalocean = { | ||
source = "digitalocean/digitalocean" | ||
version = "2.28.1" | ||
} | ||
kubernetes = "2.16.1" | ||
helm = "2.8.0" | ||
} | ||
} |
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 @@ | ||
data "digitalocean_kubernetes_cluster" "dev" { | ||
name = var.cluster_name | ||
} | ||
|
||
provider "helm" { | ||
kubernetes { | ||
host = data.digitalocean_kubernetes_cluster.dev.endpoint | ||
token = data.digitalocean_kubernetes_cluster.dev.kube_config[0].token | ||
cluster_ca_certificate = base64decode( | ||
data.digitalocean_kubernetes_cluster.dev.kube_config[0].cluster_ca_certificate | ||
) | ||
} | ||
} | ||
|
||
locals { | ||
solr_version = "0.7.0" | ||
} | ||
resource "helm_release" "solr_operator" { | ||
name = "solr-operator" | ||
repository = "https://solr.apache.org/charts" | ||
chart = "solr-operator" | ||
version = local.solr_version | ||
namespace = "solr" | ||
create_namespace = true | ||
|
||
|
||
values = [ | ||
"${file("${path.module}/solr-operator-values.yaml")}", | ||
var.solr_operator_values_file | ||
] | ||
|
||
} | ||
|
||
|
||
resource "helm_release" "solr" { | ||
name = "solr" | ||
repository = "https://solr.apache.org/charts" | ||
chart = "solr" | ||
version = local.solr_version | ||
namespace = "solr" | ||
create_namespace = true | ||
|
||
|
||
values = [ | ||
"${file("${path.module}/solr-values.yaml")}", | ||
var.solr_values_file | ||
] | ||
|
||
} |
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,10 @@ | ||
terraform { | ||
required_providers { | ||
digitalocean = { | ||
source = "digitalocean/digitalocean" | ||
version = "2.28.1" | ||
} | ||
kubernetes = "2.16.1" | ||
helm = "2.8.0" | ||
} | ||
} |
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,3 @@ | ||
zookeeper-operator: | ||
crd: | ||
create: true |
Empty file.
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,13 @@ | ||
variable "cluster_name" { | ||
type = string | ||
} | ||
|
||
variable "solr_operator_values_file" { | ||
type = string | ||
default = "" | ||
} | ||
|
||
variable "solr_values_file" { | ||
type = string | ||
default = "" | ||
} |
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 @@ | ||
|
||
terraform { | ||
# DigitalOcean uses the S3 spec. | ||
backend "s3" { | ||
bucket = "treetracker-test-terraform" | ||
key = "terraform-solr.tfstate" | ||
endpoint = "https://sfo2.digitaloceanspaces.com" | ||
# DO uses the S3 format | ||
# eu-west-1 is used to pass TF validation | ||
# Region is ACTUALLY sfo2 on DO | ||
region = "eu-west-1" | ||
# Deactivate a few checks as TF will attempt these against AWS | ||
skip_credentials_validation = true | ||
skip_metadata_api_check = true | ||
skip_region_validation = true | ||
} | ||
} |
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,4 @@ | ||
module "solr" { | ||
source = "../solr_chart" | ||
cluster_name = "test-k8s-treetracker" | ||
} |
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,10 @@ | ||
terraform { | ||
required_providers { | ||
digitalocean = { | ||
source = "digitalocean/digitalocean" | ||
version = "2.28.1" | ||
} | ||
kubernetes = "2.16.1" | ||
helm = "2.8.0" | ||
} | ||
} |