This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ http 127.0.0.1:8001/apis/example.com | |
HTTP/1.1 200 OK | |
Content-Length: 223 | |
Content-Type: application/json | |
Date: Wed, 09 Aug 2017 09:25:44 GMT | |
{ | |
"apiVersion": "v1", | |
"kind": "APIGroup", | |
"name": "example.com", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ kubectl get crd databases.example.com -o yaml | |
apiVersion: apiextensions.k8s.io/v1beta1 | |
kind: CustomResourceDefinition | |
metadata: | |
creationTimestamp: 2017-08-09T09:21:43Z | |
name: databases.example.com | |
resourceVersion: "792" | |
selfLink: /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/databases.example.com | |
uid: 28c94a05-7ce4-11e7-888c-42010a9a0fd5 | |
spec: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ http localhost:8080/apis/extensions/v1beta1/namespaces/api-server-deepdive/horizontalpodautoscalers/rcex > hpa-v1beta1.json | |
$ http localhost:8080/apis/autoscaling/v1/namespaces/api-server-deepdive/horizontalpodautoscalers/rcex > hpa-v1.json | |
$ diff -u hpa-v1beta1.json hpa-v1.json | |
{ | |
"kind": "HorizontalPodAutoscaler", | |
- "apiVersion": "extensions/v1beta1", | |
+ "apiVersion": "autoscaling/v1", | |
"metadata": { | |
"name": "rcex", | |
"namespace": "api-server-deepdive", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ kubectl proxy --port=8080 & | |
$ kubectl create -f https://raw.githubusercontent.com/mhausenblas/kbe/master/specs/rcs/rc.yaml | |
kubectl autoscale rc rcex --min=2 --max=5 --cpu-percent=80 | |
kubectl get hpa/rcex -o yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat pod.yaml | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: webserver | |
spec: | |
containers: | |
- name: nginx | |
image: tomaskral/nonroot-nginx | |
ports: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ kube-apiserver -h | |
... | |
--etcd-cafile string SSL Certificate Authority file used to secure etcd communication. | |
--etcd-certfile string SSL certification file used to secure etcd communication. | |
--etcd-keyfile string SSL key file used to secure etcd communication. | |
... | |
--etcd-quorum-read If true, enable quorum read. | |
--etcd-servers List of etcd servers to connect with (scheme://ip:port) … | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker run --rm -d -p 2379:2379 \ | |
--name test-etcd3 quay.io/coreos/etcd:v3.1.0 /usr/local/bin/etcd \ | |
--advertise-client-urls http://0.0.0.0:2379 --listen-client-urls http://0.0.0.0:2379 | |
$ curl localhost:2379/v2/keys/foo -XPUT -d value="some value" | |
$ curl localhost:2379/v2/keys/bar/this -XPUT -d value=42 | |
$ curl localhost:2379/v2/keys/bar/that -XPUT -d value=take | |
$ http localhost:2379/v2/keys/?recursive=true | |
HTTP/1.1 200 OK | |
Content-Length: 327 | |
Content-Type: application/json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set these in your environment/profile (NOT HERE) | |
AWS_ACCESS_KEY="" | |
AWS_SECRET_KEY="" | |
function s3get { | |
#helper functions | |
function fail { echo "$1" > /dev/stderr; exit 1; } | |
#dependency check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: webserver | |
spec: | |
containers: | |
- name: nginx | |
image: nginx:1.9 | |
ports: | |
- containerPort: 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl http://127.0.0.1:8080/apis/batch/v2alpha1 | |
{ | |
"kind": "APIResourceList", | |
"apiVersion": "v1", | |
"groupVersion": "batch/v2alpha1", | |
"resources": [ | |
{ | |
"name": "cronjobs", | |
"namespaced": true, | |
"kind": "CronJob" |