Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P84273
mw-experimental-shell
Active
Public
Actions
Authored by
jijiki
on Oct 23 2025, 10:33 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Tags
None
Referenced Files
F66785416: mw-experimental-shell
Oct 23 2025, 10:33 AM
2025-10-23 10:33:36 (UTC+0)
Subscribers
None
#!/bin/bash
# Source /etc/profile.d/ (kube_env is defined there)
if
[
-d /etc/profile.d
]
;
then
for
file in /etc/profile.d/*.sh
;
do
[
-r
"
$file
"
]
&&
source
"
$file
"
done
fi
# Check DC arg is given
if
[
-z
"
$1
"
]
;
then
echo
"Usage:
$0
<DC>"
echo
"DC must be 'eqiad' or 'codfw'."
exit
1
fi
DC
=
"
$1
"
if
[
"
$DC
"
!
=
"eqiad"
]
&&
[
"
$DC
"
!
=
"codfw"
]
;
then
echo
"Error: DC must be either 'eqiad' or 'codfw'."
exit
1
fi
# Activate the kube environment
echo
"Activating env for mw-experimental in
$DC
..."
kube_env mw-experimental-deploy
"
$DC
"
||
{
echo
"Failed to set kube environment"
;
exit
1
;
}
# Get the pod name (we have 1 pod per DC)
POD
=
$(
kubectl get po --no-headers -o custom-columns
=
":metadata.name"
|
grep
'^mw-experimental'
|
head -n1
)
if
[
-z
"
$POD
"
]
;
then
echo
"Error: no 'mw-experimental' pods found."
exit
1
fi
echo
"Found a pod!
$POD
"
# Start an interactive bash session with a custom prompt
kubectl
exec
"
$POD
"
-c mediawiki-pinkllama-app -it -- bash -c
'CLUSTER=$(cat /etc/wikimedia-cluster); echo "PS1=\"\${debian_chroot:+(\$debian_chroot)}\u@\\h-${CLUSTER}:\w\\$ \" ; export PS1" > /tmp/custom_ps1; bash --rcfile /tmp/custom_ps1 -i'
Event Timeline
jijiki
created this paste.
Oct 23 2025, 10:33 AM
2025-10-23 10:33:36 (UTC+0)
jijiki
mentioned this in
T405688: Support shell to mw-experimental pod
.
Oct 23 2025, 10:35 AM
2025-10-23 10:35:42 (UTC+0)
Log In to Comment