Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable IPVS on kube proxy #2357

Merged
merged 7 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changes to the setup_ipvs function
  • Loading branch information
RobertLucian committed Jul 19, 2021
commit 4dbf364d3786047ded907c18c8a14797c8cdaaf6
16 changes: 13 additions & 3 deletions manager/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,21 @@ function remove_nodegroups() {
echo
}

func setup_ipvs() {
function setup_ipvs() {
# get a random kube-proxy pod
until [ "$(kubectl get pod -n kube-system -l k8s-app=kube-proxy -o jsonpath='{.items[*].metadata.name}' | wc -w)" -ne "0" ]; do sleep 1; done
RobertLucian marked this conversation as resolved.
Show resolved Hide resolved
kube_proxy_pod=$(kubectl get pod -n kube-system -l k8s-app=kube-proxy -o jsonpath='{.items[*].metadata.name}' | cut -d " " -f1)

# export kube-proxy's current config
kubectl exec -it -n kube-system ${kube_proxy_pod} -- cat /var/lib/kube-proxy-config/config > proxy_config.yaml
python upgrade_kube_proxy_mode.py proxy_config.yaml > proxy_config.yaml
kubectl get configmap -n kube-system kube-proxy -o yaml | yq --arg replace "`cat proxy_config.yaml`" '.data.config=$replace'

# upgrade proxy mode from the exported kube-proxy config
python upgrade_kube_proxy_mode.py proxy_config.yaml > upgraded_proxy_config.yaml

# update kube-proxy's configmap to include the updated configuration
kubectl get configmap -n kube-system kube-proxy -o yaml | yq --arg replace "`cat upgraded_proxy_config.yaml`" '.data.config=$replace' | kubectl apply -f - >/dev/null

# patch the kube-proxy daemonset
kubectl patch ds -n kube-system kube-proxy --patch "$(cat manifests/kube-proxy.yaml)" >/dev/null
kubectl rollout status daemonset kube-proxy -n kube-system --timeout 30m >/dev/null
}
Expand Down
2 changes: 1 addition & 1 deletion manager/manifests/kube-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
- name: kube-proxy
command:
- kube-proxy
- --v=22
- --v=2
- --proxy-mode=ipvs
- --ipvs-scheduler=rr
- --config=/var/lib/kube-proxy/config
Expand Down