func (b *FirewallModelBuilder) addKubeletRules(c *fi.ModelBuilderContext, sgMap map[string]*openstacktasks.SecurityGroup) error {

	//TODO: This is the default port for kubelet and may be overwridden
	masterName := b.SecurityGroupName(kops.InstanceGroupRoleMaster)
	nodeName := b.SecurityGroupName(kops.InstanceGroupRoleNode)
	masterSG := sgMap[masterName]
	nodeSG := sgMap[nodeName]

	kubeletRule := &openstacktasks.SecurityGroupRule{
		Lifecycle:    b.Lifecycle,
		Direction:    s(string(rules.DirIngress)),
		Protocol:     s(IPProtocolTCP),
		EtherType:    s(IPV4),
		PortRangeMin: i(10250),
		PortRangeMax: i(10250),
	}

	// allow node-node, node-master and master-master and master-node
	for _, sgName := range []*openstacktasks.SecurityGroup{masterSG, nodeSG} {
		addDirectionalGroupRule(c, masterSG, sgName, kubeletRule)
		addDirectionalGroupRule(c, nodeSG, sgName, kubeletRule)
	}
	return nil
}
// addKubeletRules - Add rules to 10250 port
Add rules to 10250 port
// addKubeletRules - Add rules to 10250 port
func (b *FirewallModelBuilder) addKubeletRules(c *fi.ModelBuilderContext, sgMap map[string]*openstacktasks.SecurityGroup) error {
	masterName := b.SecurityGroupName(kops.InstanceGroupRoleMaster)
	nodeName := b.SecurityGroupName(kops.InstanceGroupRoleNode)
	masterSG := sgMap[masterName]
	nodeSG := sgMap[nodeName]
	kubeletRule := &openstacktasks.SecurityGroupRule{
		Lifecycle:    b.Lifecycle,
		Direction:    s(string(rules.DirIngress)),
		Protocol:     s(IPProtocolTCP),
		EtherType:    s(IPV4),
		PortRangeMin: i(10250),
		PortRangeMax: i(10250),
	}
	for _, sgName := range []*openstacktasks.SecurityGroup{masterSG, nodeSG} {
		addDirectionalGroupRule(c, masterSG, sgName, kubeletRule)
		addDirectionalGroupRule(c, nodeSG, sgName, kubeletRule)
	}
	return nil
}
func ( b * FirewallModelBuilder ) addKubeletRules ( c * fi . ModelBuilderContext , sgMap map [ string ] * openstacktasks . SecurityGroup ) error { masterName := b . SecurityGroupName ( kops . InstanceGroupRoleMaster ) nodeName := b . SecurityGroupName ( kops . InstanceGroupRoleNode ) masterSG := sgMap [ masterName ] nodeSG := sgMap [ nodeName ] kubeletRule := & openstacktasks . SecurityGroupRule { Lifecycle : b . Lifecycle , Direction : s ( string ( rules . DirIngress ) ) , Protocol : s ( IPProtocolTCP ) , EtherType : s ( IPV4 ) , PortRangeMin : i ( 10250 ) , PortRangeMax : i ( 10250 ) , } for _ , sgName := range [ ] * openstacktasks . SecurityGroup { masterSG , nodeSG } { addDirectionalGroupRule ( c , masterSG , sgName , kubeletRule ) addDirectionalGroupRule ( c , nodeSG , sgName , kubeletRule ) } return nil }
Add rules to 10250 port
Add rules to 10250 port
//TODO: This is the default port for kubelet and may be overwridden // allow node-node, node-master and master-master and master-node