Skip to content

Instantly share code, notes, and snippets.

@bprashanth
bprashanth / gist:8a49d750b1a867e6f65e
Created February 12, 2015 01:13
Pod creation/deletion test
import os
import time
import json
import subprocess
import multiprocessing
POD_MANIFEST = {"desiredState": {"manifest": {"version": "v1beta1", "id": "php", "containers": [{"image": "dockerfile/nginx", "name": "nginx", "livenessProbe": {"type": "http", "initialDelaySeconds": 30, "enabled": True, "httpGet": {"path": "/index.html", "port": "8081"}}, "ports": [{"containerPort": 80, "hostPort": 8081}]}]}}, "kind": "Pod", "labels": {"name": "foo"}, "id": "php", "apiVersion": "v1beta1"}
def get(state=None):
cmd = './cluster/kubectl.sh get pods'
248 2015/03/08 00:08:28 netutil: Resolving etcdtest:2380 to 10.240.188.68:2380
249 2015/03/08 00:08:28 etcd: listening for peers on http://localhost:2380
250 2015/03/08 00:08:28 etcd: listening for peers on http://localhost:7001
251 2015/03/08 00:08:28 etcd: listening for client requests on http://0.0.0.0:4001
252 2015/03/08 00:08:28 datadir is valid for the 2.0.1 format
253 2015/03/08 00:08:38 etcdserver: recovered store from snapshot at index 20002
254 2015/03/08 00:08:38 etcdserver: name = etcdtest
255 2015/03/08 00:08:38 etcdserver: data dir = /var/etcd/data
256 2015/03/08 00:08:38 etcdserver: member dir = /var/etcd/data/member
257 2015/03/08 00:08:38 etcdserver: heartbeat = 100ms
@bprashanth
bprashanth / gist:34ab77977ea32fef98fb
Created March 12, 2015 19:11
nodecontroller logs
I0312 14:35:13.516633 4297 controllermanager.go:124] --machines is overwritten by --minion_regexp
I0312 14:35:15.455207 4297 nodecontroller.go:154] Registered node in registry: e2e-test-beeps-minion-33fk.c.kubernetesdev.internal
I0312 14:35:15.459581 4297 nodecontroller.go:154] Registered node in registry: e2e-test-beeps-minion-nwe9.c.kubernetesdev.internal
I0312 14:35:15.459596 4297 nodecontroller.go:159] Successfully registered all nodes
I0312 14:35:15.558413 4297 http.go:60] HTTP probe error: Get http://e2e-test-beeps-minion-nwe9.c.kubernetesdev.internal:10250/healthz: dial tcp 10.240.2.221:10250: connection refused
E0312 14:35:15.803222 4297 nodecontroller.go:312] Can't collect information for node e2e-test-beeps-minion-nwe9.c.kubernetesdev.internal: Get http://e2e-test-beeps-minion-nwe9.c.kubernetesdev.internal:10250/api/v1beta1/nodeInfo: dial tcp 10.240.2.221:10250: connection refused
E0312 14:35:15.950049 4297 nodecontroller.go:312] Can't collect information for node e2e-test-beeps
$ kubectl get event
FIRSTSEEN LASTSEEN COUNT NAME KIND SUBOBJECT REASON SOURCE MESSAGE
Thu, 09 Apr 2015 22:01:40 +0000 Thu, 09 Apr 2015 22:01:40 +0000 1 etcd-server-e2e-test-quinton-master Pod spec.containers{etcd-container} pulled {kubelet e2e-test-quinton-master.c.kubernetes-getting-started.internal} Successfully pulled image "gcr.io/google_containers/etcd:2.0.9"
Thu, 09 Apr 2015 22:01:40 +0000 Thu, 09 Apr 2015 22:01:40 +0000 1 etcd-server-e2e-test-quinton-master Pod spec.containers{etcd-container} started {kubelet e2e-test-quinton-master.c.kubernetes-getting-started.internal} Started with docker id 196afd2fe85f844269fbd9041cf409d13144267d85c5a4a5e58722338a8a8ba6
Thu, 09 Apr 2015 22:01:40 +0000 Thu, 09 Apr 2015 22:01:40 +0000 1 etcd-server-e2e-test-quinton-master Pod spec.containers{etcd-container} created {kubelet e2e-test-quinton-master.c.kubernetes-getting-started.internal} Created with docker id 196afd2fe85f844269fbd9041cf409d13144267d85c5a4a5e58722338a8a8ba6
Thu, 09 Apr 2015 22:01:48 +0000 Thu, 09 Apr
6s Merge
================================================================================================
I0412 21:01:14.529334 4723 config.go:188] ~kubelet podStorage Merged snap length 148, space left in BUS 0
I0412 21:01:14.784724 4723 event.go:200] Event(api.ObjectReference{Kind:"Pod", Namespace:"default", Name:"test-5tpku", UID:"85c11b98-e191-11e4-be7c-ac162d075328", APIVersion:"v1beta3", ResourceVersion:"483", FieldPath:"implicitly required container POD"}): reason: 'created' Created with docker id 19d8cef5683d90701e8794efca8f81b6fa8e15b69c19411d7bf0256adeb77612
I0412 21:01:15.326972 4723 factory.go:71] Using factory "docker" for container "/docker/af49995ba84d491c9962b0ebb8313b05111fd9075935bc2fc977fa30be64a46b"
I0412 21:01:15.328119 4723 manager.go:167] Container inspect result: {ID:647683cfd36f83101e5934af747eeb95a8f0415c872b6d577aba9dd6c77f2719 Created:2015-04-13 03:59:53.760866585 +0000 UTC Path:/pause Args:[] Config:0x4c20df7d180 State:{Running:true Paused:false OOMKilled:false Pid:79
$ for i in 100 500 1000 2000 3000; do go test -bench . -tags 'benchmark' -bench-quiet 0 -bench-pods $i -bench-tasks 1; done
PASS
BenchmarkPodList 10 368965428 ns/op
BenchmarkPodListEtcd 5 261358598 ns/op
ok github.com/GoogleCloudPlatform/kubernetes/test/integration 11.485s
PASS
BenchmarkPodList 2 897347348 ns/op
BenchmarkPodListEtcd 3 353455914 ns/op
ok github.com/GoogleCloudPlatform/kubernetes/test/integration 10.775s
PASS
/go/src/github.com/GoogleCloudPlatform/kubernetes/_output/dockerized/go/src/github.com/GoogleCloudPlatform/kubernetes/test/e2e/density.go:91
------------------------------
Reboot
each node by ordering unclean reboot and ensure they function upon restart
/go/src/github.com/GoogleCloudPlatform/kubernetes/_output/dockerized/go/src/github.com/GoogleCloudPlatform/kubernetes/test/e2e/reboot.go:74
[BeforeEach] Reboot
/go/src/github.com/GoogleCloudPlatform/kubernetes/_output/dockerized/go/src/github.com/GoogleCloudPlatform/kubernetes/test/e2e/reboot.go:64
>>> testContext.KubeConfig: /usr/local/google/home/beeps/.kube/config
[It] each node by ordering unclean reboot and ensure they function upon restart
/go/src/github.com/GoogleCloudPlatform/kubernetes/_output/dockerized/go/src/github.com/GoogleCloudPlatform/kubernetes/test/e2e/reboot.go:74
Name: elasticsearch-logging-v1-7w3d6
Image(s): gcr.io/google_containers/elasticsearch:1.4
Node: e2e-test-beeps-minion-vurw/107.178.223.165
Labels: k8s-app=elasticsearch-logging,kubernetes.io/cluster-service=true,version=v1
Status: Running
Replication Controllers: elasticsearch-logging-v1 (2/2 replicas created)
Containers:
elasticsearch-logging:
Image: gcr.io/google_containers/elasticsearch:1.4
State: Running
I0610 20:26:16.207236 5845 manager.go:749] (kubelet) dockertools GetPods took 8.432542ms
I0610 20:26:16.486348 5845 server.go:593] GET /stats/e2e-tests-density-a6422bbb-82d7-485e-a7b4-fcd1c5fa4bd6/density60-9951ac1c-0fae-11e5-9029-62d2ce9e13bb-fbect/99cc6be1-0fae-11e5-89d2-42010af07822/density60-9951ac1c-0fae-11e5-9029-62d2ce9e13bb: (287.580277ms) 0 [[Go 1.1 package http] 10.245.1.5:49452]
I0610 20:26:16.256628 5845 container.go:306] [/7918e24d57f4d0ed27b64a5e5d5da5ee395f555272cf9b747d003dfe3a1fc7e7] Housekeeping took 221.853532ms
I0610 20:26:16.488359 5845 manager.go:749] (kubelet) dockertools GetPods took 274.188392ms
I0610 20:26:16.490461 5845 server.go:593] GET /stats/e2e-tests-density-a6422bbb-82d7-485e-a7b4-fcd1c5fa4bd6/density60-9951ac1c-0fae-11e5-9029-62d2ce9e13bb-vlvdz/99a5ac72-0fae-11e5-89d2-42010af07822/density60-9951ac1c-0fae-11e5-9029-62d2ce9e13bb: (276.338502ms) 0 [[Go 1.1 package http] 10.245.1.5:49474]
I0610 20:26:16.515530 5845 manager.go:749] (kubelet) dockertools GetPods t
beeps@e2e-test-beeps-minion-21dm:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
13271c3b3095 gcr.io/google_containers/fluentd-elasticsearch:1.5 "\"/bin/sh -c '/usr/ 13 minutes ago Up 13 minutes k8s_fluentd-elasticsearch.fe026601_fluentd-elasticsearch-e2e-test-beeps-minion-21dm_default_5f9950d081564dad2522c56233c6ad72_0b777e0e
9f1a0389f060 gcr.io/google_containers/pause:0.8.0 "/pause" 13 minutes ago Up 13 minutes k8s_POD.e4cc795_fluentd-elasticsearch-e2e-test-beeps-minion-21dm_default_5f9950d081564dad2522c56233c6ad72_e5c848dd
beeps@e2e-test-beeps-minion-21dm:~$ sudo atop -r /var/log/atop/atop_20150614 -b 3:20 -C | grep "PID" -A 3 | head -3
PID SYSCPU USRCPU VGROW RGROW RDDSK WRDSK ST EXC S CPU CMD
11230 20.09s 2m29s 0K