Skip to content

Instantly share code, notes, and snippets.

View bharatmicrosystems's full-sized avatar
😀

Gaurav Agarwal bharatmicrosystems

😀
View GitHub Profile
$ hey -z 30s -c 50 http://helloworld-go.default.34.121.106.103.xip.io
Average: 0.1222 secs
Requests/sec: 408.3187
Total data: 159822 bytes
Size/request: 13 bytes
Response time histogram:
0.103 [1] |
0.444 [12243] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.785 [0] |
1.126 [0] |
$ kn service create helloworld-go --image gcr.io/knative-samples/helloworld-go --env TARGET="World" --annotation autoscaling.knative.dev/target=10
Creating service 'helloworld-go' in namespace 'default':
0.171s Configuration "helloworld-go" is waiting for a Revision to become ready.
6.260s ...
6.324s Ingress has not yet been reconciled.
6.496s Waiting for load balancer to be ready
6.637s Ready to serve.
Service 'helloworld-go' created to latest revision 'helloworld-go-zglmv-1' is available at URL:
http://helloworld-go.default.34.71.125.175.xip.io
$ kubectl scale deployment nginx --replicas 6
deployment.apps/nginx scaled
$ kubectl get pod -o wide| grep nginx
nginx-9cddb4b5-6ckw9 1/1 Running 0 2m37s 10.60.2.23 gke-cluster-1-default-pool-bf356567-mrnh
nginx-9cddb4b5-8nkwh 1/1 Running 0 2m39s 10.60.1.14 gke-cluster-1-default-pool-f41b1aed-5n51
nginx-9cddb4b5-9r75f 1/1 Running 0 3s 10.60.0.25 gke-cluster-1-default-pool-b54224b7-zwrp
nginx-9cddb4b5-gqmbc 1/1 Running 0 3s 10.60.2.24 gke-cluster-1-default-pool-bf356567-mrnh
nginx-9cddb4b5-k2s2n 1/1 Running 0 2m36s 10.60.1.15 gke-cluster-1-default-pool-f41b1aed-5n51
nginx-9cddb4b5-z5zmz 1/1 Running 0 2m39s 10.60.0.24 gke-cluster-1-default-pool-b54224b7-zwrp
$ kubectl get pod -o wide| grep nginx
nginx-9cddb4b5-6ckw9 1/1 Running 0 8s 10.60.2.23 gke-cluster-1-default-pool-bf356567-mrnh
nginx-9cddb4b5-8nkwh 1/1 Running 0 10s 10.60.1.14 gke-cluster-1-default-pool-f41b1aed-5n51
nginx-9cddb4b5-k2s2n 1/1 Running 0 7s 10.60.1.15 gke-cluster-1-default-pool-f41b1aed-5n51
nginx-9cddb4b5-z5zmz 1/1 Running 0 10s 10.60.0.24 gke-cluster-1-default-pool-b54224b7-zwrp
$ cat <<EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
spec:
replicas: 4
selector:
$ kubectl uncordon gke-cluster-1-default-pool-bf356567-mrnh
node/gke-cluster-1-default-pool-bf356567-mrnh uncordoned
$ kubectl get pod|grep redis
redis-cache-6bc7d5b59d-7jp5k 1/1 Running 0 3m34s
redis-cache-6bc7d5b59d-lxt4z 1/1 Running 0 3m34s
redis-cache-6bc7d5b59d-x2t4h 1/1 Running 0 3m34s
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
gke-cluster-1-default-pool-b54224b7-zwrp Ready <none> 73m v1.16.11-gke.5
gke-cluster-1-default-pool-bf356567-mrnh Ready,SchedulingDisabled <none> 73m v1.16.11-gke.5
gke-cluster-1-default-pool-f41b1aed-5n51 Ready <none> 72m v1.16.11-gke.5
$ kubectl get pod|grep redis
redis-cache-6bc7d5b59d-7jp5k 1/1 Running 0 58s
redis-cache-6bc7d5b59d-lxt4z 0/1 Pending 0 58s
redis-cache-6bc7d5b59d-x2t4h 1/1 Running 0 58s
$ cat <<EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-cache
spec:
selector:
matchLabels:
app: store
replicas: 3
$ kubectl get pod -o wide
NAME READY STATUS RESTARTS AGE IP NODE
nginx-5ffb5df89f-4hx2v 1/1 Running 0 4m42s 10.60.0.22 gke-cluster-1-default-pool-b54224b7-zwrp
nginx-5ffb5df89f-cx65l 1/1 Running 0 7m 10.60.1.12 gke-cluster-1-default-pool-f41b1aed-5n51
nginx-5ffb5df89f-mxw7m 1/1 Running 0 9m41s 10.60.1.11 gke-cluster-1-default-pool-f41b1aed-5n51
nginx-5ffb5df89f-qtkcj 1/1 Running 0 4m53s 10.60.0.15 gke-cluster-1-default-pool-b54224b7-zwrp