Skip to content

Commit

Permalink
Remove CNI patching (#1386)
Browse files Browse the repository at this point in the history
Signed-off-by: Artiom Diomin <[email protected]>
  • Loading branch information
kron4eg authored Jun 15, 2021
1 parent b1e7a7b commit c477c5b
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 23 deletions.
1 change: 0 additions & 1 deletion pkg/state/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ type State struct {
ForceUpgrade bool
ForceInstall bool
UpgradeMachineDeployments bool
PatchCNI bool
CredentialsFilePath string
ManifestFilePath string
PauseImage string
Expand Down
9 changes: 0 additions & 9 deletions pkg/tasks/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,3 @@ func ensureCNIExternal(s *state.State) error {
s.Logger.Infoln("External CNI plugin will be used")
return nil
}

func patchCNI(s *state.State) error {
if !s.PatchCNI {
return nil
}

s.Logger.Info("Patching CNI...")
return ensureCNI(s)
}
4 changes: 0 additions & 4 deletions pkg/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,6 @@ func WithResources(t Tasks) Tasks {
Description: "ensure external CCM",
Predicate: func(s *state.State) bool { return s.Cluster.CloudProvider.External },
},
{
Fn: patchCNI,
ErrMsg: "failed to patch CNI",
},
{
Fn: joinStaticWorkerNodes,
ErrMsg: "failed to join worker nodes to the cluster",
Expand Down
2 changes: 1 addition & 1 deletion pkg/templates/canal/canal.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func Deploy(s *state.State) error {
configMap(buf, s.Cluster.ClusterNetwork.CNI.Canal.MTU),
daemonsetServiceAccount(),
deploymentServiceAccount(),
daemonSet(s.PatchCNI, s.Cluster.ClusterNetwork.PodSubnet, calicoCNIImage, calicoNodeImage, flannelImage),
daemonSet(s.Cluster.ClusterNetwork.PodSubnet, calicoCNIImage, calicoNodeImage, flannelImage),
controllerDeployment(calicoControllerImage),
)

Expand Down
9 changes: 3 additions & 6 deletions pkg/templates/canal/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

// daemonSet installs the calico/node container, as well as the Calico CNI plugins and network config on each
// master and worker node in a Kubernetes cluster
func daemonSet(ifacePatch bool, clusterCIDR, installCNIImage, calicoImage, flannelImage string) *appsv1.DaemonSet {
func daemonSet(clusterCIDR, installCNIImage, calicoImage, flannelImage string) *appsv1.DaemonSet {
maxUnavailable := intstr.FromInt(1)
terminationGracePeriodSeconds := int64(0)
privileged := true
Expand Down Expand Up @@ -67,17 +67,14 @@ func daemonSet(ifacePatch bool, clusterCIDR, installCNIImage, calicoImage, flann
},
},
},
}

if ifacePatch {
flannelEnv = append(flannelEnv, corev1.EnvVar{
{
Name: "FLANNELD_IFACE",
ValueFrom: &corev1.EnvVarSource{
FieldRef: &corev1.ObjectFieldSelector{
FieldPath: "status.hostIP",
},
},
})
},
}

return &appsv1.DaemonSet{
Expand Down
2 changes: 0 additions & 2 deletions pkg/templates/externalccm/ccm.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ func Ensure(s *state.State) error {
s.Logger.Info("Ensure external CCM is up to date...")
var err error

s.PatchCNI = true

switch {
case s.Cluster.CloudProvider.Hetzner != nil:
err = ensureHetzner(s)
Expand Down

0 comments on commit c477c5b

Please sign in to comment.