Skip to content

Commit

Permalink
Merge pull request #8571 from hakman/lyft-subnet-tags
Browse files Browse the repository at this point in the history
Use cluster name as default subnet tag for Lyft CNI
  • Loading branch information
k8s-ci-robot committed Feb 17, 2020
2 parents 4f82e77 + 87bbcd6 commit 10138d8
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ You can specify which subnets to use for allocating Pod IPs by specifying
networking:
lyftvpc:
subnetTags:
kubernetes_kubelet: true
KubernetesCluster: myclustername.mydns.io
```

In this example, new interfaces will be attached to subnets tagged with `kubernetes_kubelet = true`.
Expand Down
2 changes: 2 additions & 0 deletions docs/releases/1.18-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

* Terraform users on AWS may need to rename some resources in their state file in order to prepare for Terraform 0.12 support. See Required Actions below.

* Lyft CNI plugin default subnet tags changed from from `Type: pod` to `KubernetesCluster: myclustername.mydns.io`. Subnets intended for use by the plugin will need to be tagged with this new tag and [additional tag filters](https://github.com/lyft/cni-ipvlan-vpc-k8s#other-configuration-flags) may need to be added to the cluster spec in order to achieve the desired set of subnets.

* Support for Kubernetes versions prior to 1.9 has been removed.

* Kubernetes 1.9 users will need to enable the PodPriority feature gate. See Required Actions below.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"cniVersion": "0.3.1",
"name": "cni-ipvlan-vpc-k8s",
"plugins": [
{
"cniVersion": "0.3.1",
"name": "cni-ipvlan-vpc-k8s",
"plugins": [
{
"cniVersion": "0.3.1",
"type": "cni-ipvlan-vpc-k8s-ipam",
"interfaceIndex": 1,
"skipDeallocation" : true,
"subnetTags": {{ SubnetTags }},
"secGroupIds": {{ NodeSecurityGroups }}
},
{
"cniVersion": "0.3.1",
"type": "cni-ipvlan-vpc-k8s-ipvlan",
"mode": "l2"
},
{
"cniVersion": "0.3.1",
"type": "cni-ipvlan-vpc-k8s-unnumbered-ptp",
"hostInterface": "eth0",
"containerInterface": "veth0",
"ipMasq": true
}
]
}
"type": "cni-ipvlan-vpc-k8s-ipam",
"interfaceIndex": 1,
"skipDeallocation": true,
"subnetTags": {{ SubnetTags }},
"secGroupIds": {{ NodeSecurityGroups }}
},
{
"cniVersion": "0.3.1",
"type": "cni-ipvlan-vpc-k8s-ipvlan",
"mode": "l2"
},
{
"cniVersion": "0.3.1",
"type": "cni-ipvlan-vpc-k8s-unnumbered-ptp",
"hostInterface": "eth0",
"containerInterface": "veth0",
"ipMasq": true
}
]
}
11 changes: 9 additions & 2 deletions upup/pkg/fi/nodeup/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,15 @@ func (c *NodeUpCommand) Run(out io.Writer) error {
if c.cluster.Spec.Networking.LyftVPC != nil {

loader.TemplateFunctions["SubnetTags"] = func() (string, error) {
tags := map[string]string{
"Type": "pod",
var tags map[string]string
if c.cluster.IsKubernetesGTE("1.18") {
tags = map[string]string{
"KubernetesCluster": c.cluster.Name,
}
} else {
tags = map[string]string{
"Type": "pod",
}
}
if len(c.cluster.Spec.Networking.LyftVPC.SubnetTags) > 0 {
tags = c.cluster.Spec.Networking.LyftVPC.SubnetTags
Expand Down

0 comments on commit 10138d8

Please sign in to comment.