k8s 容器编排(高级版)

* k8s :容器编排
 控制平面:
   	API Server :6443
   		用户认证:双向认证
   	Scheduler
   Controller
  Node: kube-proxy (node启动pod生成一个iptables规则,用kube-proxy代替) 
 Pod,Pod Controller,Service
    Pod Controller:
      Deployment -> nginx-deploy -> ngin Pod
      Service -> nginx-svc
[root@k8s1 kubernetes]# kubectl get pods -n kube-system  -o wide
NAME                                   READY   STATUS    RESTARTS   AGE     IP              NODE   NOMINATED NODE   READINESS GATES
coredns-5c98db65d4-hzzqj               1/1     Running   0          2d17h   10.244.0.3      k8s1   <none>           <none>
coredns-5c98db65d4-w9wqz               1/1     Running   0          2d17h   10.244.0.2      k8s1   <none>           <none>
etcd-k8s1                              1/1     Running   0          2d17h   172.31.100.20   k8s1   <none>           <none>
kube-apiserver-k8s1                    1/1     Running   0          2d17h   172.31.100.20   k8s1   <none>           <none>
kube-controller-manager-k8s1           1/1     Running   2          2d17h   172.31.100.20   k8s1   <none>           <none>
kube-flannel-ds-amd64-6sh24            1/1     Running   0          2d17h   172.31.100.21   k8s2   <none>           <none>
kube-flannel-ds-amd64-7zv5k            1/1     Running   0          2d17h   172.31.100.20   k8s1   <none>           <none>
kube-proxy-667hw                       1/1     Running   0          2d17h   172.31.100.20   k8s1   <none>           <none>
kube-proxy-dgshk                       1/1     Running   0          2d17h   172.31.100.21   k8s2   <none>           <none>
kube-scheduler-k8s1                    1/1     Running   1          2d17h   172.31.100.20   k8s1   <none>           <none>
kubernetes-dashboard-5c7687cf8-mqkmb   1/1     Running   0          2d17h   10.244.1.2      k8s2   <none>           <none>
[root@k8s1 kubernetes]# kubectl api-resources
NAME                              SHORTNAMES   APIGROUP                       NAMESPACED   KIND
bindings                                                                      true         Binding
componentstatuses                 cs                                          false        ComponentStatus
configmaps                        cm                                          true         ConfigMap
endpoints                         ep                                          true         Endpoints
events                            ev                                          true         Event
limitranges                       limits                                      true         LimitRange
namespaces                        ns                                          false        Namespace
nodes                             no                                          false        Node
persistentvolumeclaims            pvc                                         true         PersistentVolumeClaim
persistentvolumes                 pv                                          false        PersistentVolume
pods                              po                                          true         Pod
podtemplates                                                                  true         PodTemplate
replicationcontrollers            rc                                          true         ReplicationController
resourcequotas                    quota                                       true         ResourceQuota
secrets                                                                       true         Secret
serviceaccounts                   sa                                          true         ServiceAccount
services                          svc                                         true         Service
mutatingwebhookconfigurations                  admissionregistration.k8s.io   false        MutatingWebhookConfiguration
validatingwebhookconfigurations                admissionregistration.k8s.io   false        ValidatingWebhookConfiguration
customresourcedefinitions         crd,crds     apiextensions.k8s.io           false        CustomResourceDefinition
apiservices                                    apiregistration.k8s.io         false        APIService
controllerrevisions                            apps                           true         ControllerRevision
daemonsets                        ds           apps                           true         DaemonSet
deployments                       deploy       apps                           true         Deployment
replicasets                       rs           apps                           true         ReplicaSet
statefulsets                      sts          apps                           true         StatefulSet
tokenreviews                                   authentication.k8s.io          false        TokenReview
localsubjectaccessreviews                      authorization.k8s.io           true         LocalSubjectAccessReview
selfsubjectaccessreviews                       authorization.k8s.io           false        SelfSubjectAccessReview
selfsubjectrulesreviews                        authorization.k8s.io           false        SelfSubjectRulesReview
subjectaccessreviews                           authorization.k8s.io           false        SubjectAccessReview
horizontalpodautoscalers          hpa          autoscaling                    true         HorizontalPodAutoscaler
cronjobs                          cj           batch                          true         CronJob
jobs                                           batch                          true         Job
certificatesigningrequests        csr          certificates.k8s.io            false        CertificateSigningRequest
leases                                         coordination.k8s.io            true         Lease
events                            ev           events.k8s.io                  true         Event
daemonsets                        ds           extensions                     true         DaemonSet
deployments                       deploy       extensions                     true         Deployment
ingresses                         ing          extensions                     true         Ingress
networkpolicies                   netpol       extensions                     true         NetworkPolicy
podsecuritypolicies               psp          extensions                     false        PodSecurityPolicy
replicasets                       rs           extensions                     true         ReplicaSet
ingresses                         ing          networking.k8s.io              true         Ingress
networkpolicies                   netpol       networking.k8s.io              true         NetworkPolicy
runtimeclasses                                 node.k8s.io                    false        RuntimeClass
poddisruptionbudgets              pdb          policy                         true         PodDisruptionBudget
podsecuritypolicies               psp          policy                         false        PodSecurityPolicy
clusterrolebindings                            rbac.authorization.k8s.io      false        ClusterRoleBinding
clusterroles                                   rbac.authorization.k8s.io      false        ClusterRole
rolebindings                                   rbac.authorization.k8s.io      true         RoleBinding
roles                                          rbac.authorization.k8s.io      true         Role
priorityclasses                   pc           scheduling.k8s.io              false        PriorityClass
csidrivers                                     storage.k8s.io                 false        CSIDriver
csinodes                                       storage.k8s.io                 false        CSINode
storageclasses                    sc           storage.k8s.io                 false        StorageClass
volumeattachments                              storage.k8s.io                 false        VolumeAttachment
[root@k8s1 kubernetes]# kubectl get deploy
No resources found.
[root@k8s1 kubernetes]# kubectl get deploy -n kube-system
NAME                   READY   UP-TO-DATE   AVAILABLE   AGE
coredns                2/2     2            2           2d18h
kubernetes-dashboard   1/1     1            1           2d17h
[root@k8s1 kubernetes]# kubectl get ns/default -o yaml
apiVersion: v1
kind: Namespace
metadata:
  creationTimestamp: "2020-04-27T09:17:03Z"
  name: default
  resourceVersion: "150"
  selfLink: /api/v1/namespaces/default
  uid: c89814ba-d6c1-41ff-8635-e08840686dd5
spec:
  finalizers:
  - kubernetes
status:
  phase: Active
[root@k8s1 kubernetes]# kubectl describe ns/default 
Name:         default
Labels:       <none>
Annotations:  <none>
Status:       Active

No resource quota.

No resource limits.

你可能感兴趣的:(k8s)