========== Kubernetes ========== .. highlight:: console Reference --------- - `Red Hat Kubernetes Tutorial `__ - `kubernetes.io `__ Terms ----- .. image:: ../_files/kubernetes_terms.png :width: 800 :alt: Kubernetes Terms Configuration ------------- - Work with configuration: :: export KUBECONFIG=~/openshift-installer/gcp/auth/kubeconfig Namespace --------- - Create namespace (resource management): :: kubectl create namespace myspace - Setting namespace (in order to not specify in every single command): :: kubectl config set-context --current --namespace=myspace Or, with openshift (if running): :: oc project myspace Pods ---- - Create pod: :: cat < ReplicaSet ---------- - Create a ReplicaSet: :: cat <`__ - Get Deployments: :: kubectl get deployments - Describe Deployments: :: kubectl describe deployment Logs ---- - Get pod logs: :: kubectl logs stern http: paths: - path: / backend: serviceName: the-service servicePort: 80 EOF - Get Ingress: :: kubectl get ingress - Delete Ingress: :: kubectl delete ingress Ingress has a router/revproxy based on haproxy. - Expose Service: :: oc expose svc - Get exposed route: :: kubectl get route oc get route - Delete exposed route: :: kubectl delete route Blue/Green Deployments ---------------------- - Manage pods in service through labels: :: kubectl label pod -l app=mypython inservice=mypods kubectl label pod -l