Manage kubernetes remotely / effectively / securely

Before you start...
It is assumed that you have a working Kubernetes cluster and have setup the kubernetes CLI. If you have not done so, please contact your system administrator for the same. It is assumed that you have the latest (1.9.3 at the time of this writing) cluster. If this is not the case, then the output will differ a little.
Tips and Tricks with CLI
Purpose / Command Expected outout
Services, Deployments, pods in one go
kubectl get svc,deployments,pods

svc/cloud        NodePort    10.111.53.220            81:31585/TCP     2d
svc/devops       NodePort    10.96.25.96              82:30214/TCP     2d
svc/kubernetes   ClusterIP   10.96.0.1                443/TCP          56d
svc/restserver   NodePort    10.99.209.71             8080:30330/TCP   15d
svc/ssl-cloud    NodePort    10.99.90.23              83:31242/TCP     2d
svc/ssl-devops   NodePort    10.111.113.254           84:30595/TCP     2d
svc/www          NodePort    10.99.49.77              80:31781/TCP     2d

NAME                                 DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deploy/mock-resetserver-deployment   1         1         1            1           15d
deploy/sites-deployment              1         1         1            1           2d

NAME                                             READY     STATUS    RESTARTS   AGE
po/mock-resetserver-deployment-85c949bf7-lsmq8   1/1       Running   0          5d
po/sites-deployment-7c9c6869dc-v7rnl             1/1       Running   0          2d
Get Pods
kubectl get pods --all-namespaces

NAMESPACE     NAME                                                    READY     STATUS    RESTARTS   AGE       IP              NODE
default       mock-resetserver-deployment-85c949bf7-lsmq8             1/1       Running   0          13h       10.244.10.234   ldn02
default       sites-deployment-7c9c6869dc-4k2qz                       1/1       Running   0          7h        10.244.6.74     bru03
kube-system   etcd-jas03                                              1/1       Running   4          51d       192.168.1.24    jas03
kube-system   kube-apiserver-jas03                                    1/1       Running   4          51d       192.168.1.24    jas03
Get Deployments
kubectl get deployments --all-namespaces

NAME                          DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
mock-resetserver-deployment   1         1         1            1           11d
sites-deployment              1         1         1            1           8h
Get Services
kubectl get svc --all-namespaces

NAMESPACE     NAME                      TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                          AGE
default       kubernetes                ClusterIP   10.96.0.1        none          443/TCP                          47d
default       www                       NodePort    10.111.37.176    none          80:30689/TCP                     1h
kube-system   tiller-deploy             ClusterIP   10.98.228.118    none          44134/TCP                        28d
Get name spaces
kubectl get ns

NAME          STATUS    AGE
blue          Active    47d
default       Active    49d
devops        Active    47d
green         Active    47d
integration   Active    47d
kube-public   Active    49d
kube-system   Active    49d
Get All Nodes
kubectl get nodes

 
NAME    STATUS    ROLES   AGE       VERSION   EXTERNAL-IP   OS-IMAGE                KERNEL-VERSION               CONTAINER-RUNTIME
bru01   Ready     none    45d       v1.9.3    none        CentOS Linux 7 (Core)   3.10.0-693.11.6.el7.x86_64   docker://1.12.6
bru02   Ready     none    45d       v1.9.3    none        CentOS Linux 7 (Core)   3.10.0-693.11.6.el7.x86_64   docker://1.12.6
bru03   Ready     none    45d       v1.9.3    none        CentOS Linux 7 (Core)   3.10.0-693.11.6.el7.x86_64   docker://1.12.6
ldn01   Ready     none    44d       v1.9.3    none        CentOS Linux 7 (Core)   3.10.0-693.11.6.el7.x86_64   docker://1.12.6
ldn02   Ready     none    44d       v1.9.3    none        CentOS Linux 7 (Core)   3.10.0-693.11.6.el7.x86_64   docker://1.12.6
ldn03   Ready     none    44d       v1.9.3    none        CentOS Linux 7 (Core)   3.10.0-693.11.6.el7.x86_64   docker://1.12.6
Get Supported API
kubectl api-versions

 
admissionregistration.k8s.io/v1beta1
apiextensions.k8s.io/v1beta1
apiregistration.k8s.io/v1beta1
apps/v1
apps/v1beta1
apps/v1beta2
authentication.k8s.io/v1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1
authorization.k8s.io/v1beta1
autoscaling/v1
autoscaling/v2beta1
batch/v1
batch/v1beta1
certificates.k8s.io/v1beta1
events.k8s.io/v1beta1
extensions/v1beta1
networking.k8s.io/v1
policy/v1beta1
rbac.authorization.k8s.io/v1
rbac.authorization.k8s.io/v1beta1
storage.k8s.io/v1
storage.k8s.io/v1beta1
v1
Get Persistent Volumes
kubectl get pv

 
NAME                         CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM                             STORAGECLASS   REASON    AGE
integration.search.storage   150Gi      RWO            Retain           Available                                                              24d
primary.jenkins.storage      150Gi      RWO            Retain           Bound       devops/primary.jenkins.claim                               83d
primary.postgres.storage     150Gi      RWO            Retain           Bound       devops/primary.postgres.claim                              83d
primary.sonar.storage        150Gi      RWO            Retain           Bound       devops/primary.sonar.claim                                 83d
prod.search.storage          150Gi      RWO            Retain           Available                                                              24d
secondary.jenkins.storage    150Gi      RWO            Retain           Bound       devops/secondary.jenkins.claim                             83d
secondary.postgres.storage   150Gi      RWO            Retain           Bound       devops/secondary.postgres.claim                            83d
secondary.sonar.storage      150Gi      RWO            Retain           Bound       devops/secondary.sonar.claim                               83d
Show all contexts
kubectl config get-contexts

 
CURRENT   NAME          CLUSTER                AUTHINFO           NAMESPACE
          all           kube.alacritysys.com   kubernetes-admin
          blue          kube.alacritysys.com   kubernetes-admin   blue
*         dev           kube.alacritysys.com   kubernetes-admin   default
          devops        kube.alacritysys.com   kubernetes-admin   devops
          green         kube.alacritysys.com   kubernetes-admin   green
          integration   kube.alacritysys.com   kubernetes-admin   integration
          public        kube.alacritysys.com   kubernetes-admin   kube-public
          system        kube.alacritysys.com   kubernetes-admin   kube-system
Switch between contexts (e.g dev)
kubectl config use-context dev

 
Switched to context "dev".
Insights in this section..
Developer's portal
For all those interested in developing and reading about technology and agile practices and techniques, we have a new Developer Portal..