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

WIP feat: add support for nullable types #258

Closed
wants to merge 4 commits into from
Closed
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ crash.log
/terraform-provider-kops
*.tfstate
*.tfstate.backup

terraform.log
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fmt:
@go fmt ./pkg/...

.PHONY: install
install: all
install: fmt build
@mkdir -p ${HOME}/.terraform.d/plugins/github/eddycharly/kops/${PROVIDER_VERSION}/${OS}_amd64
@cp terraform-provider-kops $(HOME)/.terraform.d/plugins/github/eddycharly/kops/${PROVIDER_VERSION}/${OS}_amd64/terraform-provider-kops

Expand Down
64 changes: 45 additions & 19 deletions examples/aws-assume-role/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,37 +46,49 @@ resource "kops_cluster" "cluster" {
name = "main"

member {
name = "master-0"
instance_group = "master-0"
name = "master-0"
instance_group {
value = "master-0"
}
}

member {
name = "master-1"
instance_group = "master-1"
name = "master-1"
instance_group {
value = "master-1"
}
}

member {
name = "master-2"
instance_group = "master-2"
name = "master-2"
instance_group {
value = "master-2"
}
}
}

etcd_cluster {
name = "events"

member {
name = "master-0"
instance_group = "master-0"
name = "master-0"
instance_group {
value = "master-0"
}
}

member {
name = "master-1"
instance_group = "master-1"
name = "master-1"
instance_group {
value = "master-1"
}
}

member {
name = "master-2"
instance_group = "master-2"
name = "master-2"
instance_group {
value = "master-2"
}
}
}
}
Expand All @@ -85,8 +97,12 @@ resource "kops_instance_group" "master-0" {
cluster_name = kops_cluster.cluster.name
name = "master-0"
role = "Master"
min_size = 1
max_size = 1
min_size {
value = 1
}
max_size {
value = 1
}
machine_type = "t3.medium"
subnets = ["private-0"]
depends_on = [kops_cluster.cluster]
Expand All @@ -96,8 +112,12 @@ resource "kops_instance_group" "master-1" {
cluster_name = kops_cluster.cluster.name
name = "master-1"
role = "Master"
min_size = 1
max_size = 1
min_size {
value = 1
}
max_size {
value = 1
}
machine_type = "t3.medium"
subnets = ["private-1"]
depends_on = [kops_cluster.cluster]
Expand All @@ -107,8 +127,12 @@ resource "kops_instance_group" "master-2" {
cluster_name = kops_cluster.cluster.name
name = "master-2"
role = "Master"
min_size = 1
max_size = 1
min_size {
value = 1
}
max_size {
value = 1
}
machine_type = "t3.medium"
subnets = ["private-2"]
depends_on = [kops_cluster.cluster]
Expand All @@ -128,7 +152,9 @@ resource "kops_cluster_updater" "updater" {
skip = false
fail_on_drain_error = true
fail_on_validate = true
validate_count = 1
validate_count {
value = 1
}
}

validate {
Expand Down
64 changes: 45 additions & 19 deletions examples/aws-profile/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,37 +46,49 @@ resource "kops_cluster" "cluster" {
name = "main"

member {
name = "master-0"
instance_group = "master-0"
name = "master-0"
instance_group {
value = "master-0"
}
}

member {
name = "master-1"
instance_group = "master-1"
name = "master-1"
instance_group {
value = "master-1"
}
}

member {
name = "master-2"
instance_group = "master-2"
name = "master-2"
instance_group {
value = "master-2"
}
}
}

etcd_cluster {
name = "events"

member {
name = "master-0"
instance_group = "master-0"
name = "master-0"
instance_group {
value = "master-0"
}
}

member {
name = "master-1"
instance_group = "master-1"
name = "master-1"
instance_group {
value = "master-1"
}
}

member {
name = "master-2"
instance_group = "master-2"
name = "master-2"
instance_group {
value = "master-2"
}
}
}
}
Expand All @@ -85,8 +97,12 @@ resource "kops_instance_group" "master-0" {
cluster_name = kops_cluster.cluster.name
name = "master-0"
role = "Master"
min_size = 1
max_size = 1
min_size {
value = 1
}
max_size {
value = 1
}
machine_type = "t3.medium"
subnets = ["private-0"]
depends_on = [kops_cluster.cluster]
Expand All @@ -96,8 +112,12 @@ resource "kops_instance_group" "master-1" {
cluster_name = kops_cluster.cluster.name
name = "master-1"
role = "Master"
min_size = 1
max_size = 1
min_size {
value = 1
}
max_size {
value = 1
}
machine_type = "t3.medium"
subnets = ["private-1"]
depends_on = [kops_cluster.cluster]
Expand All @@ -107,8 +127,12 @@ resource "kops_instance_group" "master-2" {
cluster_name = kops_cluster.cluster.name
name = "master-2"
role = "Master"
min_size = 1
max_size = 1
min_size {
value = 1
}
max_size {
value = 1
}
machine_type = "t3.medium"
subnets = ["private-2"]
depends_on = [kops_cluster.cluster]
Expand All @@ -128,7 +152,9 @@ resource "kops_cluster_updater" "updater" {
skip = false
fail_on_drain_error = true
fail_on_validate = true
validate_count = 1
validate_count {
value = 1
}
}

validate {
Expand Down
71 changes: 52 additions & 19 deletions examples/basic/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,47 +46,70 @@ resource "kops_cluster" "cluster" {
name = "main"

member {
name = "master-0"
instance_group = "master-0"
name = "master-0"
instance_group {
value = "master-0"
}
}

member {
name = "master-1"
instance_group = "master-1"
name = "master-1"
instance_group {
value = "master-1"
}
}

member {
name = "master-2"
instance_group = "master-2"
name = "master-2"
instance_group {
value = "master-2"
}
}
}

etcd_cluster {
name = "events"

member {
name = "master-0"
instance_group = "master-0"
name = "master-0"
instance_group {
value = "master-0"
}
}

member {
name = "master-1"
instance_group = "master-1"
name = "master-1"
instance_group {
value = "master-1"
}
}

member {
name = "master-2"
instance_group = "master-2"
name = "master-2"
instance_group {
value = "master-2"
}
}
}

kubelet {
anonymous_auth {
value = true
}
authorization_mode = "dummy"
}
}

resource "kops_instance_group" "master-0" {
cluster_name = kops_cluster.cluster.name
name = "master-0"
role = "Master"
min_size = 1
max_size = 1
min_size {
value = 1
}
max_size {
value = 1
}
machine_type = "t3.medium"
subnets = ["private-0"]
depends_on = [kops_cluster.cluster]
Expand All @@ -96,8 +119,12 @@ resource "kops_instance_group" "master-1" {
cluster_name = kops_cluster.cluster.name
name = "master-1"
role = "Master"
min_size = 1
max_size = 1
min_size {
value = 1
}
max_size {
value = 1
}
machine_type = "t3.medium"
subnets = ["private-1"]
depends_on = [kops_cluster.cluster]
Expand All @@ -107,8 +134,12 @@ resource "kops_instance_group" "master-2" {
cluster_name = kops_cluster.cluster.name
name = "master-2"
role = "Master"
min_size = 1
max_size = 1
min_size {
value = 1
}
max_size {
value = 1
}
machine_type = "t3.medium"
subnets = ["private-2"]
depends_on = [kops_cluster.cluster]
Expand All @@ -128,7 +159,9 @@ resource "kops_cluster_updater" "updater" {
skip = false
fail_on_drain_error = true
fail_on_validate = true
validate_count = 1
validate_count {
value = 1
}
}

validate {
Expand Down
5 changes: 4 additions & 1 deletion examples/basic/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ terraform {
}

provider "kops" {
state_store = "s3://cluster.example.com"
state_store = "file://./store"
aws {
region = "eu-west-3"
}
}

provider "helm" {
Expand Down
Loading