pod-pod控制器-service-ingress

 学了很久的kubernetes,kubernetes 的核心东西主要是 pod, pod 控制器,Service , ingress.

pod:

  装载着容器container 

pod控制器:deployment , daemonset , RC ,RS 

  控制pod的副本数量,调度等

Service 

  为pod提供访问入口

        Service --->Pod (应用Label ,通过Service找到 pod )

Ingress :

  为从互联网访问提供入口,

  通过域名 ---> Service 的关联代理作用

  使用ingress主要分为两步,一是部署ingress controller , 二是创建规则

  1, Pod与 ingress的关系

    支持4,7层的负载均衡

  2,Ingress Controller

    要使用ingress ,要先部署ingress控制器

    ingress控制器主要是拉取规则

  3,  ingress 配置http , https访问

------

  Ingress实验

  (1)创建deployment , Pod , 用nginx镜像

    

    

  (2) 创建Service 

    

    

  (3) 部署 Ingress-controller , 创建ingress规则

    

    我们看到 ingress-controller 运行在了node-2上,node2的IP是192.168.60.92

   

    创建 ingress规则,把域名和Service 关联起来

    

    查看创建的 ingress规则

    

  (4)访问

    修改hosts ,或者在dns上设置域名指向

    

    

原文地址:https://www.cnblogs.com/li-tian-jun/p/11260781.html