Skip to content

Commit

Permalink
add: --disable-network-policy flag to create cluster (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroniscode authored Oct 4, 2023
1 parent 6d9fe82 commit b90f977
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/resource/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ addons:
- name: vpc-cni
version: latest
configurationValues: |-
{{- if eq .KubernetesVersion "1.27" "1.26" "1.25" }}
{{- if and (ne .KubernetesVersion "1.24") (not .DisableNetworkPolicy) }}
enableNetworkPolicy: "true"
{{- end }}
env:
Expand Down
26 changes: 17 additions & 9 deletions pkg/resource/cluster/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ type ClusterOptions struct {
resource.CommonOptions
*nodegroup.NodegroupOptions

Fargate bool
HostnameType string
IPv6 bool
Kubeconfig string
NoRoles bool
PrefixAssignment bool
Private bool
VpcCidr string
DisableNetworkPolicy bool
Fargate bool
HostnameType string
IPv6 bool
Kubeconfig string
NoRoles bool
PrefixAssignment bool
Private bool
VpcCidr string

appsForIrsa []*application.Application
IrsaTemplate *template.TextTemplate
Expand Down Expand Up @@ -90,6 +91,13 @@ func addOptions(res *resource.Resource) *resource.Resource {
Choices: []string{"1.28", "1.27", "1.26", "1.25", "1.24"},
Option: &options.KubernetesVersion,
},
&cmd.BoolFlag{
CommandFlag: cmd.CommandFlag{
Name: "disable-network-policy",
Description: "don't enable network policy for Amazon VPC CNI",
},
Option: &options.DisableNetworkPolicy,
},
&cmd.BoolFlag{
CommandFlag: cmd.CommandFlag{
Name: "fargate",
Expand Down Expand Up @@ -135,7 +143,7 @@ func addOptions(res *resource.Resource) *resource.Resource {
&cmd.BoolFlag{
CommandFlag: cmd.CommandFlag{
Name: "prefix-assignment",
Description: "configured VPC CNI for prefix assignment",
Description: "configure VPC CNI for prefix assignment",
},
Option: &options.PrefixAssignment,
},
Expand Down

0 comments on commit b90f977

Please sign in to comment.