Skip to content

Instantly share code, notes, and snippets.

@webwurst
Last active September 17, 2016 11:48
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save webwurst/ead77eaa9adce2f194421609adb2707e to your computer and use it in GitHub Desktop.
Save webwurst/ead77eaa9adce2f194421609adb2707e to your computer and use it in GitHub Desktop.

Kubernetes Demo

worked for me yesterday (tm)

Also see:

From scratch

minikube start --vm-driver kvm --memory 2048

# some workarounds
minikube ssh
sudo sysctl -w vm.max_map_count=262144
cat /proc/sys/vm/max_map_count
sudo sh -c "echo \"EXTRA_ARGS='--label provider=kvm --log-opt labels=io.kubernetes.container.hash,io.kubernetes.container.name,io.kubernetes.pod.name,io.kubernetes.pod.namespace,io.kubernetes.pod.uid'\" >> /var/lib/boot2docker/profile"
sudo /etc/init.d/docker restart

minikube dashboard
kubectl create namespace monitoring
kubectl --namespace monitoring create \
  --filename https://raw.githubusercontent.com/giantswarm/kubernetes-prometheus/master/manifests-all.yaml

kubectl create namespace logging
kubectl --namespace logging create \
  --filename https://raw.githubusercontent.com/giantswarm/kubernetes-elastic-stack/master/manifests-all.yaml

minikube service --namespace monitoring prometheus # /target
minikube service --namespace monitoring grafana
minikube service --namespace logging kibana # filebeat-* / @timestamp # /app/kibana#/discover
kubectl create namespace thux
kubectl --namespace thux create \
  --filename https://raw.githubusercontent.com/giantswarm/twitter-hot-urls-example/master/manifests-all.yaml

# see https://github.com/giantswarm/twitter-hot-urls-example/blob/master/KUBERNETES.md#creating-the-twitter-api-secrets-manifest
kubectl --namespace thux create --filename \
  ~/Development/github.com/giantswarm/twitter-hot-urls-example/_secrets-local/twitter-api-secret.yaml
  
kubectl --namespace thux scale deployments/tracker --replicas 0
kubectl --namespace thux scale deployments/resolver --replicas 3

For the custom metrics see:

reloading/restarting components

because of missing persistancy

kubectl --namespace monitoring delete jobs/grafana-import-dashboards
kubectl --namespace monitoring create --filename \
  https://raw.githubusercontent.com/giantswarm/kubernetes-prometheus/master/manifests/grafana-import-dashboards-job.yaml

kubectl --namespace thux delete jobs/grafana-import-dashboards
kubectl --namespace thux create --filename \
  https://raw.githubusercontent.com/giantswarm/twitter-hot-urls-example/master/manifests/grafana-import-dashboards-job.yaml
kubectl --namespace logging scale deployment/elasticsearch --replicas 0
kubectl --namespace logging scale deployment/elasticsearch --replicas 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment