Skip to content

Instantly share code, notes, and snippets.

@pwittrock
Last active March 15, 2016 19:52
Show Gist options
  • Save pwittrock/3c68f00a2e401caf5b1f to your computer and use it in GitHub Desktop.
Save pwittrock/3c68f00a2e401caf5b1f to your computer and use it in GitHub Desktop.
Pods
curl http://127.0.0.1:10255/stats/summary
curl -X "POST" -d '{"containerName":"/","num_stats":1,"subcontainers":true}' localhost:10255/stats/container
curl -X "POST" -d '{"containerName":"/","num_stats":1,"subcontainers":true}' localhost:10255/stats/container | xclip -sel clip
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
kube-apiserver --v 2 --logtostderr --log_dir ./ --etcd-servers http://127.0.0.1:4001 --insecure-bind-address 0.0.0.0 --service-cluster-ip-range 10.0.0.1/24 --kubelet-port 10250
kubelet --v 2 --logtostderr --log_dir ./ --api-servers http://127.0.0.1:8080 --address 0.0.0.0 --port 10250 --hostname-override nodename --nosystemd=true
apiVersion: v1
kind: Pod
metadata:
name: test-pd-2
spec:
nodeName: nodename
containers:
- image: gcr.io/google_containers/busybox
name: test-stats-1
command:
- sh
- -c
- echo 'Hello World' | tee ~/file | tee -a ~/file | tee /test-empty-dir | sleep 3600
volumeMounts:
- mountPath: /test-empty-dir
name: test-empty-dir
- mountPath: /test-host-parth
name: test-host-path
volumes:
- name: test-empty-dir
emptyDir: {}
- name: test-host-path
hostPath:
path: /usr/local/google
apiVersion: v1
kind: Pod
metadata:
name: test-pd-2
spec:
containers:
- image: gcr.io/google_containers/busybox
name: test-stats-1
command:
- sh
- -c
- echo 'Hello World' | tee ~/file | tee -a ~/file | tee /test-empty-dir | sleep 3600
volumeMounts:
- mountPath: /test-empty-dir
name: test-empty-dir
- mountPath: /test-host-parth
name: test-host-path
volumes:
- name: test-empty-dir
emptyDir: {}
- name: test-host-path
hostPath:
path: /usr/local/google
apiVersion: v1
kind: Pod
metadata:
name: test-pd-3
spec:
containers:
- image: nginx
name: test-nginx
volumeMounts:
- mountPath: /test-empty-dir
name: test-empty-dir
- mountPath: /test-host-parth
name: test-host-path
volumes:
- name: test-empty-dir
emptyDir: {}
- name: test-host-path
hostPath:
path: /usr/local/google
apiVersion: v1
kind: Pod
metadata:
name: test-emptydir
spec:
containers:
- image: gcr.io/google_containers/busybox
command:
- sh
- -c
- "while true; do echo 'hello world' >> /test-empty-dir/f; sleep 1; done"
name: hello-world
volumeMounts:
- mountPath: /test-empty-dir
name: test-empty-dir
- mountPath: /test-host-path
name: test-host-path
- mountPath: /secret
name: test-secret
volumes:
- name: test-empty-dir
emptyDir: {}
- name: test-host-path
hostPath:
path: /home
apiVersion: v1
kind: Pod
metadata:
name: test-emptydir
spec:
containers:
- image: gcr.io/google_containers/busybox
command:
- sh
- -c
- "while true; do echo 'hello world' >> /test-empty-dir/f; sleep 1; done"
name: hello-world
volumeMounts:
- mountPath: /test-empty-dir
name: test-empty-dir
- mountPath: /test-host-path
name: test-host-path
- mountPath: /secret
name: test-secret
volumes:
- name: test-empty-dir
emptyDir: {}
- name: test-host-path
hostPath:
path: /home
- name: test-secret
secret:
secretName: mysecret
apiVersion: v1
kind: Secret
metadata:
name: mysecret
type: Opaque
data:
password: dmFsdWUtMg0K
username: dmFsdWUtMQ0K
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment