Page MenuHomePhabricator

Migrate Wikikube k8s apiserver and services to IPIP
Open, MediumPublic

Description

With T352956: Handling inbound IPIP traffic on low traffic LVS k8s based realservers completed and verified on wikikube-staging we now need to migrate all other kubernetes related LVS VIPs to IPIP encapsulation.

I've captured the required steps at:
https://wikitech.wikimedia.org/wiki/Kubernetes/Clusters/IPIP

  • apiserves (and the apiserver service) have been migrated to IPIP
  • Prep work (enabling IPIP support on all workers) fo workload is done, we now need to migrate services to IPIP
Services
  • apertium
  • citoid
  • cxserver
  • echostore
  • eventgate-analytics
  • eventgate-logging-external
  • eventgate-analytics-external
  • eventgate-main
  • eventstreams
  • k8s-ingress-wikikube
  • kartotherian-k8s-ssl
  • kubemaster
  • mathoid (hold because T431372: Mark Mathoid endpoints as deprecated)
  • mobileapps
  • mwdebug
  • mwdebug-next
  • mw-web
  • mw-web-next
  • mw-api-ext
  • mw-api-ext-next
  • mw-api-int
  • mw-jobrunner
  • proton
  • push-notifications
  • recommendation-api
  • sessionstore
  • shellbox
  • shellbox-constraints
  • shellbox-media
  • shellbox-syntaxhighlight
  • shellbox-timeline
  • shellbox-video
  • tegola-vector-tiles
  • termbox
  • thumbor
  • toolhub
  • wikifeeds
  • zotero
  • linkrecommendation
  • linkrecommendation-external
  • device-analytics
  • rest-gateway
import yaml
with open("hieradata/common/service.yaml", "r", encoding="utf8") as f:
    data = yaml.safe_load(f)
services = data.get("service::catalog", {})
for name, config in services.items():
    lvs = config.get("lvs", {})
    conftool = lvs.get("conftool", {})
    ipip = lvs.get("ipip_encapsulation", [])
    if conftool.get("cluster") != "kubernetes":
        continue
    if "eqiad" in ipip and "codfw" in ipip:
        print(f"[x] {name}")
        continue
    print(f"[ ] {name}")

Details

Other Assignee
Jelto
Related Changes in Gerrit:
SubjectAuthorRepoBranchLines +/-
Jeltooperations/puppetproduction+3 -0
Jeltooperations/puppetproduction+12 -3
Jeltooperations/puppetproduction+3 -0
Jeltooperations/puppetproduction+12 -3
Jeltooperations/puppetproduction+1 -0
Jeltooperations/puppetproduction+4 -1
Jeltooperations/puppetproduction+2 -0
Jeltooperations/puppetproduction+8 -2
Jeltooperations/puppetproduction+1 -0
Jeltooperations/puppetproduction+4 -1
Jeltooperations/puppetproduction+2 -0
Jeltooperations/puppetproduction+8 -2
Jeltooperations/puppetproduction+1 -0
Jeltooperations/puppetproduction+4 -1
Jeltooperations/puppetproduction+4 -1
JMeybohmoperations/puppetproduction+11 -0
JMeybohmoperations/puppetproduction+5 -1
JMeybohmoperations/puppetproduction+2 -0
JMeybohmoperations/puppetproduction+6 -0
Show related patches Customize query in gerrit

Event Timeline

Change #1259995 had a related patch set uploaded (by JMeybohm; author: JMeybohm):

[operations/puppet@production] wikikube: Switch to IPIP mode for kube-apiserver

https://gerrit.wikimedia.org/r/1259995

Change #1259996 had a related patch set uploaded (by JMeybohm; author: JMeybohm):

[operations/puppet@production] wikikube: Enable ipip_encapsulation and mh scheduler

https://gerrit.wikimedia.org/r/1259996

Change #1259995 merged by JMeybohm:

[operations/puppet@production] wikikube: Switch to IPIP mode for kube-apiserver

https://gerrit.wikimedia.org/r/1259995

Change #1260654 had a related patch set uploaded (by JMeybohm; author: JMeybohm):

[operations/puppet@production] wikikube: Switch to IPIP mode for kube-apiserver

https://gerrit.wikimedia.org/r/1260654

Change #1260654 merged by JMeybohm:

[operations/puppet@production] wikikube: Switch to IPIP mode for kube-apiserver

https://gerrit.wikimedia.org/r/1260654

Change #1259996 merged by JMeybohm:

[operations/puppet@production] wikikube: Enable ipip_encapsulation and mh scheduler

https://gerrit.wikimedia.org/r/1259996

Mentioned in SAL (#wikimedia-operations) [2026-03-25T11:51:13Z] <jayme> migrated wikikube apiservers (eqiad and codfw) to IPIP - T420436

Change #1260723 had a related patch set uploaded (by JMeybohm; author: JMeybohm):

[operations/puppet@production] wikikube: Switch to IPIP mode on workers

https://gerrit.wikimedia.org/r/1260723

Mentioned in SAL (#wikimedia-operations) [2026-03-30T13:05:12Z] <jayme> disabling puppet on A:wikiube-worker-eqiad for T420436

Change #1260723 merged by JMeybohm:

[operations/puppet@production] wikikube: Switch to IPIP mode on workers

https://gerrit.wikimedia.org/r/1260723

Mentioned in SAL (#wikimedia-operations) [2026-03-30T13:59:17Z] <jayme> enabling puppet on A:wikiube-worker-eqiad for T420436

After enabling IPIP on the workers there are two which do not accept IPIP packets:

RuntimeError: wikikube-worker2347.codfw.wmnet is not accepting incoming IPIP traffic:  
                                           outer IP header: 172.16.1.1 -> 10.192.58.10  
                                           inner IP header: 10.64.16.154 -> 10.2.1.70  
                                           destination port: 30443

 RuntimeError: wikikube-worker1347.eqiad.wmnet is not accepting incoming IPIP traffic:  
                                           outer IP header: 172.16.1.1 -> 10.64.181.4  
                                           inner IP header: 10.64.16.154 -> 10.2.2.70  
                                           destination port: 30443

wikikube-worker2347.codfw.wmnet is fine after a ferm restart. For whatever reason it was unable to reload and apply the accept rules for ipip

root@wikikube-worker2347:~# sudo iptables -L -n | grep 172.16.0.0/12
root@wikikube-worker2347:~# systemctl status ferm
● ferm.service - ferm firewall configuration
     Loaded: loaded (/usr/lib/systemd/system/ferm.service; enabled; preset: enabled)
    Drop-In: /etc/systemd/system/ferm.service.d
             └─ferm-service-auto-restart.conf, ferm-service-status-restart.conf
     Active: active (exited) since Mon 2026-03-23 13:59:21 UTC; 1 week 0 days ago
 Invocation: eb0989e0768c43389eb94d678b179f63
    Process: 692638 ExecReload=/usr/local/sbin/ferm-status --start-ferm (code=exited, status=1/FAILURE)
   Main PID: 2732 (code=exited, status=0/SUCCESS)
   Mem peak: 49.1M
        CPU: 604ms

Mar 23 13:59:21 wikikube-worker2347 ferm[2732]: Starting Firewall: ferm.
Mar 23 13:59:21 wikikube-worker2347 systemd[1]: Finished ferm.service - ferm firewall configuration.
Mar 30 13:38:20 wikikube-worker2347 systemd[1]: Reloading ferm.service - ferm firewall configuration...
Mar 30 13:38:21 wikikube-worker2347 ferm-status[692638]: Starting ferm
Mar 30 13:38:21 wikikube-worker2347 ferm-status[692693]: Can't lock /run/xtables.lock: Resource temporarily unavailable
Mar 30 13:38:21 wikikube-worker2347 ferm-status[692693]: Another app is currently holding the xtables lock. Perhaps you want to use the -w option?
Mar 30 13:38:21 wikikube-worker2347 ferm-status[692686]: Failed to run /usr/sbin/ip6tables-legacy-restore
Mar 30 13:38:21 wikikube-worker2347 ferm-status[692686]: Firewall rules rolled back.
Mar 30 13:38:21 wikikube-worker2347 systemd[1]: ferm.service: Control process exited, code=exited, status=1/FAILURE
Mar 30 13:38:21 wikikube-worker2347 systemd[1]: Reload failed for ferm.service - ferm firewall configuration.
root@wikikube-worker2347:~# lsof /run/xtables.lock
root@wikikube-worker2347:~# systemctl restart ferm
root@wikikube-worker2347:~# sudo iptables -L -n | grep 172.16.0.0/12
ACCEPT     4    --  172.16.0.0/12        0.0.0.0/0

On wikikube-worker1347.eqiad.wmnet the istio-ingressgateway is unhappy since it can't lookup istiod's IP to update/load it's config.

On wikikube-worker1347.eqiad.wmnet the istio-ingressgateway is unhappy since it can't lookup istiod's IP to update/load it's config.

That was something similar to T417817: Test Nokia switches BGP config for k8s workers (but for a different Nokia version).

With all that out of the way we are good to go for moving services to IPIP.

MLechvien-WMF updated Other Assignee, added: Jelto.
MLechvien-WMF moved this task from Inbox to Scheduled (this Q) on the ServiceOps board.

Change #1311444 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip_encapsulation for wikikube codfw

https://gerrit.wikimedia.org/r/1311444

Change #1328348 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip_encapsulation for apertium in codfw

https://gerrit.wikimedia.org/r/1328348

Change #1328349 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip_encapsulation for apertium in eqiad.

https://gerrit.wikimedia.org/r/1328349

Change #1328348 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip_encapsulation for apertium in codfw

https://gerrit.wikimedia.org/r/1328348

Change #1328349 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip_encapsulation for apertium in eqiad.

https://gerrit.wikimedia.org/r/1328349

Change #1332741 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip_encapsulation for citoid, cxserver in codfw

https://gerrit.wikimedia.org/r/1332741

Change #1333691 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip_encapsulation for citoid, cxserver in eqiad

https://gerrit.wikimedia.org/r/1333691

Change #1332741 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip_encapsulation for citoid, cxserver in codfw

https://gerrit.wikimedia.org/r/1332741

@ssingh reported in wikimedia-traffic a pending pybal restart and manually restarted pybal.

I used the sre.loadbalancer.migrate-service-ipip cookbook which should do pybal restart. In the cookbook log there is:

==> Press continue when you are ready to restart pybal.
Type "go" to proceed or "abort" to interrupt the execution
> go
User input is: "go"
START - Cookbook sre.loadbalancer.restart-pybal rolling-restart of pybal on (A:lvs-low-traffic-codfw or A:lvs-secondary-codfw) and A:bullseye and A:lvs
Running action: restart_daemons on hosts lvs2013.codfw.wmnet
...
Running action: restart_daemons on hosts lvs2014.codfw.wmnet
...
All restart_daemons were successful
END (PASS) - Cookbook sre.loadbalancer.restart-pybal (exit_code=0) rolling-restart of pybal on (A:lvs-low-traffic-codfw or A:lvs-secondary-codfw) and A:bullseye and A:lvs

Also SAL logs a restart of pybal in codfw:

START - Cookbook sre.loadbalancer.restart-pybal rolling-restart of pybal on (A:lvs-low-traffic-codfw or A:lvs-secondary-codfw) and A:bullseye and A:lvs
END (PASS) - Cookbook sre.loadbalancer.restart-pybal (exit_code=0) rolling-restart of pybal on (A:lvs-low-traffic-codfw or A:lvs-secondary-codfw) and A:bullseye and A:lvs

In SAL I also see that you @ssingh restarted LVS in eqiad:

sukhe@lvs1019:~$ sudo systemctl restart pybal.service
sukhe@lvs1020:~$ sudo systemctl restart pybal.service

So I assume the IPIP migration change from this patch also caused scheduler changes in eqiad, while IPIP was enabled in codfw only? And for the future services should be migrated in both DCs at the same time to not cause pending pybal changes?

Change #1333691 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip_encapsulation for citoid, cxserver in eqiad

https://gerrit.wikimedia.org/r/1333691

Change #1334801 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip_encapsulation for eventgate-logging-external in codfw

https://gerrit.wikimedia.org/r/1334801

Change #1334802 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip_encapsulation for eventgate-logging-external in eqiad

https://gerrit.wikimedia.org/r/1334802

Change #1334803 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip_encapsulation for eventgate-analytics* in codfw

https://gerrit.wikimedia.org/r/1334803

Change #1334804 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip_encapsulation for eventgate-analytics* in eqiad

https://gerrit.wikimedia.org/r/1334804

Change #1334805 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip_encapsulation for eventgate-main in codfw

https://gerrit.wikimedia.org/r/1334805

Change #1334806 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip_encapsulation for eventgate-main in eqiad

https://gerrit.wikimedia.org/r/1334806

Change #1334801 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip_encapsulation for eventgate-logging-external in codfw

https://gerrit.wikimedia.org/r/1334801

Change #1334802 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip_encapsulation for eventgate-logging-external in eqiad

https://gerrit.wikimedia.org/r/1334802

Change #1334803 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip_encapsulation for eventgate-analytics* in codfw

https://gerrit.wikimedia.org/r/1334803

Change #1334804 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip_encapsulation for eventgate-analytics* in eqiad

https://gerrit.wikimedia.org/r/1334804

Change #1334805 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip_encapsulation for eventgate-main in codfw

https://gerrit.wikimedia.org/r/1334805

Change #1334806 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip_encapsulation for eventgate-main in eqiad

https://gerrit.wikimedia.org/r/1334806

eventgate* was migrated to IPIP. None of the migrations caused any latency peaks or other problems so far. So we should be good to convert bigger batches of services. I'll upload changes.

Change #1337851 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip for echostore, eventstreams, kartotherian

https://gerrit.wikimedia.org/r/1337851

Change #1337852 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip_encapsulation for echostore, eventstreams, kartotherian

https://gerrit.wikimedia.org/r/1337852

Change #1337851 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip for echostore, eventstreams, kartotherian codfw

https://gerrit.wikimedia.org/r/1337851

Change #1337852 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip for echostore, eventstreams, kartotherian eqiad

https://gerrit.wikimedia.org/r/1337852

Change #1337923 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip for mobileapps, proton, push-notifications codfw

https://gerrit.wikimedia.org/r/1337923

Change #1337924 had a related patch set uploaded (by Jelto; author: Jelto):

[operations/puppet@production] service::catalog: Set ipip for mobileapps, proton, push-notifications eqiad

https://gerrit.wikimedia.org/r/1337924

Change #1337923 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip for mobileapps, proton, push-notifications codfw

https://gerrit.wikimedia.org/r/1337923

Change #1337924 merged by Jelto:

[operations/puppet@production] service::catalog: Set ipip for mobileapps, proton, push-notifications eqiad

https://gerrit.wikimedia.org/r/1337924