zoukankan      html  css  js  c++  java
  • kubernete yaml设置

      each  configuration file has 3 parts

     apiversion

    kind

    然后是:

    1) metadata

    2)  specification

    3)  status(这个是kubernete自动生成的)

    如果kubernete发现status和spec不一样,就进行self healing

    attributes of "spec" are specific to the kind

    Layers of Abstraction:

    template: 

    template also has its own 'metadata' and 'spec' section

    thsese configuration applies to a pod

    blueprint for a pod

    label and selectors:

    the way connection is established is using labels  andd selectors

    metadata part contains labels

    sepecification part contains selectors

     在metadata中为一个component 比如deployment或者pod 一个key-value键值对

    在这个例子是 app: nginx

    这个label定义了这个component

    然后pod会得到这个蓝图

    we tell the deployment to connect or match all the labels with app:nginx

    to create the connection

    so this way deployment will know which pods belong to it

    deployment有他自己的label

    app:nginx

    these two label are used by service selector

    because service must know which pods are registerd with it

    that connection is made through the selector of the label

    个人理解...

    ports:

    service has ports

     deployment has ports

    这两个是match的

    service的targetPort和deployment的containerport是match的

    service有自己的port

    service的port is where the service is accessiable at

    if other service sends a request  to nginx service here , it needs to send on port 80

    the service need to know which service pod it should  forward the request 

    that is the container port

     how can we valid the service has the right ports?

    kubectl describe service nginx-service

     注意看end point

    kuctl get pod -o wide    

    now you can see more columns there

    如果想看status:

    kubectl get deployment nginx-deployment -o yaml 

    kubectl get deployment nginx-deployment -o yaml  > nginx-deployment-result.yaml

     对比一下,前面的基本都是一样的

    status中是kubernete自己添加上去的

  • 相关阅读:
    最通俗易懂的技术解读
    laya学习查漏补缺
    vue+webpack实现懒加载的三种方式
    web安全防范策略
    http/1.x、http/2与https的区别、以及http3
    设备检测
    移动端调试利器------微信开源项目
    SqlConnection 在linux 连接 mssql 挂起的问题。
    rabbitmq 启用日志跟踪
    使用脚本把.net core 程序部署到 docker 容器中
  • 原文地址:https://www.cnblogs.com/eret9616/p/14577670.html
Copyright © 2011-2022 走看看