Skip to content
Seb edited this page Nov 1, 2018 · 3 revisions

UseFull tips

https://daemonza.github.io/2017/02/13/kubernetes-nginx-ingress-controller/

https://blog.osones.com/kubernetes-ingress-controller-avec-traefik-et-lets-encrypt.html

https://github.com/kubernetes/ingress-nginx/blob/master/deploy/README.md

WORDPRESS KUBERNETES DPL

https://github.com/kubernetes/charts/tree/master/stable/wordpress/templates

https://kubernetes.io/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/

NGINX SECRET

kubectl create secret generic mysecret --from-file auth --namespace=monitoring

DEBUG EVENTS

kubectl get events -w

Disable swap

sudo sed -i.bak '/ swap / s/^(.*)$/#\1/g' /etc/fstab

Command

Cluster

Get specific resource

kubectl -n kube-system get deployment -o name | grep dashboard

delete specific resource

kubectl delete -n kube-system $(kubectl -n kube-system get secrets -o name | grep dashboard)

  • Get cluster info
kubectl cluster-info

Pods

  • Get pods and see on which node is running

kubectl get pods --all-namespaces -o wide

NameSpace

  • Create namespace
kubectl create namespace sock-shop
  • Remove namespace
kubectl delete namespace sock-shop
  • Get pods by namespace
kubectl get pods -n sock-shop

See logs

 journalctl -u kubelet -f

Configuration

cat /etc/docker/daemon.json

{
  "exec-opts": ["native.cgroupdriver=cgroupfs"]
}

Get Certificate

In /etc/kubernetes/admin.conf , get the client-certificate-data lets say CERT.

export ca=CERT
echo $ca |  base64 -d > toto.crt
Clone this wiki locally