Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several small fixes for terraform aws #646

Merged
merged 2 commits into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion deploy/aws/bastion.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ module "ec2" {
monitoring = false
user_data = file("bastion-userdata")
vpc_security_group_ids = [aws_security_group.ssh.id]
subnet_ids = local.default_subnets
subnet_ids = split(
",",
var.create_vpc ? join(",", module.vpc.public_subnets) : join(",", var.subnets),
)
}
2 changes: 1 addition & 1 deletion deploy/aws/clusters.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "local_file" "kubeconfig" {
# The helm provider for TiDB clusters must be configured in the top level, otherwise removing clusters will failed due to
# the helm provider configuration is removed too.
provider "helm" {
alias = "eks"
alias = "eks"
insecure = true
# service_account = "tiller"
install_tiller = false # currently this doesn't work, so we install tiller in the local-exec provisioner. See https://github.com/terraform-providers/terraform-provider-helm/issues/148
Expand Down
1 change: 1 addition & 0 deletions deploy/aws/tidb-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ resource "helm_release" "tidb-cluster" {
version = var.tidb_cluster_chart_version
namespace = var.cluster_name
name = var.cluster_name
wait = false

values = [
file("${path.module}/values/default.yaml"),
Expand Down
2 changes: 1 addition & 1 deletion deploy/aws/tidb-cluster/local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ locals {
key_name = var.ssh_key_name
instance_type = var.pd_instance_type
root_volume_size = "50"
public_ip = true
public_ip = false
kubelet_extra_args = "--register-with-taints=dedicated=${var.cluster_name}-pd:NoSchedule --node-labels=dedicated=${var.cluster_name}-pd,pingcap.com/aws-local-ssd=true"
asg_desired_capacity = var.pd_count
asg_max_size = var.pd_count + 2
Expand Down
6 changes: 3 additions & 3 deletions deploy/aws/tidb-operator/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource "local_file" "kubeconfig" {
}

provider "helm" {
alias = "initial"
alias = "initial"
insecure = true
# service_account = "tiller"
install_tiller = false # currently this doesn't work, so we install tiller in the local-exec provisioner. See https://github.com/terraform-providers/terraform-provider-helm/issues/148
Expand All @@ -49,8 +49,8 @@ resource "null_resource" "setup-env" {
working_dir = path.module
command = <<EOS
echo "${local_file.kubeconfig.sensitive_content}" > kube_config.yaml
kubectl apply -f https://raw.githubusercontent.com/pingcap/tidb-operator/v1.0.0-beta.3/manifests/crd.yaml
kubectl apply -f https://raw.githubusercontent.com/pingcap/tidb-operator/v1.0.0-beta.3/manifests/tiller-rbac.yaml
kubectl apply -f https://raw.githubusercontent.com/pingcap/tidb-operator/${var.operator_version}/manifests/crd.yaml
kubectl apply -f https://raw.githubusercontent.com/pingcap/tidb-operator/${var.operator_version}/manifests/tiller-rbac.yaml
kubectl apply -f manifests/local-volume-provisioner.yaml
kubectl apply -f manifests/gp2-storageclass.yaml
helm init --service-account tiller --upgrade --wait
Expand Down
4 changes: 4 additions & 0 deletions deploy/aws/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

terraform {
required_version = ">= 0.12"
}