Page MenuHomePhabricator
Paste P5016

k8s for i in {1..5} webservice stop; webservice start and webservice restart with kubectl get {pods,services,deployments} for debugging T156626
ActivePublic

Authored by zhuyifei1999 on Mar 5 2017, 4:36 AM.
(venv)tools.video2commons-test@tools-bastion-02:~$ for i in {1..5}; do kubectl get pods; kubectl get services; kubectl get deployments; webservice --backend=kubernetes python2 stop; kubectl get pods; kubectl get services; kubectl get deployments; webservice --backend=kubernetes python2 start; kubectl get pods; kubectl get services; kubectl get deployments; done
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
Your webservice is not running
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
Starting webservice...
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-6dlc6 1/1 Running 0 3s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.243 <none> 8000/TCP 4s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 1 4s
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-6dlc6 1/1 Running 0 4s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.243 <none> 8000/TCP 4s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 1 4s
Stopping webservice...............
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-6dlc6 1/1 Terminating 0 21s
Your job is already running
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-6dlc6 1/1 Terminating 0 22s
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-6dlc6 1/1 Terminating 0 23s
Stopping webservice............
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
Starting webservice...............
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-tfcq8 0/1 ContainerCreating 0 16s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.233 <none> 8000/TCP 16s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 0 16s
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-tfcq8 0/1 ContainerCreating 0 16s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.233 <none> 8000/TCP 16s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 0 17s
Stopping webservice...............
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-tfcq8 1/1 Terminating 0 33s
Your job is already running
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-tfcq8 1/1 Terminating 0 33s
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-tfcq8 1/1 Terminating 0 34s
Stopping webservice...............
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-tfcq8 1/1 Terminating 0 50s
Your job is already running
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-tfcq8 1/1 Terminating 0 51s
(venv)tools.video2commons-test@tools-bastion-02:~$ for i in {1..5}; do kubectl get pods; kubectl get services; kubectl get deployments; webservice --backend=kubernetes python2 restart; kubectl get pods; kubectl get services; kubectl get deployments; doneNAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
Your job is not running, starting.........
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-0u1mo 1/1 Running 0 10s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.230 <none> 8000/TCP 10s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 1 10s
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-0u1mo 1/1 Running 0 10s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.230 <none> 8000/TCP 10s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 1 10s
Restarting webservice...............Traceback (most recent call last):
File "/usr/local/bin/webservice", line 152, in <module>
start(job, '')
File "/usr/local/bin/webservice", line 34, in start
wait_for(lambda: job.get_state() == Backend.STATE_RUNNING, message)
File "/usr/lib/python2.7/dist-packages/toollabs/common/utils.py", line 20, in wait_for
if predicate():
File "/usr/local/bin/webservice", line 34, in <lambda>
wait_for(lambda: job.get_state() == Backend.STATE_RUNNING, message)
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 372, in get_state
pod = self._find_obj(pykube.Pod, self.webservice_label_selector)
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 191, in _find_obj
selector=selector
File "/usr/lib/python2.7/dist-packages/pykube/query.py", line 75, in get
raise ValueError("get() more than one object; use filter")
ValueError: get() more than one object; use filter
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 145, in apport_excepthook
os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as f:
OSError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_webservice.52996.crash'
Original exception was:
Traceback (most recent call last):
File "/usr/local/bin/webservice", line 152, in <module>
start(job, '')
File "/usr/local/bin/webservice", line 34, in start
wait_for(lambda: job.get_state() == Backend.STATE_RUNNING, message)
File "/usr/lib/python2.7/dist-packages/toollabs/common/utils.py", line 20, in wait_for
if predicate():
File "/usr/local/bin/webservice", line 34, in <lambda>
wait_for(lambda: job.get_state() == Backend.STATE_RUNNING, message)
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 372, in get_state
pod = self._find_obj(pykube.Pod, self.webservice_label_selector)
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 191, in _find_obj
selector=selector
File "/usr/lib/python2.7/dist-packages/pykube/query.py", line 75, in get
raise ValueError("get() more than one object; use filter")
ValueError: get() more than one object; use filter
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-0u1mo 1/1 Terminating 0 27s
video2commons-test-3674141639-9gck6 0/1 ContainerCreating 0 0s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.194 <none> 8000/TCP 0s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 0 2s
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-0u1mo 1/1 Terminating 0 28s
video2commons-test-3674141639-9gck6 0/1 ContainerCreating 0 1s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.194 <none> 8000/TCP 1s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 0 2s
Traceback (most recent call last):
File "/usr/local/bin/webservice", line 148, in <module>
if job.get_state() != Backend.STATE_RUNNING:
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 372, in get_state
pod = self._find_obj(pykube.Pod, self.webservice_label_selector)
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 191, in _find_obj
selector=selector
File "/usr/lib/python2.7/dist-packages/pykube/query.py", line 75, in get
raise ValueError("get() more than one object; use filter")
ValueError: get() more than one object; use filter
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 145, in apport_excepthook
os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as f:
OSError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_webservice.52996.crash'
Original exception was:
Traceback (most recent call last):
File "/usr/local/bin/webservice", line 148, in <module>
if job.get_state() != Backend.STATE_RUNNING:
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 372, in get_state
pod = self._find_obj(pykube.Pod, self.webservice_label_selector)
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 191, in _find_obj
selector=selector
File "/usr/lib/python2.7/dist-packages/pykube/query.py", line 75, in get
raise ValueError("get() more than one object; use filter")
ValueError: get() more than one object; use filter
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-0u1mo 1/1 Terminating 0 29s
video2commons-test-3674141639-9gck6 0/1 ContainerCreating 0 2s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.194 <none> 8000/TCP 2s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 0 3s
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-0u1mo 1/1 Terminating 0 30s
video2commons-test-3674141639-9gck6 0/1 ContainerCreating 0 3s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.194 <none> 8000/TCP 3s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 0 4s
Traceback (most recent call last):
File "/usr/local/bin/webservice", line 148, in <module>
if job.get_state() != Backend.STATE_RUNNING:
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 372, in get_state
pod = self._find_obj(pykube.Pod, self.webservice_label_selector)
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 191, in _find_obj
selector=selector
File "/usr/lib/python2.7/dist-packages/pykube/query.py", line 75, in get
raise ValueError("get() more than one object; use filter")
ValueError: get() more than one object; use filter
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 145, in apport_excepthook
os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as f:
OSError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_webservice.52996.crash'
Original exception was:
Traceback (most recent call last):
File "/usr/local/bin/webservice", line 148, in <module>
if job.get_state() != Backend.STATE_RUNNING:
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 372, in get_state
pod = self._find_obj(pykube.Pod, self.webservice_label_selector)
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 191, in _find_obj
selector=selector
File "/usr/lib/python2.7/dist-packages/pykube/query.py", line 75, in get
raise ValueError("get() more than one object; use filter")
ValueError: get() more than one object; use filter
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-0u1mo 1/1 Terminating 0 31s
video2commons-test-3674141639-9gck6 0/1 ContainerCreating 0 4s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.194 <none> 8000/TCP 4s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 0 5s
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-0u1mo 1/1 Terminating 0 32s
video2commons-test-3674141639-9gck6 0/1 ContainerCreating 0 5s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.194 <none> 8000/TCP 5s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 0 6s
Traceback (most recent call last):
File "/usr/local/bin/webservice", line 148, in <module>
if job.get_state() != Backend.STATE_RUNNING:
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 372, in get_state
pod = self._find_obj(pykube.Pod, self.webservice_label_selector)
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 191, in _find_obj
selector=selector
File "/usr/lib/python2.7/dist-packages/pykube/query.py", line 75, in get
raise ValueError("get() more than one object; use filter")
ValueError: get() more than one object; use filter
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 145, in apport_excepthook
os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as f:
OSError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_webservice.52996.crash'
Original exception was:
Traceback (most recent call last):
File "/usr/local/bin/webservice", line 148, in <module>
if job.get_state() != Backend.STATE_RUNNING:
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 372, in get_state
pod = self._find_obj(pykube.Pod, self.webservice_label_selector)
File "/usr/lib/python2.7/dist-packages/toollabs/webservice/backends/kubernetesbackend.py", line 191, in _find_obj
selector=selector
File "/usr/lib/python2.7/dist-packages/pykube/query.py", line 75, in get
raise ValueError("get() more than one object; use filter")
ValueError: get() more than one object; use filter
NAME READY STATUS RESTARTS AGE
interactive 1/1 Running 0 19d
video2commons-test-3674141639-0u1mo 1/1 Terminating 0 33s
video2commons-test-3674141639-9gck6 0/1 ContainerCreating 0 6s
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
video2commons-test 192.168.0.194 <none> 8000/TCP 6s
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
video2commons-test 1 1 1 0 7s