Created
November 17, 2017 22:33
-
-
Save jbeda/3c54ddd9c25eaafb399b143f65b9c07d to your computer and use it in GitHub Desktop.
TGIK8s 017 notes
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
Things to cover: | |
* Installing heapster and what it does | |
* requests vs. limits, compressible vs. incompressible | |
* Running kuard without any limits, show memory in heapster | |
* Resource QoS: Guaranteed, Burstable, BestEffort | |
* [coming soon] Pod priority/preemption | |
* Quota | |
* LimitRange admission controller | |
Links: | |
* Main docs page on resources: https://kubernetes .io/docs/concepts/configuration/manage-compute-resources-container/ | |
* LimitRange - https://kubernetes.io/docs/tasks/administer-cluster/memory-default-namespace/ | |
* Quota - https://kubernetes.io/docs/tasks/administer-cluster/quota-memory-cpu-namespace/ | |
* Good blog post on QoS: https://medium.com/google-cloud/quality-of-service-class-qos-in-kubernetes-bb76a89eb2c6 | |
* Pod priority and preemption: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ | |
* Kubelet out of resource handling: https://kubernetes.io/docs/tasks/administer-cluster/out-of-resource/#node-oom-behavior | |
--- | |
# Install Heapster | |
# https://github.com/kubernetes/heapster/blob/master/docs/influxdb.md | |
git clone https://github.com/kubernetes/heapster.git | |
cd heapster | |
kubectl apply -f deploy/kube-config/influxdb/ | |
kubectl apply -f deploy/kube-config/rbac/heapster-rbac.yaml | |
# http://localhost:8001/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana:80/ | |
# If using dashboard, kill that pod to have it pick up that heapster is available right away. | |
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: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
labels: | |
run: kuard-g | |
name: kuard-g | |
spec: | |
replicas: 6 | |
selector: | |
matchLabels: | |
run: kuard-g | |
template: | |
metadata: | |
labels: | |
run: kuard-g | |
spec: | |
containers: | |
- image: gcr.io/kuar-demo/kuard-amd64:2 | |
name: kuard-g | |
imagePullPolicy: Always | |
resources: | |
limits: | |
memory: "2Gi" | |
cpu: "200m" | |
nodeSelector: | |
type: test |
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 +m | |
while : | |
do | |
kubectl port-forward $(kubectl get pod -l run=$1 -o jsonpath='{.items[0].metadata.name}') $2:8080 >&/dev/null & | |
TASK_PID=$! | |
sleep 10s | |
{ kill $TASK_PID && wait; }>& /dev/null | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment