Skip to content

Commit

Permalink
Support ChainInsertMode config option for Calico Networking
Browse files Browse the repository at this point in the history
  • Loading branch information
asmith030 committed Sep 15, 2020
1 parent 44af54f commit 9ca8cb4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/apis/kops/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ type FlannelNetworkingSpec struct {

// CalicoNetworkingSpec declares that we want Calico networking
type CalicoNetworkingSpec struct {
// ChainInsertMode controls whether Felix inserts rules to the top of iptables chains, or
// appends to the bottom. Leaving the default option is safest to prevent accidentally
// breaking connectivity. Default: 'insert' (other options: 'append')
ChainInsertMode string `json:"chainInsertMode,omitempty"`
// CPURequest CPU request of Calico container. Default: 100m
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
// CrossSubnet enables Calico's cross-subnet mode when set to true
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/kops/v1alpha2/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ type FlannelNetworkingSpec struct {

// CalicoNetworkingSpec declares that we want Calico networking
type CalicoNetworkingSpec struct {
// ChainInsertMode controls whether Felix inserts rules to the top of iptables chains, or
// appends to the bottom. Leaving the default option is safest to prevent accidentally
// breaking connectivity. Default: 'insert' (other options: 'append')
ChainInsertMode string `json:"chainInsertMode,omitempty"`
// CPURequest CPU request of Calico container. Default: 100m
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
// CrossSubnet enables Calico's cross-subnet mode when set to true
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions upup/models/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3875,6 +3875,9 @@ spec:
value: "true"

# kops additions
# Controls whether Felix inserts rules to the top of iptables chains, or appends to the bottom
- name: FELIX_CHAININSERTMODE
value: "{{- or .Networking.Calico.ChainInsertMode "insert" }}"
# Set Felix iptables binary variant, Legacy or NFT
- name: FELIX_IPTABLESBACKEND
value: "{{- or .Networking.Calico.IptablesBackend "Auto" }}"
Expand Down
2 changes: 1 addition & 1 deletion upup/pkg/fi/cloudup/bootstrapchannelbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ func (b *BootstrapChannelBuilder) buildAddons(c *fi.ModelBuilderContext) (*chann
"k8s-1.7": "2.6.12-kops.1",
"k8s-1.7-v3": "3.8.0-kops.2",
"k8s-1.12": "3.9.6-kops.1",
"k8s-1.16": "3.16.1-kops.1",
"k8s-1.16": "3.16.1-kops.2",
}

{
Expand Down

0 comments on commit 9ca8cb4

Please sign in to comment.