kubernetes核心概念总结
发布日期:2021-05-10 01:30:34 浏览次数:14 分类:精选文章

本文共 5796 字,大约阅读时间需要 19 分钟。

Kubernetes���������������������������

1. Master������������

master������������������������������������������������

  • APIServer���������������������Kubernetes���RESTful API������������������������������������������������������������������������������������������������APIServer���������������������etcd���
  • Scheduler������������Pod������������������Node������Scheduler������������Pod���������������������Node������������������Pod������������Node������������
  • Controller Manager������������������������������������������������������������������������������������������APIServer������Pod������Controller Manager������������Pod������������
  • Etcd���Kubernetes���������������������������������������������������������������������������������Restful API���������������������

2. Node������������

������Node���������������������������������������

  • Kubelet���Node���������������������agent���������������Node���������������������������Pod���������������������������
  • Kube-proxy���������������������������������������������������������etcd������service���endpoint������������������������������������������Pod������������������������Round Robin������������������������
  • Runtime������������������������������������������Docker���rkt���������������

3. Kubernetes������/������������

Kubernetes���������������������������������Pod���Replication Controller���Service������

3.1 Pod

Pod���Kubernetes���������������������������������������������������Pod������������������������������������������������������������������Pod���������������������������������������������Pod���������������������������������������������������������������������������������

Pod������������

  • ������Pod���
    $ kubectl create -f xxx.yaml
  • ������Pod���
    $ kubectl get pod yourPodName$ kubectl describe pod yourPodName
  • ������Pod���
    $ kubectl delete pod yourPodName
  • ������Pod���
    $ kubectl replace /path/to/yourNewYaml.yaml

Pod������������������

  • Always������������������������������
  • Never������������������������
  • IfNotPresent������������������������������������

Pod������

  • ���������������spec -> containers -> command
  • ���������������spec -> containers -> env -> name/value
  • ���������������spec -> containers -> ports -> containerPort/protocol/hostIP/hostPort
  • ���������������spec -> hostNetwork=true
  • ������������������spec -> containers -> volumeMounts -> mountPath
  • ������������������������Always���������OnFailure���Never

4. Replication Controller���RC���

RC���Kubernetes������������������������������������������������Pod������������������������������������������RC������Label������Pod������������������������������������������������

4.1 RC���Pod������

RC���Pod������������Label���������Pod������������������RC���������������Label���Label���������������������������������������������������������������������RC������������������Pod���������

4.2 RC������

  • ���������������������������Pod������
  • ���������������������������Pod������
  • ���������������������������������������������������������
  • ������������������������������������������

5. Service

Service������������������������������������������IP���������������������Pod������������������Service���������������������������������������������IP������������������������������������������NodePort���LoadBalancer���Ingress���

5.1 Service������

  • Service���������IP���Kubernetes���������������kube-proxy���������������
  • Service������������������������������������������������������IP������������������
  • Service���������������������������������DNS������������������������������������������

5.2 Service������������

  • NodePort������������Node������������������
  • LoadBalancer���������������������������������
  • Ingress���������HTTP���������������������

5.3 Service������������

  • PersistentVolume Claim������������������������������������������Kubernetes���������������������������
  • Secret��������������������������������������������� hoop

6. Deployment

Deployment���������Replication Controller������������������������������������������������������������������������������������

  • ���������������������������Pod������
  • ������/���������������������������
  • ���������������������������Pod������
  • ���������������������������������������������

6.1 ������������

  • ������Deployment���
    apiVersion: extensions/v1beta1kind: Deploymentmetadata: name: nginx deploymentspec:   replicas: 3  template:     metadata: labels: app: nginx    spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80
  • ���������������������
    $ kubectl set image deployment/nginx-deployment nginx=nginx:1.9

7. Volume������������������

Kubernetes������Volume������������Pod������������������������������������������

  • EmptyDir���������������������������������
  • HostPath������������������������������
  • GCE Persistent Disk���������������������������
  • NFS���������������������
  • Persistent Volume Claim���������������������������

7.1 ���������������������

  • EmptyDir���HostPath���������������������������
  • Network Volume������������������������������NFS���GlusterFS���
  • Persistent Volume Claim������������������������������������������������

8. Pet Sets-StatefulSet

Pet Set������������������������������������������������������Pod���������������������������������������������������������������������������������Zookeeper������

8.1 Pet Set������

  • ������Pod������������������������������������
  • Pod���������������������������������������������
  • ������������������������������������������������������������

9. ConfigMap

ConfigMap������������������������������������������������������������������������ConfigMap���������������������������������������������������������������

10. Horizontal Pod Autoscaler

Horizontal Pod Autoscaler������������Pod���CPU������������������������������Pod���������������������������������������������

���������������Kubernetes������master���node���Service���Deployment���Pet Set���ConfigMap������������������������������������������������������������������

上一篇:单元测试系列:Mock工具之Mockito实战
下一篇:Docker容器开机自动启动(在宿主机重启后或者Docker服务重启后)

发表评论

最新留言

表示我来过!
[***.240.166.169]2025年04月12日 10时24分43秒