Skip to content

Commit

Permalink
Merge pull request #54 from sighupio/enable-optional-max-pods
Browse files Browse the repository at this point in the history
Enable optional max pods, fix custom ami
  • Loading branch information
angelbarrera92 committed Sep 20, 2021
2 parents fe03e5e + c67b613 commit 012d862
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion automated-tests/e2e-tests/gcp-gke/cluster.tpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ kind: Cluster
metadata:
name: e2e-${CI_BUILD_NUMBER}
spec:
version: 1.20.9-gke.700
version: 1.20.9-gke.701
network: e2e-${CI_BUILD_NUMBER}
subnetworks:
- e2e-${CI_BUILD_NUMBER}-cluster-subnet
Expand Down
2 changes: 1 addition & 1 deletion automated-tests/integration/gcp-gke/cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
name: furyctl
provisioner: gke
spec:
version: 1.20.9-gke.700
version: 1.20.9-gke.701
network: furyctl
subnetworks:
- furyctl-cluster-subnet
Expand Down
2 changes: 1 addition & 1 deletion data/provisioners/cluster/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ terraform {
}

module "fury" {
source = "github.com/sighupio/fury-eks-installer//modules/eks?ref=v1.8.0"
source = "github.com/sighupio/fury-eks-installer//modules/eks?ref=v1.8.1"

cluster_name = var.cluster_name
cluster_version = var.cluster_version
Expand Down
2 changes: 1 addition & 1 deletion data/provisioners/cluster/eks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ variable "node_pools" {
max_size = number
instance_type = string
os = optional(string)
max_pods = number # null to use default upstream configuration
max_pods = optional(number) # null to use default upstream configuration
volume_size = number
subnetworks = list(string) # null to use default upstream configuration
labels = map(string)
Expand Down
2 changes: 1 addition & 1 deletion data/provisioners/cluster/gke/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ terraform {
}

module "fury" {
source = "github.com/sighupio/fury-gke-installer//modules/gke?ref=v1.8.0"
source = "github.com/sighupio/fury-gke-installer//modules/gke?ref=v1.8.1"

cluster_name = var.cluster_name
cluster_version = var.cluster_version
Expand Down
2 changes: 1 addition & 1 deletion data/provisioners/cluster/gke/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ variable "node_pools" {
max_size = number
instance_type = string
os = optional(string)
max_pods = number # null to use default upstream configuration
max_pods = optional(number) # null to use default upstream configuration
volume_size = number
subnetworks = list(string) # "" to use default upstream configuration
labels = map(string)
Expand Down
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ require (
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.8.1
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
golang.org/x/net v0.0.0-20210420072503-d25e30425868 // indirect
golang.org/x/sys v0.0.0-20210902050250-f475640dd07b // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/tools v0.1.5 // indirect
golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 // indirect
golang.org/x/term v0.0.0-20210916214954-140adaaadfaf // indirect
golang.org/x/tools v0.1.6 // indirect
gopkg.in/yaml.v2 v2.4.0
)

Expand Down
19 changes: 11 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
github.com/zclconf/go-cty v1.8.2 h1:u+xZfBKgpycDnTNjPhGiTEYZS5qS/Sb5MqSfm7vzcjg=
Expand Down Expand Up @@ -561,8 +562,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210420072503-d25e30425868 h1:mHVdVrNGft0Bv5N0WIf3/ujpDOQOe6KxvwlIikPbMr0=
golang.org/x/net v0.0.0-20210420072503-d25e30425868/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -637,14 +638,16 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210902050250-f475640dd07b h1:S7hKs0Flbq0bbc9xgYt4stIEG1zNDFqyrPwAX2Wj/sE=
golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 h1:J27LZFQBFoihqXoegpscI10HpjZ7B5WQLLKL2FZXQKw=
golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20210916214954-140adaaadfaf h1:Ihq/mm/suC88gF8WFcVwk+OV6Tq+wyA1O0E5UEvDglI=
golang.org/x/term v0.0.0-20210916214954-140adaaadfaf/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down Expand Up @@ -710,8 +713,8 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.6 h1:SIasE1FVIQOWz2GEAHFOmoW7xchJcqlucjSULTL0Ag4=
golang.org/x/tools v0.1.6/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
4 changes: 1 addition & 3 deletions internal/cluster/provisioners/eks/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,14 @@ func (e EKS) createVarFile() (err error) {
buffer.WriteString(fmt.Sprintf("instance_type = \"%v\"\n", np.InstanceType))

if np.OS != "" {
buffer.WriteString(fmt.Sprintf("os = %v\n", np.OS))
buffer.WriteString(fmt.Sprintf("os = \"%v\"\n", np.OS))
}
if len(np.TargetGroups) > 0 {
buffer.WriteString(fmt.Sprintf("eks_target_group_arns = [\"%v\"]\n", strings.Join(np.TargetGroups, "\",\"")))
}

if np.MaxPods > 0 {
buffer.WriteString(fmt.Sprintf("max_pods = %v\n", np.MaxPods))
} else {
buffer.WriteString("max_pods = null\n")
}
buffer.WriteString(fmt.Sprintf("volume_size = %v\n", np.VolumeSize))

Expand Down
6 changes: 4 additions & 2 deletions internal/cluster/provisioners/gke/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ func (e GKE) createVarFile() (err error) {
buffer.WriteString(fmt.Sprintf("max_size = %v\n", np.MaxSize))
buffer.WriteString(fmt.Sprintf("instance_type = \"%v\"\n", np.InstanceType))
if np.OS != "" {
buffer.WriteString(fmt.Sprintf("os = %v\n", np.OS))
buffer.WriteString(fmt.Sprintf("os = \"%v\"\n", np.OS))
}
if np.MaxPods > 0 {
buffer.WriteString(fmt.Sprintf("max_pods = %v\n", np.MaxPods))
}
buffer.WriteString(fmt.Sprintf("max_pods = %v\n", np.MaxPods))
buffer.WriteString(fmt.Sprintf("volume_size = %v\n", np.VolumeSize))
if len(np.SubNetworks) > 0 {
buffer.WriteString(fmt.Sprintf("subnetworks = [\"%v\"]\n", strings.Join(np.SubNetworks, "\",\"")))
Expand Down

0 comments on commit 012d862

Please sign in to comment.