• 在POD的ENV中添加POD的信息


    主要用到的参数:

    - name POD_NAME

       volumeFrom:

           fieldRef:

               fieldPath:   metadata.name

    - name: POD_IP

      volumeFrom:

         fieldRef:

             fieldPath: status.podIP

      

    eg:

    apiVersion: v1
    kind: Pod
    metadata:
      name: downward
    spec:
      containers:
      - name: main
        image: busybox
        command: ["sleep", "9999999"]
        resources:
         requests:
           cpu: 150m
           memory: 1OOMi
         limits:
           cpu: 300m
           memory: 400Mi
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: SERVICE_ACCOUNT
          valueFrom:
            fieldRef:
              fieldPath: spec.serviceAccountName
        - name: CONTAINER_CPU_REQUEST_MILLICORES
          valueFrom:
          resourceFieldRef:
            resource: requests.cpu
            divisor: 1m
        - name: CONTAINER_MEMORY_LIMIT_KIBIBYTES
          valueFrom:
             resourceFieldRef:
               resource: limits.memory
               divisor: 1Ki
     
    ---小米
  • 相关阅读:
    关于FPGA设计16位乘法器的两…
    const int *pi与int&nbs…
    HTML5基础学习
    html5基础!!
    正确分析结构使用正确的HTML标签。CSS样式写一起。
    开发经验以及方法
    布局设计
    position定位
    浏览器的兼容性
    float浮动的世界
  • 原文地址:https://www.cnblogs.com/mxdboke/p/15807099.html
Copyright © 2020-2023  润新知