Skip to content

Latest commit

 

History

History
124 lines (91 loc) · 3.34 KB

chapter-2-install-config-and-validate-12.md

File metadata and controls

124 lines (91 loc) · 3.34 KB

Table of Contents

Chapter 2: Install, Config and Validate (12%)

Install, Config and Validate

Binaries/Provision/Types

Command References

-- view addresses of master and services
$ kubectl cluster-info

-- show kubeconfig settings
$ kubectl config view

-- show all nodes details
$ kubectl describe nodes

-- show all pod details
$ kubectl describe pods

-- show all services
$ kubectl get services --all-namespaces

-- show all resources
$ kubectl api-resources -o wide

References and Further Study

Installing Master and Nodes

Kubernetes cluster can install in two ways

References and Further Study

Highly Available Cluster

References and Further Study

Secure Cluster

Command References

-- view the kubeconfig
$ cat .kube/config | more

-- view service account token
$ kubectl get secrets

References and Further Study

End-to-End Tests

For end-to-end test verify those checklist

  • Deployments can run
  • Pods can run
  • Pod can directly access
  • Logs can be collected
  • Command run from Pod
  • Services can provide access
  • Nodes are healthy
  • Pods are healthy

Command References

-- run a simple nginx deployements
$ kubectl run nginx --image=nginx

-- view current deployements
$ kubectl get deploy
-- lists the pods in the cluster
$ kubectl get pods

-- forward port 80 to 8081 on pod
$ kubectl port-forward nginx 8081:80

-- get a response from nginx pod
$ curl --head http://127.0.0.1:8081

-- get pods logs
$ kubectl logs nginx

-- run a command on the pod nginx
$ kubectl exec -t nginx -- nginx -v 

-- create a service using our deployment
$ kubectl expose deploy nginx --port 80 --type NodePort

-- list the services in the cluster
$ kubectl get services

-- get a response from a service
$ curl -I localhost:<node_port>

-- list node status
$ kubectl get nodes

-- get details info about node
$ kubectl describe nodes

-- get details info about pods
$ kubectl describe pods

References and Further Study

Table of Contents
Prev Chapter: Chapter 1: Core Concepts (19%)
Next Chapter: Chapter 3: Cluster (11%)