K8s 的笔记

 

查看版本:


# kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.1", GitCommit:"7879fc12a63337efff607952a323df90cdc7a335", GitTreeState:"clean", BuildDate:"2020-04-08T17:38:50Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.1", GitCommit:"7879fc12a63337efff607952a323df90cdc7a335", GitTreeState:"clean", BuildDate:"2020-04-08T17:30:47Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}


# kubectl get nodes
NAME    STATUS   ROLES    AGE     VERSION
c7h01   Ready    master   10m     v1.18.1
c7h02   Ready    <none>   4m44s   v1.22.0
c7h03   Ready    <none>   4m11s   v1.22.0


# kubectl get --help

# kubectl run kubernetes-bootcamp --image=jocatalin/kubernetes-bootcamp:v1 --port=8080

# kubectl get deployments
No resources found in default namespace.
[root@c7h01 ~]# kubectl get deployments
No resources found in default namespace.
[root@c7h01 ~]# kubectl get deployments --all-namespaces
NAMESPACE     NAME      READY   UP-TO-DATE   AVAILABLE   AGE
kube-system   coredns   2/2     2            2           14m
[root@c7h01 ~]# kubectl get deployments --namespace=kube-system
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
coredns   2/2     2            2           14m

# kubectl get pods
NAME                  READY   STATUS    RESTARTS   AGE
kubernetes-bootcamp   1/1     Running   0          2m38s


EOF