mirror of https://github.com/kubernetes/kops.git
Merge pull request #2330 from justinsb/remove_cni_tag
Replaces UsesCNI with logic
This commit is contained in:
commit
76e98087ac
|
@ -36,7 +36,6 @@ type NodeupModelContext struct {
|
|||
Distribution distros.Distribution
|
||||
|
||||
IsMaster bool
|
||||
UsesCNI bool
|
||||
|
||||
Assets *fi.AssetStore
|
||||
KeyStore fi.CAStore
|
||||
|
@ -175,3 +174,11 @@ func (c *NodeupModelContext) buildPKIKubeconfig(id string) (string, error) {
|
|||
func (c *NodeupModelContext) IsKubernetesGTE(version string) bool {
|
||||
return util.IsKubernetesGTE(version, c.KubernetesVersion)
|
||||
}
|
||||
|
||||
func (c *NodeupModelContext) UsesCNI() bool {
|
||||
networking := c.Cluster.Spec.Networking
|
||||
if networking == nil || networking.Classic != nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ func (b *KubeletBuilder) Build(c *fi.ModelBuilderContext) error {
|
|||
c.AddTask(t)
|
||||
}
|
||||
|
||||
if b.UsesCNI {
|
||||
if b.UsesCNI() {
|
||||
t := &nodetasks.File{
|
||||
Path: b.CNIConfDir(),
|
||||
Type: nodetasks.FileType_Directory,
|
||||
|
@ -135,7 +135,7 @@ func (b *KubeletBuilder) buildSystemdEnvironmentFile(kubeletConfig *kops.Kubelet
|
|||
flags += " --cloud-config=" + CloudConfigFilePath
|
||||
}
|
||||
|
||||
if b.UsesCNI {
|
||||
if b.UsesCNI() {
|
||||
flags += " --cni-bin-dir=" + b.CNIBinDir()
|
||||
flags += " --cni-conf-dir=" + b.CNIConfDir()
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
contents: |
|
||||
DAEMON_ARGS="--feature-gates=AllowExtTrafficLocalEndpoints=false,ExperimentalCriticalPodAnnotation=true --node-labels=kubernetes.io/role=node,node-role.kubernetes.io/node="
|
||||
DAEMON_ARGS="--feature-gates=AllowExtTrafficLocalEndpoints=false,ExperimentalCriticalPodAnnotation=true --node-labels=kubernetes.io/role=node,node-role.kubernetes.io/node= --cni-bin-dir=/opt/cni/bin/ --cni-conf-dir=/etc/cni/net.d/"
|
||||
path: /etc/sysconfig/kubelet
|
||||
type: file
|
||||
|
|
|
@ -37,7 +37,6 @@ import (
|
|||
"k8s.io/kops/upup/pkg/fi/nodeup/cloudinit"
|
||||
"k8s.io/kops/upup/pkg/fi/nodeup/local"
|
||||
"k8s.io/kops/upup/pkg/fi/nodeup/nodetasks"
|
||||
"k8s.io/kops/upup/pkg/fi/nodeup/tags"
|
||||
"k8s.io/kops/upup/pkg/fi/utils"
|
||||
"k8s.io/kops/util/pkg/vfs"
|
||||
)
|
||||
|
@ -208,7 +207,6 @@ func (c *NodeUpCommand) Run(out io.Writer) error {
|
|||
Architecture: model.ArchitectureAmd64,
|
||||
InstanceGroup: c.instanceGroup,
|
||||
IsMaster: nodeTags.Has(TagMaster),
|
||||
UsesCNI: nodeTags.Has(tags.TagCNI),
|
||||
Assets: assets,
|
||||
KeyStore: tf.keyStore,
|
||||
SecretStore: tf.secretStore,
|
||||
|
|
|
@ -21,8 +21,6 @@ const (
|
|||
TagOSFamilyDebian = "_debian_family"
|
||||
|
||||
TagSystemd = "_systemd"
|
||||
|
||||
TagCNI = "_networking_cni"
|
||||
)
|
||||
|
||||
type HasTags interface {
|
||||
|
|
Loading…
Reference in New Issue