mirror of
https://github.com/rancher/rke.git
synced 2025-07-31 22:56:19 +00:00
Use correct labels to delete calico pods
This commit is contained in:
parent
3f94e86706
commit
f1cdff2a3e
@ -495,10 +495,9 @@ func RestartClusterPods(ctx context.Context, kubeCluster *Cluster) error {
|
||||
return fmt.Errorf("Failed to initialize new kubernetes client: %v", err)
|
||||
}
|
||||
labelsList := []string{
|
||||
fmt.Sprintf("%s=%s", KubeAppLabel, CalicoNetworkPlugin),
|
||||
fmt.Sprintf("%s=%s", KubeAppLabel, FlannelNetworkPlugin),
|
||||
fmt.Sprintf("%s=%s", KubeAppLabel, CanalNetworkPlugin),
|
||||
fmt.Sprintf("%s=%s", NameLabel, WeaveNetowrkAppName),
|
||||
fmt.Sprintf("%s=%s", NameLabel, WeaveNetworkAppName),
|
||||
fmt.Sprintf("%s=%s", AppLabel, NginxIngressAddonAppName),
|
||||
fmt.Sprintf("%s=%s", KubeAppLabel, DefaultMonitoringProvider),
|
||||
fmt.Sprintf("%s=%s", KubeAppLabel, KubeDNSAddonAppName),
|
||||
@ -507,6 +506,9 @@ func RestartClusterPods(ctx context.Context, kubeCluster *Cluster) error {
|
||||
fmt.Sprintf("%s=%s", AppLabel, KubeAPIAuthAppName),
|
||||
fmt.Sprintf("%s=%s", AppLabel, CattleClusterAgentAppName),
|
||||
}
|
||||
for _, calicoLabel := range CalicoNetworkLabels {
|
||||
labelsList = append(labelsList, fmt.Sprintf("%s=%s", KubeAppLabel, calicoLabel))
|
||||
}
|
||||
var errgrp errgroup.Group
|
||||
labelQueue := util.GetObjectQueue(labelsList)
|
||||
for w := 0; w < services.WorkerThreads; w++ {
|
||||
|
@ -52,8 +52,10 @@ const (
|
||||
// FlannelBackendVxLanNetworkIdentify should be greater than or equal to 4096 if using VxLan mode in the cluster with Windows nodes
|
||||
FlannelBackendVxLanNetworkIdentify = "flannel_backend_vni"
|
||||
|
||||
CalicoNetworkPlugin = "calico"
|
||||
CalicoCloudProvider = "calico_cloud_provider"
|
||||
CalicoNetworkPlugin = "calico"
|
||||
CalicoNodeLabel = "calico-node"
|
||||
CalicoControllerLabel = "calico-kube-controllers"
|
||||
CalicoCloudProvider = "calico_cloud_provider"
|
||||
|
||||
CanalNetworkPlugin = "canal"
|
||||
CanalIface = "canal_iface"
|
||||
@ -64,7 +66,7 @@ const (
|
||||
CanalFlannelBackendVxLanNetworkIdentify = "canal_flannel_backend_vni"
|
||||
|
||||
WeaveNetworkPlugin = "weave"
|
||||
WeaveNetowrkAppName = "weave-net"
|
||||
WeaveNetworkAppName = "weave-net"
|
||||
// List of map keys to be used with network templates
|
||||
|
||||
// EtcdEndpoints is the server address for Etcd, used by calico
|
||||
@ -123,6 +125,8 @@ var EtcdClientPortList = []string{
|
||||
EtcdPort1,
|
||||
}
|
||||
|
||||
var CalicoNetworkLabels = []string{CalicoNodeLabel, CalicoControllerLabel}
|
||||
|
||||
func (c *Cluster) deployNetworkPlugin(ctx context.Context, data map[string]interface{}) error {
|
||||
log.Infof(ctx, "[network] Setting up network plugin: %s", c.Network.Plugin)
|
||||
switch c.Network.Plugin {
|
||||
|
Loading…
Reference in New Issue
Block a user