Skip to content

Commit

Permalink
Adjust parameters for testing cilium kube-proxy replacement mode
Browse files Browse the repository at this point in the history
  • Loading branch information
berkayoz committed Sep 18, 2024
1 parent 6ee8863 commit 61bb22d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
12 changes: 6 additions & 6 deletions src/k8s/pkg/k8sd/app/hooks_bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ func (a *App) onBootstrapWorkerNode(ctx context.Context, s state.State, encodedT
if err := setup.KubeletWorker(snap, s.Name(), nodeIP, response.ClusterDNS, response.ClusterDomain, response.CloudProvider, joinConfig.ExtraNodeKubeletArgs); err != nil {
return fmt.Errorf("failed to configure kubelet: %w", err)
}
if err := setup.KubeProxy(ctx, snap, s.Name(), response.PodCIDR, localhostAddress, joinConfig.ExtraNodeKubeProxyArgs); err != nil {
return fmt.Errorf("failed to configure kube-proxy: %w", err)
}
// if err := setup.KubeProxy(ctx, snap, s.Name(), response.PodCIDR, localhostAddress, joinConfig.ExtraNodeKubeProxyArgs); err != nil {
// return fmt.Errorf("failed to configure kube-proxy: %w", err)
// }
if err := setup.K8sAPIServerProxy(snap, response.APIServers, localhostAddress, joinConfig.ExtraNodeK8sAPIServerProxyArgs); err != nil {
return fmt.Errorf("failed to configure k8s-apiserver-proxy: %w", err)
}
Expand Down Expand Up @@ -432,9 +432,9 @@ func (a *App) onBootstrapControlPlane(ctx context.Context, s state.State, bootst
if err := setup.KubeletControlPlane(snap, s.Name(), nodeIP, cfg.Kubelet.GetClusterDNS(), cfg.Kubelet.GetClusterDomain(), cfg.Kubelet.GetCloudProvider(), cfg.Kubelet.GetControlPlaneTaints(), bootstrapConfig.ExtraNodeKubeletArgs); err != nil {
return fmt.Errorf("failed to configure kubelet: %w", err)
}
if err := setup.KubeProxy(ctx, snap, s.Name(), cfg.Network.GetPodCIDR(), localhostAddress, bootstrapConfig.ExtraNodeKubeProxyArgs); err != nil {
return fmt.Errorf("failed to configure kube-proxy: %w", err)
}
// if err := setup.KubeProxy(ctx, snap, s.Name(), cfg.Network.GetPodCIDR(), localhostAddress, bootstrapConfig.ExtraNodeKubeProxyArgs); err != nil {
// return fmt.Errorf("failed to configure kube-proxy: %w", err)
// }
if err := setup.KubeControllerManager(snap, bootstrapConfig.ExtraNodeKubeControllerManagerArgs); err != nil {
return fmt.Errorf("failed to configure kube-controller-manager: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions src/k8s/pkg/k8sd/app/hooks_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ func (a *App) onPostJoin(ctx context.Context, s state.State, initConfig map[stri
if err := setup.KubeletControlPlane(snap, s.Name(), nodeIP, cfg.Kubelet.GetClusterDNS(), cfg.Kubelet.GetClusterDomain(), cfg.Kubelet.GetCloudProvider(), cfg.Kubelet.GetControlPlaneTaints(), joinConfig.ExtraNodeKubeletArgs); err != nil {
return fmt.Errorf("failed to configure kubelet: %w", err)
}
if err := setup.KubeProxy(ctx, snap, s.Name(), cfg.Network.GetPodCIDR(), localhostAddress, joinConfig.ExtraNodeKubeProxyArgs); err != nil {
return fmt.Errorf("failed to configure kube-proxy: %w", err)
}
// if err := setup.KubeProxy(ctx, snap, s.Name(), cfg.Network.GetPodCIDR(), localhostAddress, joinConfig.ExtraNodeKubeProxyArgs); err != nil {
// return fmt.Errorf("failed to configure kube-proxy: %w", err)
// }
if err := setup.KubeControllerManager(snap, joinConfig.ExtraNodeKubeControllerManagerArgs); err != nil {
return fmt.Errorf("failed to configure kube-controller-manager: %w", err)
}
Expand Down
9 changes: 3 additions & 6 deletions src/k8s/pkg/k8sd/features/cilium/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ func ApplyNetwork(ctx context.Context, snap snap.Snap, cfg types.Network, _ type
"tag": CiliumAgentImageTag,
"useDigest": false,
},
"socketLB": map[string]any{
"enabled": true,
},
"cni": map[string]any{
"confPath": "/etc/cni/net.d",
"binPath": "/opt/cni/bin",
Expand All @@ -87,10 +84,10 @@ func ApplyNetwork(ctx context.Context, snap snap.Snap, cfg types.Network, _ type
"clusterPoolIPv6PodCIDRList": ipv6CIDR,
},
},
"nodePort": map[string]any{
"enabled": true,
},
"disableEnvoyVersionCheck": true,
"kubeProxyReplacement": true,
"k8sServiceHost": "127.0.0.1",
"k8sServicePort": 6443,
}

if snap.Strict() {
Expand Down
4 changes: 2 additions & 2 deletions src/k8s/pkg/snap/util/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ var (
"containerd",
"k8s-apiserver-proxy",
"kubelet",
"kube-proxy",
// "kube-proxy",
}
// controlPlaneServices contains all k8s services that run on a control plane except of k8sd.
controlPlaneServices = []string{
"containerd",
"kube-controller-manager",
"kube-proxy",
// "kube-proxy",
"kube-scheduler",
"kubelet",
"kube-apiserver",
Expand Down

0 comments on commit 61bb22d

Please sign in to comment.