Sidecar v1.3.0 自定义资源定义

规范架构

SidecarSpec 用于指定边车的预期状态。

additionalVolumes:
- awsElasticBlockStore:
    fsType: string
    partition: integer
    readOnly: boolean
    volumeID: string
  azureDisk:
    cachingMode: string
    diskName: string
    diskURI: string
    fsType: string
    kind: string
    readOnly: boolean
  azureFile:
    readOnly: boolean
    secretName: string
    shareName: string
  cephfs:
    monitors:
    - string
    path: string
    readOnly: boolean
    secretFile: string
    secretRef:
      name: string
    user: string
  cinder:
    fsType: string
    readOnly: boolean
    secretRef:
      name: string
    volumeID: string
  configMap:
    defaultMode: integer
    items:
    - key: string
      mode: integer
      path: string
    name: string
    optional: boolean
  csi:
    driver: string
    fsType: string
    nodePublishSecretRef:
      name: string
    readOnly: boolean
    volumeAttributes:
  downwardAPI:
    defaultMode: integer
    items:
    - fieldRef:
        apiVersion: string
        fieldPath: string
      mode: integer
      path: string
      resourceFieldRef:
        containerName: string
        divisor: integer or string
        resources: string
  emptyDir:
    medium: string
    sizeLimit: integer or string
  ephemeral:
    volumeClaimTemplate:
      metadata:
      spec:
        accessModes:
        - string
        dataSource:
          apiGroup: string
          kind: string
          name: string
        dataSourceRef:
          apiGroup: string
          kind: string
          name: string
          namespace: string
        resources:
          claims:
          - name: string
          limits: integer or string
          requests: integer or string
        selector:
          matchExpressions:
          - key: string
            operator: string
            values: string
          matchLabels:
        storageClassName: string
        volumeMode: string
        volumeName: string
  fc:
    fsType: string
    lun: integer
    readOnly: boolean
    targetWWNs:
    - string
    wwids:
    - string
  flexVolume:
    driver: string
    fsType: string
    options:
    readOnly: boolean
    secretRef:
      name: string
  flocker:
    datasetName: string
    datasetUUID: string
  gcePersistentDisk:
    fsType: string
    partition: integer
    pdName: string
    readOnly: boolean
  gitRepo:
    directory: string
    repository: string
    revision: string
  glusterfs:
    endpoints: string
    path: string
    readOnly: boolean
  hostPath:
    path: string
    type: string
  iscsi:
    chapAuthDiscovery: boolean
    chapAuthSession: boolean
    fsType: string
    initiatorName: string
    iqn: string
    iscsiInterface: string
    lun: integer
    portals:
    - string
    readOnly: boolean
    secretRef:
      name: string
  name: string
  nfs:
    path: string
    readOnly: boolean
    server: string
  persistentVolumeClaim:
    claimName: string
    readOnly: boolean
  photonPersistentDisk:
    fsType: string
    pdID: string
  portworxVolume:
    fsType: string
    readOnly: boolean
    volumeID: string
  projected:
    defaultMode: integer
    sources:
    - configMap:
        items:
        - key: string
          mode: integer
          path: string
        name: string
        optional: boolean
      downwardAPI:
        items:
        - fieldRef:
            apiVersion: string
            fieldPath: string
          mode: integer
          path: string
          resourceFieldRef:
            containerName: string
            divisor: integer or string
            resource: string
      secret:
        items:
        - key: string
          mode: integer
          path: string
        name: string
        optional: boolean
      serviceAccountToken:
        audience: string
        expirationSeconds: integer
        path: string
  quobyte:
    group: string
    readOnly: boolean
    registry: string
    tenant: string
    user: string
    volume: string
  rbd:
    fsType: string
    image: string
    keyring: string
    monitors:
    - string
    pool: string
    readOnly: boolean
    secretRef:
      name: string
    user: string
  scaleIO:
    fsType: string
    gateway: string
    protectionDomain: string
    readonly: boolean
    secretRef:
      name: string
    sslEnabled: boolean
    storageMode: string
    storagePool: string
    system: string
    volumeName: string
  secret:
    defaultMode: integer
    items:
    - key: string
      mode: integer
      path: string
    optional: boolean
    secretName: string
  storageos:
    fsType: string
    readOnly: boolean
    secretRef:
      name: string
    volumeName: string
    volumeNamespace: string
  vsphereVolume:
    fsType: string
    storagePolicyID: string
    storagePolicyName: string
    volumePath: string
sidecars:
- args:
  - string
  command:
  - string
  env:
  - name: string
    value: string
    valueFrom:
      configMapKeyRef:
        key: string
        name: string
        optional: boolean
      fieldRef:
        apiVersion: string
        fieldPath: string
      resourceFieldRef:
        containerName: string
        divisor: integer or string
        resource: string
      secretKeyRef:
        key: string
        name: string
        optional: boolean
  envFrom:
  - configMapRef:
      name: string
      optional: boolean
    prefix: string
    secretRef:
      name: string
      optional: boolean
  image: string
  imagePullPolicy: string
  lifecycle:
    postStart:
      exec:
        command:
        - string
      httpGet:
        host: string
        httpHeaders:
        - name: string
          value: string
        path: string
        port: integer or string
        scheme: string
      tcpSocket:
        host: string
        port: integer or string
    preStop:
      exec:
        command:
        - string
      httpGet:
        host: string
        httpHeaders:
        - name: string
          value: string
        path: string
        port: integer or string
        scheme: string
      tcpSocket:
        host: string
        port: integer or string
  livenessProbe:
    exec:
      command:
      - string
    failureThreshold: integer
    grpc:
      port: integer
      service: string
    httpGet:
      host: string
      httpHeaders:
      - name: string
        value: string
      path: string
      port: integer or string
      scheme: string
    initialDelaySeconds: integer
    periodSeconds: integer
    successThreshold: integer
    tcpSocket:
      host: string
      port: integer or string
    terminationGracePeriodSeconds: integer
    timeoutSeconds: integer
  name: string
  ports:
  - containerPort: integer
    hostIP: string
    hostPort: integer
    name: string
    protocol: string
  readinessProbe:
    exec:
      command:
      - string
    failureThreshold: integer
    grpc:
      port: integer
      service: string
    httpGet:
      host: string
      httpHeaders:
      - name: string
        value: string
      path: string
      port: integer or string
      scheme: string
    initialDelaySeconds: integer
    periodSeconds: integer
    successThreshold: integer
    tcpSocket:
      host: string
      port: integer or string
    terminationGracePeriodSeconds: integer
    timeoutSeconds: integer
  resizePolicy:
  - resourceName: string
    restartPolicy: string
  resources:
    claims:
    - name: string
    limits: integer or string
    requests: integer or string
  restartPolicy: string
  securityContext:
    allowPrivilegeEscalation: boolean
    capabilities:
      add:
      - string
      drop:
      - string
    privileged: boolean
    procMount: string
    readOnlyRootFilesystem: boolean
    runAsGroup: integer
    runAsNonRoot: boolean
    runAsUser: integer
    seLinuxOptions:
      level: string
      role: string
      type: string
      user: string
    seccompProfile:
      localhostProfile: string
      type: string
    windowsOptions:
      gmsaCredentialSpec: string
      gmsaCredentialSpecName: string
      hostProcess: boolean
      runAsUserName: string
  startupProbe:
    exec:
      command:
      - string
    failureThreshold: integer
    grpc:
      port: integer
      service: string
    httpGet:
      host: string
      httpHeaders:
      - name: string
        value: string
      path: string
      port: integer or string
      scheme: string
    initialDelaySeconds: integer
    periodSeconds: integer
    successThreshold: integer
    tcpSocket:
      host: string
      port: integer or string
    terminationGracePeriodSeconds: integer
    timeoutSeconds: integer
  stdin: boolean
  stdinOnce: boolean
  terminationMessagePath: string
  terminationMessagePolicy: string
  tty: boolean
  volumeDevices:
  - devicePath: string
    name: string
  volumeMounts:
  - mountPath: string
    mountPropagation: string
    name: string
    readOnly: boolean
    subPath: string
    subPathExpr: string
  workingDir: string

字段

类型
必填或可选

 

说明
additionalVolumes
list (object)
可选
AdditionalVolumes 指定要装载到边车容器中的现有卷列表。如需了解详情,请参阅 https://kubernetes.io/docs/concepts/storage/volumes/。
additionalVolumes[]
object
可选
卷表示 Pod 中的命名卷,可供 Pod 中的任何容器访问。
additionalVolumes[].awsElasticBlockStore
object
可选
awsElasticBlockStore 表示已附加到 kubelet 的主机并随后公开给 pod 的 AWS 磁盘资源。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
additionalVolumes[].awsElasticBlockStore.fsType
string
可选
fsType 是您要挂载的卷的文件系统类型。提示:确保主机操作系统支持文件系统类型。示例:“ext4”“xfs”“ntfs”。如果未指定,则隐式推断为“ext4”。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
additionalVolumes[].awsElasticBlockStore.partition
integer
可选
partition 是您要装载的卷中的分区。如果省略,则默认按卷名称进行挂载。示例:对于卷 /dev/sda1,您可以将分区指定为“1”。同样,/dev/sda 的卷分区为“0”(您也可以将该属性留空)。
additionalVolumes[].awsElasticBlockStore.readOnly
boolean
可选
将 readOnly 值设为 true 会强制在 VolumeMounts 中设置 readOnly。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
additionalVolumes[].awsElasticBlockStore.volumeID
string
必填
volumeID 是 AWS 中持久性磁盘资源(Amazon EBS 卷)的唯一 ID。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
additionalVolumes[].azureDisk
object
可选
azureDisk 表示主机上的 Azure 数据磁盘挂载,并绑定挂载到 pod。
additionalVolumes[].azureDisk.cachingMode
string
可选
cachingMode 是主机缓存模式:无、只读、读写。
additionalVolumes[].azureDisk.diskName
string
必填
diskName 是 blob 存储区中数据磁盘的名称
additionalVolumes[].azureDisk.diskURI
string
必填
diskURI 是 blob 存储区中数据磁盘的 URI
additionalVolumes[].azureDisk.fsType
string
可选
fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。 例如:“ext4”“xfs”“ntfs”。如果未指定,则隐式推断为“ext4”。
additionalVolumes[].azureDisk.kind
string
可选
kind 的预期值为:共享:每个存储账号有多个 blob 磁盘;专用:每个存储账号有一个 blob 磁盘;托管:Azure 托管的数据盘(仅在托管的可用性集群中)。默认为“共享”
additionalVolumes[].azureDisk.readOnly
boolean
可选
readOnly 默认为 false(读写)。此处的 ReadOnly 将强制使用 VolumeMounts 中的 ReadOnly 设置。
additionalVolumes[].azureFile
object
可选
azureFile 表示在主机上挂载的 Azure 文件服务,并绑定挂载到 pod。
additionalVolumes[].azureFile.readOnly
boolean
可选
readOnly 默认为 false(读写)。此处的 ReadOnly 将强制使用 VolumeMounts 中的 ReadOnly 设置。
additionalVolumes[].azureFile.secretName
string
必填
secretName 是包含 Azure 存储空间账号名称和密钥的 Secret 的名称
additionalVolumes[].azureFile.shareName
string
必填
shareName 是 Azure 共享名称
additionalVolumes[].cephfs
object
可选
cephFS 表示主机上的 Ceph FS 挂载点,该挂载点与 pod 共享生命周期
additionalVolumes[].cephfs.monitors
list (string)
必填
monitors 是必需的:Monitors 是一系列 Ceph 监控器。了解详情:https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
additionalVolumes[].cephfs.path
string
可选
path(路径)是可选项:用作已挂载的根目录,而不是完整的 Ceph 树,默认为 /
additionalVolumes[].cephfs.readOnly
boolean
可选
readOnly(只读)是可选的:默认为 false(读写)。 此处的 ReadOnly 将强制使用 VolumeMounts 中的 ReadOnly 设置。 更多信息:https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
additionalVolumes[].cephfs.secretFile
string
可选
secretFile 是可选项:SecretFile 是用户密钥串的路径,默认为 /etc/ceph/user.secret 更多信息:https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
additionalVolumes[].cephfs.secretRef
object
可选
secretRef 是可选的:SecretRef 是对用户身份验证 Secret 的引用,默认为空。 更多信息:https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
additionalVolumes[].cephfs.secretRef.name
string
可选
被指称对象的名称。更多信息:https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
additionalVolumes[].cephfs.user
string
可选
user 为可选项:用户是 Rados 用户名,默认为 administrator。了解详情:https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
additionalVolumes[].cinder
object
可选
cinder 表示附加到 kubelet 宿主机并在其上挂载的 cinder 卷。更多信息:https://examples.k8s.io/mysql-cinder-pd/README.md
additionalVolumes[].cinder.fsType
string
可选
fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。 示例:“ext4”“xfs”“ntfs”。如果未指定,则隐式推断为“ext4”。更多信息:https://examples.k8s.io/mysql-cinder-pd/README.md
additionalVolumes[].cinder.readOnly
boolean
可选
readOnly 默认为 false(读写)。此处的 ReadOnly 将强制使用 VolumeMounts 中的 ReadOnly 设置。 更多信息:https://examples.k8s.io/mysql-cinder-pd/README.md
additionalVolumes[].cinder.secretRef
object
可选
secretRef 是可选的:指向包含用于连接到 OpenStack 的参数的 Secret 对象
additionalVolumes[].cinder.secretRef.name
string
可选
被指称对象的名称。更多信息:https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
additionalVolumes[].cinder.volumeID
string
必填
用于在 cinder 中标识卷的 volumeID。 更多信息:https://examples.k8s.io/mysql-cinder-pd/README.md
additionalVolumes[].configMap
object
可选
configMap 表示应填充此卷的 configMap
additionalVolumes[].configMap.defaultMode
integer
可选
defaultMode 是可选的:默认情况下,用于设置所创建文件的权限的模式位。必须是介于 0000 到 0777 之间的八进制值,或介于 0 到 511 之间的十进制值。YAML 接受八进制和十进制值,JSON 则要求模式位使用十进制值。默认值为 0644。路径中的目录不受此设置的影响。这可能会与影响文件模式的其他选项(例如 fsGroup)冲突,结果可能是设置其他模式位。
additionalVolumes[].configMap.items
list (object)
可选
项(如果未指定),则引用的 ConfigMap 的“Data”字段中的每个键值对都会投影到该卷中,作为一个文件,其中名称是键,内容是值。如果指定,系统会将列出的密钥投影到指定的路径,并且不会显示未列出的密钥。如果指定的键不存在于 ConfigMap 中,除非将其标记为可选,否则卷设置将出错。路径必须是相对路径,不得包含“..”路径或以“..”开头。
additionalVolumes[].configMap.items[]
object
可选
将字符串键映射到卷中的路径。
additionalVolumes[].configMap.items[].key
string
必填
key 是项目的键。
additionalVolumes[].configMap.items[].mode
integer
可选
mode(模式)是可选的:用于设置此文件权限的模式位。必须是介于 0000 到 0777 之间的八进制值,或介于 0 到 511 之间的十进制值。YAML 接受八进制和十进制值,JSON 则要求模式位使用十进制值。如果未指定,系统将使用音量 defaultMode。 这可能会与影响文件模式的其他选项(例如 fsGroup)冲突,结果可能会是设置其他模式位。
additionalVolumes[].configMap.items[].path
string
必填
path 是要将密钥映射到的文件的相对路径。可以是相对路径,也可以是绝对路径。 不得包含路径元素“..”。不得以字符串“..”开头。
additionalVolumes[].csi
object
可选
csi(容器存储接口)表示由某些外部 CSI 驱动程序处理的暂时存储空间(Beta 版功能)。
additionalVolumes[].csi.driver
string
必填
driver 是处理此卷的 CSI 驱动程序的名称。请咨询您的管理员,了解在集群中注册的正确名称。
additionalVolumes[].csi.fsType
string
可选
要挂载的 fsType。例如:“ext4”“xfs”“ntfs”。 如果未提供,系统会将空值传递给关联的 CSI 驱动程序,该驱动程序将确定要应用的默认文件系统。
additionalVolumes[].csi.nodePublishSecretRef
object
可选
nodePublishSecretRef 是对包含敏感信息的 Secret 对象的引用,用于传递给 CSI 驱动程序以完成 CSI NodePublishVolume 和 NodeUnpublishVolume 调用。此字段是可选字段,如果不需要密钥,则可以为空。如果 Secret 对象包含多个 Secret,则会传递所有 Secret 引用。
additionalVolumes[].csi.nodePublishSecretRef.name
string
可选
被指称对象的名称。更多信息:https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
additionalVolumes[].csi.readOnly
boolean
可选
readOnly 用于指定卷的只读配置。默认值为 false(读写)。
additionalVolumes[].csi.volumeAttributes
object (string)
可选
volumeAttributes 用于存储传递给 CSI 驱动程序的驱动程序专用属性。如需了解支持的值,请参阅驱动程序文档。
additionalVolumes[].downwardAPI
object
可选
downwardAPI 表示应填充此卷的 pod 的向下 API
additionalVolumes[].downwardAPI.defaultMode
integer
可选
可选:默认对创建的文件使用的模式位。必须为可选:默认情况下,用于为创建的文件设置权限的模式位。必须是介于 0000 到 0777 之间的八进制值,或介于 0 到 511 之间的十进制值。YAML 接受八进制和十进制值,JSON 则要求模式位使用十进制值。默认值为 0644。路径中的目录不受此设置的影响。这可能会与影响文件模式的其他选项(例如 fsGroup)冲突,结果可能是设置其他模式位。
additionalVolumes[].downwardAPI.items
list (object)
可选
Items 是向下 API 卷文件的列表
additionalVolumes[].downwardAPI.items[]
object
可选
DownwardAPIVolumeFile 表示用于创建包含 pod 字段的文件的信息
additionalVolumes[].downwardAPI.items[].fieldRef
object
可选
必需:选择 pod 的字段:仅支持注解、标签、名称和命名空间。
additionalVolumes[].downwardAPI.items[].fieldRef.apiVersion
string
可选
用于编写 FieldPath 的架构版本,默认为“v1”。
additionalVolumes[].downwardAPI.items[].fieldRef.fieldPath
string
必填
要在指定 API 版本中选择的字段的路径。
additionalVolumes[].downwardAPI.items[].mode
integer
可选
可选:用于设置此文件权限的模式位,必须是介于 0000 和 0777 之间的八进制值,或介于 0 和 511 之间的十进制值。YAML 接受八进制值和十进制值,JSON 则要求模式位使用十进制值。如果未指定,则使用音量 defaultMode。这可能会与影响文件模式的其他选项(例如 fsGroup)冲突,结果可能会设置其他模式位。
additionalVolumes[].downwardAPI.items[].path
string
必填
必需:路径是指要创建的文件的相对路径。不得是绝对路径,也不得包含“..”路径。必须采用 utf-8 编码。 相对路径的第一个项不得以“..”开头。
additionalVolumes[].downwardAPI.items[].resourceFieldRef
object
可选
选择容器的资源:仅支持资源限制和请求(limits.cpu、limits.memory、requests.cpu 和 requests.memory)。
additionalVolumes[].downwardAPI.items[].resourceFieldRef.containerName
string
可选
容器名称:对于卷是必需的,对于环境变量是可选的
additionalVolumes[].downwardAPI.items[].resourceFieldRef.divisor
integer or string
可选
指定公开资源的输出格式,默认为“1”
additionalVolumes[].downwardAPI.items[].resourceFieldRef.resource
string
必填
必填:要选择的资源
additionalVolumes[].emptyDir
object
可选
emptyDir 表示与 pod 共享生命周期的临时目录。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#emptydir
additionalVolumes[].emptyDir.medium
string
可选
medium 表示应为此目录提供哪种类型的存储介质。默认值为“”,表示使用节点的默认媒介。必须为空字符串(默认)或“Memory”。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#emptydir
additionalVolumes[].emptyDir.sizeLimit
integer or string
可选
sizeLimit 是此 EmptyDir 卷所需的本地存储空间总量。此大小限制也适用于内存介质。内存中介 EmptyDir 的最大用量将是此处指定的 SizeLimit 与 pod 中所有容器的内存限制总和之间的最小值。默认值为 nil,表示没有限制。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#emptydir
additionalVolumes[].ephemeral
object
可选
ephemeral 表示由集群存储驱动程序处理的卷。卷的生命周期与定义它的 Pod 相关联 - 它将在 Pod 启动之前创建,并在 Pod 被移除时删除。\n 在以下情况下,请使用此类型:a) 仅在 pod 运行时需要卷,b) 需要正常卷的功能(例如从快照恢复或容量跟踪),c) 存储驱动程序通过存储类别指定,d) 存储驱动程序支持通过 PersistentVolumeClaim 动态预配卷(如需详细了解此卷类型与 PersistentVolumeClaim 之间的关联,请参阅 EphemeralVolumeSource)。\n 对于持续时间超过单个 Pod 生命周期的卷,请使用 PersistentVolumeClaim 或某个特定于供应商的 API。\n 如果 CSI 驱动程序旨在以这种方式使用,请针对轻量级本地临时卷使用 CSI - 如需了解详情,请参阅驱动程序文档。\n 一个 pod 可以同时使用这两种类型的临时卷和永久性卷。
additionalVolumes[].ephemeral.volumeClaimTemplate
object
可选
将用于创建独立的 PVC 以预配卷。嵌入此 EphemeralVolumeSource 的 pod 将成为 PVC 的所有者,否则 PVC 将随 pod 一起被删除。PVC 的名称将为 <pod name>-<volume name>,其中 <volume name>PodSpec.Volumes 数组条目中的名称。 如果串联的名称对 PVC 无效(例如过长),Pod 验证将拒绝该 Pod。\n 系统不会* 为 Pod 使用不归 Pod 所有的同名现有 PVC,以免误用不相关的卷。然后,系统会阻止启动 Pod,直到移除不相关的 PVC。如果此类预创建的 PVC 要供 Pod 使用,则必须在 Pod 存在后,使用指向 Pod 的所有者引用更新 PVC。 通常不需要执行此操作,但在手动重建损坏的集群时,此操作可能很有用。\n 此字段是只读的,PVC 创建后,Kubernetes 不会对其进行任何更改。\n 必填,不得为 null。
additionalVolumes[].ephemeral.volumeClaimTemplate.metadata
object
可选
可能包含在创建 PVC 时复制到 PVC 中的标签和注释。不允许使用任何其他字段,否则将在验证期间被拒绝。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec
object
必填
PersistentVolumeClaim 的规范。 系统会将整个内容原封不动地复制到通过此模板创建的 PVC 中。与 PersistentVolumeClaim 中相同的字段在这里也适用。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.accessModes
list (string)
可选
accessModes 包含该卷应具有的所需访问模式。更多信息:https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.accessModes[]
string
可选
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.dataSource
object
可选
dataSource 字段可用于指定以下任一项:* 现有的 VolumeSnapshot 对象 (snapshot.storage.k8s.io/VolumeSnapshot) * 现有的 PVC (PersistentVolumeClaim)。如果预配程序或外部控制器可以支持指定的数据源,则会根据指定数据源的内容创建新的卷。启用 AnyVolumeDataSource 功能门控后,dataSource 内容将复制到 dataSourceRef,并且当未指定 dataSourceRef.namespace 时,dataSourceRef 内容将复制到 dataSource。如果指定了命名空间,则 dataSourceRef 不会复制到 dataSource。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.dataSource.apiGroup
string
可选
APIGroup 是被引用资源的组。如果未指定 APIGroup,则指定的 Kind 必须位于核心 API 组中。对于任何其他第三方类型,APIGroup 是必需的。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.dataSource.kind
string
必填
种类是被引用的资源的类型
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.dataSource.name
string
必填
名称是被引用的资源的名称
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.dataSourceRef
object
可选
如果需要非空卷,dataSourceRef 会指定用于向卷填充数据的对象。这可以是来自非空 API 组(非核心对象)或 PersistentVolumeClaim 对象的任何对象。指定此字段后,只有在指定对象的类型与某个已安装的卷填充程序或动态预配程序匹配时,卷绑定才会成功。 此字段将取代 dataSource 字段的功能,因此,如果这两个字段均不为空,则它们的值必须相同。为了向后兼容,如果 dataSourceRef 中未指定命名空间,当其中一个字段为空而另一个字段不为空时,系统会自动将这两个字段(dataSource 和 dataSourceRef)设置为相同的值。在 dataSourceRef 中指定命名空间后,dataSource 不会设置为相同的值,并且必须为空。dataSource 和 dataSourceRef 之间有三个重要区别: * 虽然 dataSource 仅允许两种特定类型的对象,但 dataSourceRef 允许任何非核心对象以及 PersistentVolumeClaim 对象。 * 虽然 dataSource 会忽略不允许的值(将其舍弃),但 dataSourceRef 会保留所有值,如果指定了不允许的值,则会生成错误。 * 虽然 dataSource 仅允许本地对象,但 dataSourceRef 允许任何命名空间中的对象。 (Beta 版)如需使用此字段,必须启用 AnyVolumeDataSource 功能门控。(Alpha 版)如需使用 dataSourceRef 的命名空间字段,需要启用 CrossNamespaceVolumeDataSource 功能门控。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.dataSourceRef.apiGroup
string
可选
APIGroup 是被引用资源的组。如果未指定 APIGroup,则指定的 Kind 必须位于核心 API 组中。对于任何其他第三方类型,APIGroup 是必需的。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.dataSourceRef.kind
string
必填
种类是被引用的资源的类型
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.dataSourceRef.name
string
必填
名称是被引用的资源的名称
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.dataSourceRef.namespace
string
可选
命名空间是被引用资源的命名空间。请注意,指定命名空间后,引用方命名空间中必须包含 gateway.networking.k8s.io/ReferenceGrant 对象,以允许该命名空间的所有者接受引用。如需了解详情,请参阅 ReferenceGrant 文档。(Alpha 版)此字段需要启用 CrossNamespaceVolumeDataSource 功能门限。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.resources
object
可选
resources 表示卷应具有的最低资源。如果启用了 RecoverVolumeExpansionFailure 功能,用户可以指定低于之前值的资源要求,但仍必须高于 claim 的状态字段中记录的容量。更多信息:https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.resources.claims
list (object)
可选
claims 列出了此容器使用的 spec.resourceClaims 中定义的资源名称。\n 此字段处于 Alpha 版阶段,需要启用 DynamicResourceAllocation 特性门控。\n 此字段不可更改。 此属性只能为容器设置。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.resources.claims[]
object
可选
ResourceClaim 引用 PodSpec.ResourceClaims 中的条目。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.resources.claims[].name
string
必填
名称必须与使用此字段的 Pod 的 pod.spec.resourceClaims 中的某个条目的名称一致。 它可使该资源在容器内可用。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.resources.limits
integer or string
可选
限制描述允许的计算资源数量上限。更多信息:https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.resources.requests
integer or string
可选
Requests 描述所需的最低计算资源量。如果为容器省略了“请求”值,则默认为“限制”(如果明确指定了),否则为实现定义的值。请求不得超出限制。更多信息:https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.selector
object
可选
选择器是对要考虑绑定的卷的标签查询。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.selector.matchExpressions
list (object)
可选
matchExpressions 是标签选择器要求的列表。这些要求之间是 AND 关系。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.selector.matchExpressions[]
object
可选
标签选择器要求是一种选择器,其中包含值、键以及用于将键和值相关联的运算符。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.selector.matchExpressions[].key
string
必填
key 是选择器应用到的标签键。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.selector.matchExpressions[].operator
string
必填
运算符表示键与一组值的关系。有效运算符包括 In、NotIn、Exists 和 DoesNotExist。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.selector.matchExpressions[].values
string
可选
values 是字符串值的数组。如果运算符为“In”或“NotIn”,则值数组必须不为空。 如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在战略合并补丁期间替换。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.selector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 相当于 matchExpressions 的元素,其键字段为“key”,运算符为“In”,并且值数组仅包含“value”。 这些要求之间是 AND 关系。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.storageClassName
string
可选
storageClassName 是声明所需的 StorageClass 的名称。更多信息: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.volumeMode
string
可选
volumeMode 用于定义声明所需的音量类型。如果未在声明规范中包含 Filesystem 的值,则隐含该值。
additionalVolumes[].ephemeral.volumeClaimTemplate.spec.volumeName
string
可选
volumeName 是指向此声明所依托的 PersistentVolume 的绑定引用。
additionalVolumes[].fc
object
可选
fc 表示连接到 kubelet 的主机,然后公开给 pod 的 Fibre Channel 资源。
additionalVolumes[].fc.fsType
string
可选
fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。 例如:“ext4”“xfs”“ntfs”。如果未指定,则隐式推断为“ext4”。
additionalVolumes[].fc.lun
integer
可选
lun(可选):FC 目标 lun 编号
additionalVolumes[].fc.readOnly
boolean
可选
readOnly(只读)是可选的:默认为 false(读写)。 此处的 ReadOnly 将强制使用 VolumeMounts 中的 ReadOnly 设置。
additionalVolumes[].fc.targetWWNs
list (string)
可选
targetWWNs(可选):FC 目标全球名称 (WWN)
additionalVolumes[].fc.targetWWNs[]
string
可选
additionalVolumes[].fc.wwids
list (string)
可选
wwids(可选):FC 卷世界范围标识符 (wwids)。必须设置 wwids 或 targetWWN 和 LUN 的组合,但不能同时设置这两者。
additionalVolumes[].fc.wwids[]
string
可选
additionalVolumes[].flexVolume
object
可选
flexVolume 表示使用基于 exec 的插件预配/附加的通用卷资源。
additionalVolumes[].flexVolume.driver
string
必填
driver 是用于此卷的驱动程序的名称。
additionalVolumes[].flexVolume.fsType
string
可选
fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。 例如:“ext4”“xfs”“ntfs”。默认文件系统取决于 FlexVolume 脚本。
additionalVolumes[].flexVolume.options
object
可选
options(选项)是可选字段:此字段用于存储额外的命令选项(如果有)。
additionalVolumes[].flexVolume.readOnly
boolean
可选
readOnly 是可选属性:默认为 false(读写)。 此处的 ReadOnly 将强制使用 VolumeMounts 中的 ReadOnly 设置。
additionalVolumes[].flexVolume.secretRef
object
可选
secretRef 是可选的:secretRef 是对包含要传递给插件脚本的敏感信息的 Secret 对象的引用。如果未指定 Secret 对象,此字段可能会为空。如果 Secret 对象包含多个 Secret,则所有 Secret 都会传递给插件脚本。
additionalVolumes[].flexVolume.secretRef.name
string
可选
被指称对象的名称。更多信息:https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
additionalVolumes[].flocker
object
可选
flocker 表示连接到 kubelet 的主机的 Flocker 卷。这取决于 Flocker 控制服务是否正在运行
additionalVolumes[].flocker.datasetName
string
可选
datasetName 是存储为元数据的数据集的名称 -> Flocker 数据集中的名称应被视为已废弃
additionalVolumes[].flocker.datasetUUID
string
可选
datasetUUID 是数据集的 UUID。这是 Flocker 数据集的唯一标识符
additionalVolumes[].gcePersistentDisk
object
可选
gcePersistentDisk 表示挂接到 kubelet 的主机并随后公开给 pod 的 Compute Engine 磁盘资源。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
additionalVolumes[].gcePersistentDisk.fsType
string
可选
fsType 是您要挂载的卷的文件系统类型。提示:确保主机操作系统支持文件系统类型。示例:“ext4”“xfs”“ntfs”。如果未指定,则会隐式推断为“ext4”。 更多信息:https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
additionalVolumes[].gcePersistentDisk.partition
integer
可选
partition 是您要装载的卷中的分区。如果省略,则默认按卷名称进行挂载。示例:对于卷 /dev/sda1,您可以将分区指定为“1”。同样,/dev/sda 的卷分区为“0”(或者您也可以将该属性留空)。 更多信息:https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
additionalVolumes[].gcePersistentDisk.pdName
string
必填
pdName 是 Compute Engine 中永久性磁盘资源的唯一名称。用于标识 Compute Engine 中的磁盘。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
additionalVolumes[].gcePersistentDisk.readOnly
boolean
可选
此处的 readOnly 将强制在 VolumeMounts 中设置 ReadOnly。默认值为 false。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
additionalVolumes[].gitRepo
object
可选
gitRepo 表示特定修订版本的 git 代码库。已弃用:GitRepo 已弃用。如需为容器预配 Git 代码库,请将 EmptyDir 挂载到使用 git 克隆代码库的 InitContainer 中,然后将 EmptyDir 挂载到 Pod 的容器中。
additionalVolumes[].gitRepo.directory
string
可选
directory 是目标目录名称。不得包含“..”或以“..”开头。如果提供“.”,则卷目录将是 git 代码库。否则,如果指定了,卷将在指定名称的子目录中包含 git 代码库。
additionalVolumes[].gitRepo.repository
string
必填
仓库是网址
additionalVolumes[].gitRepo.revision
string
可选
revision 是指定修订版本的提交哈希。
additionalVolumes[].glusterfs
object
可选
glusterfs 表示主机上的 Glusterfs 挂载点,与 Pod 共享生命周期。更多信息:https://examples.k8s.io/volumes/glusterfs/README.md
additionalVolumes[].glusterfs.endpoints
string
必填
endpoints 是详细说明 Glusterfs 拓扑的端点名称。更多信息:https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
additionalVolumes[].glusterfs.path
string
必填
path 是 Glusterfs 卷路径。更多信息: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
additionalVolumes[].glusterfs.readOnly
boolean
可选
此处的 readOnly 将强制以只读权限装载 Glusterfs 卷。默认值为 false。更多信息:https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
additionalVolumes[].hostPath
object
可选
hostPath 表示直接公开给容器的主机上的一个现有文件或目录。 这通常用于系统代理或其他有权查看主机的权限实体。大多数容器都不需要这样做。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#hostpath
additionalVolumes[].hostPath.path
string
必填
主机上目录的路径。如果路径是符号链接,则会沿着链接找到真实路径。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#hostpath
additionalVolumes[].hostPath.type
string
可选
HostPath 卷的类型。默认为“”。详情:https://kubernetes.io/docs/concepts/storage/volumes#hostpath
additionalVolumes[].iscsi
object
可选
iscsi 表示连接到 kubelet 的主机并随后公开给 pod 的 ISCSI 磁盘资源。更多信息:https://examples.k8s.io/volumes/iscsi/README.md
additionalVolumes[].iscsi.chapAuthDiscovery
boolean
可选
chapAuthDiscovery 用于定义是否支持 iSCSI 发现 CHAP 身份验证
additionalVolumes[].iscsi.chapAuthSession
boolean
可选
chapAuthSession 用于定义是否支持 iSCSI 会话 CHAP 身份验证
additionalVolumes[].iscsi.fsType
string
可选
fsType 是您要挂载的卷的文件系统类型。提示:确保主机操作系统支持文件系统类型。示例:“ext4”“xfs”“ntfs”。如果未指定,则隐式推断为“ext4”。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#iscsi
additionalVolumes[].iscsi.initiatorName
string
可选
initiatorName 是自定义 iSCSI 发起程序名称。如果同时使用 initiatorName 和 iscsiInterface 指定连接,系统会为该连接创建新的 iSCSI 接口 <target portal>:<volume name>。
additionalVolumes[].iscsi.iqn
string
必填
iqn 是目标 iSCSI 限定名称。
additionalVolumes[].iscsi.iscsiInterface
string
可选
iscsiInterface 是使用 iSCSI 传输的接口名称。默认值为“default”(tcp)。
additionalVolumes[].iscsi.lun
integer
必填
lun 表示 iSCSI 目标 lun 编号。
additionalVolumes[].iscsi.portals
list (string)
可选
portals 是 iSCSI 目标门户列表。门户是 IP 地址,如果端口不是默认端口(通常是 TCP 端口 860 和 3260),则为 ip_addr:port。
additionalVolumes[].iscsi.portals[]
string
可选
additionalVolumes[].iscsi.readOnly
boolean
可选
此处的 readOnly 将强制在 VolumeMounts 中设置 ReadOnly。默认值为 false。
additionalVolumes[].iscsi.secretRef
object
可选
secretRef 是 iSCSI 目标和发起方身份验证的 CHAP 密钥
additionalVolumes[].iscsi.secretRef.name
string
可选
被指称对象的名称。更多信息:https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
additionalVolumes[].iscsi.targetPortal
string
必填
targetPortal 是 iSCSI 目标门户。门户是 IP 地址,如果端口不是默认端口(通常是 TCP 端口 860 和 3260),则为 ip_addr:port。
additionalVolumes[].name
string
必填
卷的名称。必须是 DNS_LABEL,并且在 pod 中是唯一的。更多信息:https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
additionalVolumes[].nfs
object
可选
nfs 表示主机上的 NFS 挂载,该挂载共享 pod 的生命周期。了解详情:https://kubernetes.io/docs/concepts/storage/volumes#nfs
additionalVolumes[].nfs.path
string
必填
由 NFS 服务器导出的路径。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#nfs
additionalVolumes[].nfs.readOnly
boolean
可选
此处的 readOnly 将强制以只读权限挂载 NFS 导出。默认值为 false。 更多信息:https://kubernetes.io/docs/concepts/storage/volumes#nfs
additionalVolumes[].nfs.server
string
必填
server 是 NFS 服务器的主机名或 IP 地址。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#nfs
additionalVolumes[].persistentVolumeClaim
object
可选
persistentVolumeClaimVolumeSource 表示对同一命名空间中 PersistentVolumeClaim 的引用。 更多信息:https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
additionalVolumes[].persistentVolumeClaim.claimName
string
必填
claimName 是与使用此卷的 pod 位于同一命名空间中的 PersistentVolumeClaim 的名称。更多信息:https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
additionalVolumes[].persistentVolumeClaim.readOnly
boolean
可选
readOnly 会强制在 VolumeMounts 中设置 ReadOnly。默认值为 false。
additionalVolumes[].photonPersistentDisk
object
可选
photonPersistentDisk 表示挂接到 kubelet 主机并在其上装载的 PhotonController 永久性磁盘
additionalVolumes[].photonPersistentDisk.fsType
string
可选
fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。 例如:“ext4”“xfs”“ntfs”。如果未指定,则隐式推断为“ext4”。
additionalVolumes[].photonPersistentDisk.pdID
string
必填
pdID 是用于标识 Photon Controller 永久性磁盘的 ID
additionalVolumes[].portworxVolume
object
可选
portworxVolume 表示已挂接并装载在 kubelet 主机上的 portworx 卷
additionalVolumes[].portworxVolume.fsType
string
可选
fSType 表示要挂载的文件系统类型,必须是主机操作系统支持的文件系统类型。例如:“ext4”“xfs”。如果未指定,则隐式推断为“ext4”。
additionalVolumes[].portworxVolume.readOnly
boolean
可选
readOnly 默认为 false(读写)。此处的 ReadOnly 将强制使用 VolumeMounts 中的 ReadOnly 设置。
additionalVolumes[].portworxVolume.volumeID
string
必填
volumeID 用于唯一标识 Portworx 卷
additionalVolumes[].projected
object
可选
适用于“一站式”资源 Secret、ConfigMap 和 downwardAPI 的项目
additionalVolumes[].projected.defaultMode
integer
可选
defaultMode 是默认用于为创建的文件设置权限的模式位。必须是介于 0000 到 0777 之间的八进制值,或介于 0 到 511 之间的十进制值。YAML 接受八进制值和十进制值,JSON 则要求模式位使用十进制值。路径中的目录不受此设置的影响。这可能会与影响文件模式的其他选项(例如 fsGroup)冲突,结果可能会设置其他模式位。
additionalVolumes[].projected.sources
list (object)
可选
sources 是音量投影列表
additionalVolumes[].projected.sources[]
object
可选
可与其他受支持的卷类型一起投影的映射
additionalVolumes[].projected.sources[].configMap
object
可选
与要投影的 configMap 数据相关的 configMap 信息
additionalVolumes[].projected.sources[].configMap.items
list (object)
可选
项(如果未指定),则引用的 ConfigMap 的“Data”字段中的每个键值对都会作为文件投影到该卷中,其中名称为键,内容为值。 如果指定,系统会将列出的键投影到指定的路径,并且不会显示未列出的键。如果指定的键不存在于 ConfigMap 中,除非将其标记为可选,否则卷设置将出错。 路径必须是相对路径,不得包含“..”路径或以“..”开头。
additionalVolumes[].projected.sources[].configMap.items[]
object
可选
将字符串键映射到卷中的路径。
additionalVolumes[].projected.sources[].configMap.items[].key
string
必填
key 是项目的键。
additionalVolumes[].projected.sources[].configMap.items[].mode
integer
可选
mode(模式)是可选的:用于设置此文件权限的模式位。 必须是介于 0000 到 0777 之间的八进制值,或介于 0 到 511 之间的十进制值。YAML 接受八进制和十进制值,JSON 则要求模式位使用十进制值。如果未指定,系统将使用音量 defaultMode。这可能会与影响文件模式的其他选项(例如 fsGroup)冲突,结果可能会是设置其他模式位。
additionalVolumes[].projected.sources[].configMap.items[].path
string
必填
path 是要将密钥映射到的文件的相对路径。不得是绝对路径。不得包含路径元素“..”。不得以字符串“..”开头。
additionalVolumes[].projected.sources[].configMap.name
string
可选
被指称对象的名称。更多信息: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
additionalVolumes[].projected.sources[].configMap.optional
boolean
可选
可选,指定是否必须定义 ConfigMap 或其键
additionalVolumes[].projected.sources[].downwardAPI
object
可选
与要投影的 downwardAPI 数据有关的 downwardAPI 信息
additionalVolumes[].projected.sources[].downwardAPI.items
list (object)
可选
Items 是 DownwardAPIVolume 文件的列表
additionalVolumes[].projected.sources[].downwardAPI.items[]
object
可选
DownwardAPIVolumeFile 表示用于创建包含 pod 字段的文件的信息
additionalVolumes[].projected.sources[].downwardAPI.items[].fieldRef
object
可选
必需:选择 pod 的字段:仅支持注解、标签、名称和命名空间。
additionalVolumes[].projected.sources[].downwardAPI.items[].fieldRef.apiVersion
string
可选
用于编写 FieldPath 的架构版本,默认为“v1”。
additionalVolumes[].projected.sources[].downwardAPI.items[].fieldRef.fieldPath
string
必填
要在指定 API 版本中选择的字段的路径。
additionalVolumes[].projected.sources[].downwardAPI.items[].mode
integer
可选
可选:用于设置此文件权限的模式位,必须是介于 0000 和 0777 之间的八进制值,或介于 0 和 511 之间的十进制值。YAML 接受八进制值和十进制值,JSON 则要求模式位使用十进制值。如果未指定,系统将使用音量 defaultMode。这可能会与影响文件模式的其他选项(例如 fsGroup)冲突,结果可能会是设置其他模式位。
additionalVolumes[].projected.sources[].downwardAPI.items[].path
string
必填
必需:路径是指要创建的文件的相对路径。不得是绝对路径,也不得包含“..”路径。必须采用 utf-8 编码。相对路径的第一个项不得以“..”开头
additionalVolumes[].projected.sources[].downwardAPI.items[].resourceFieldRef
object
可选
选择容器的资源:仅支持资源限制和请求(limits.cpu、limits.memory、requests.cpu 和 requests.memory)。
additionalVolumes[].projected.sources[].downwardAPI.items[].resourceFieldRef.containerName
string
可选
容器名称:对于卷是必需的,对于环境变量是可选的
additionalVolumes[].projected.sources[].downwardAPI.items[].resourceFieldRef.divisor
integer or string
可选
指定公开资源的输出格式,默认为“1”
additionalVolumes[].projected.sources[].downwardAPI.items[].resourceFieldRef.resource
string
必填
必需:要选择的资源
additionalVolumes[].projected.sources[].secret
object
可选
有关要投影的 Secret 数据的 Secret 信息
additionalVolumes[].projected.sources[].secret.items
list (object)
可选
项未指定,则引用的 Secret 的“Data”字段中的每个键值对都会作为文件投影到卷中,其中名称为键,内容为值。 如果指定,系统会将列出的键投影到指定的路径,并且不会显示未列出的键。如果指定的密钥未在 Secret 中,则卷设置将出错,除非将其标记为可选。路径必须是相对路径,不得包含“..”路径或以“..”开头。
additionalVolumes[].projected.sources[].secret.items[]
object
可选
将字符串键映射到卷中的路径。
additionalVolumes[].projected.sources[].secret.items[].key
string
必填
key 是项目的键。
additionalVolumes[].projected.sources[].secret.items[].mode
integer
可选
mode(模式)是可选的:用于设置此文件权限的模式位。 必须是介于 0000 到 0777 之间的八进制值,或介于 0 到 511 之间的十进制值。YAML 接受八进制和十进制值,JSON 则要求模式位使用十进制值。如果未指定,系统将使用音量 defaultMode。这可能会与影响文件模式的其他选项(例如 fsGroup)冲突,结果可能会是设置其他模式位。
additionalVolumes[].projected.sources[].secret.items[].path
string
必填
path 是要将密钥映射到的文件的相对路径。不得是绝对路径。不得包含路径元素“..”。不得以字符串“..”开头。
additionalVolumes[].projected.sources[].secret.name
string
可选
被指称对象的名称。更多信息: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
additionalVolumes[].projected.sources[].secret.optional
boolean
可选
可选字段,用于指定是否必须定义 Secret 或其密钥
additionalVolumes[].projected.sources[].serviceAccountToken
object
可选
serviceAccountToken 是与要投射的 serviceAccountToken 数据相关的信息
additionalVolumes[].projected.sources[].serviceAccountToken.audience
string
可选
audience 是令牌的目标受众群体。令牌的接收方必须使用令牌受众群体中指定的标识符来标识自己,否则应拒绝令牌。受众群体默认为 apiserver 的标识符。
additionalVolumes[].projected.sources[].serviceAccountToken.expirationSeconds
integer
可选
expirationSeconds 是请求的服务账号令牌有效时长。当令牌即将过期时,kubelet 卷插件会主动轮替服务账号令牌。如果令牌已过有效期的 80%,或者令牌已过 24 小时,kubelet 将开始尝试轮替令牌。默认为 1 小时,且必须至少为 10 分钟。
additionalVolumes[].projected.sources[].serviceAccountToken.path
string
必填
path 是相对于要将令牌投影到的文件的挂载点的路径。
additionalVolumes[].quobyte
object
可选
quobyte 表示主机上与 Pod 共享生命周期的 Quobyte 挂载
additionalVolumes[].quobyte.group
string
可选
将群组映射到“默认”的音量访问权限为“无群组”
additionalVolumes[].quobyte.readOnly
boolean
可选
此处的 readOnly 将强制以只读权限装载 Quobyte 卷。默认值为 false。
additionalVolumes[].quobyte.registry
string
必填
registry 表示一个或多个 Quobyte Registry 服务,以字符串的形式指定为主机:端口对(多个条目以英文逗号分隔),充当卷的中央注册表
additionalVolumes[].quobyte.tenant
string
可选
后端中拥有给定 Quobyte 卷的租户。与动态预配的 Quobyte 卷搭配使用,值由插件设置
additionalVolumes[].quobyte.user
string
可选
user 用于将卷访问权限映射到 默认为 serivceaccount 用户
additionalVolumes[].quobyte.volume
string
必填
volume 是一个字符串,用于按名称引用已创建的 Quobyte 卷。
additionalVolumes[].rbd
object
可选
rbd 表示在主机上共享 Pod 生命周期的 Rados 块设备挂载。更多信息:https://examples.k8s.io/volumes/rbd/README.md
additionalVolumes[].rbd.fsType
string
可选
fsType 是您要挂载的卷的文件系统类型。提示:确保主机操作系统支持文件系统类型。示例:“ext4”“xfs”“ntfs”。如果未指定,则隐式推断为“ext4”。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#rbd
additionalVolumes[].rbd.image
string
必填
image 是 Rados 映像名称。更多信息:https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
additionalVolumes[].rbd.keyring
string
可选
keyring 是 RBDUser 的密钥环路径。 默认值为 /etc/ceph/keyring。更多信息:https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
additionalVolumes[].rbd.monitors
list (string)
必填
monitors 是 Ceph 监控器的集合。 更多信息:https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
additionalVolumes[].rbd.monitors[]
string
可选
additionalVolumes[].rbd.pool
string
可选
pool 是 Rados 存储池名称。默认值为 rbd。 更多信息:https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
additionalVolumes[].rbd.readOnly
boolean
可选
此处的 readOnly 将强制在 VolumeMounts 中设置 ReadOnly。默认值为 false。更多信息:https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
additionalVolumes[].rbd.secretRef
object
可选
secretRef 是 RBDUser 的身份验证 Secret 的名称。如果提供,则会替换 keyring。默认值为 nil。更多信息:https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
additionalVolumes[].rbd.secretRef.name
string
可选
被指称对象的名称。更多信息:https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
additionalVolumes[].rbd.user
string
可选
user 是 Rados 用户名。默认值为“admin”。 更多信息:https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
additionalVolumes[].scaleIO
object
可选
scaleIO 表示已附加到 Kubernetes 节点并在其上挂载的 ScaleIO 永久性卷。
additionalVolumes[].scaleIO.fsType
string
可选
fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。 例如:“ext4”“xfs”“ntfs”。默认值为“xfs”。
additionalVolumes[].scaleIO.gateway
string
必填
gateway 是 ScaleIO API Gateway 的主机地址。
additionalVolumes[].scaleIO.protectionDomain
string
可选
protectionDomain 是配置的存储空间的 ScaleIO Protection Domain 的名称。
additionalVolumes[].scaleIO.readOnly
boolean
可选
readOnly 默认为 false(读写)。此处的 ReadOnly 将强制使用 VolumeMounts 中的 ReadOnly 设置。
additionalVolumes[].scaleIO.secretRef
object
必填
secretRef 引用 ScaleIO 用户和其他敏感信息的 Secret。如果未提供此参数,登录操作将失败。
additionalVolumes[].scaleIO.secretRef.name
string
可选
被指称对象的名称。更多信息:https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
additionalVolumes[].scaleIO.sslEnabled
boolean
可选
sslEnabled 标志用于启用/停用与网关的 SSL 通信,默认为 false
additionalVolumes[].scaleIO.storageMode
string
可选
storageMode 表示卷的存储空间应采用 ThickProvisioned 还是 ThinProvisioned。 默认值为 ThinProvisioned。
additionalVolumes[].scaleIO.storagePool
string
可选
storagePool 是与保护网域关联的 ScaleIO 存储池。
additionalVolumes[].scaleIO.system
string
必填
system 是 ScaleIO 中配置的存储系统的名称。
additionalVolumes[].scaleIO.volumeName
TYPE
可选
volumeName 是指在 ScaleIO 系统中已创建且与此卷来源关联的卷的名称。
additionalVolumes[].secret
object
可选
secret 表示应填充此卷的 Secret。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#secret
additionalVolumes[].secret.defaultMode
integer
可选
defaultMode(默认模式)是可选的:默认情况下,用于设置所创建文件的权限的模式位。必须是介于 0000 到 0777 之间的八进制值,或介于 0 到 511 之间的十进制值。YAML 接受八进制和十进制值,JSON 则要求模式位使用十进制值。默认值为 0644。路径中的目录不受此设置的影响。这可能会与影响文件模式的其他选项(例如 fsGroup)冲突,结果可能是设置其他模式位。
additionalVolumes[].secret.items
list (object)
可选
项。如果未指定,则引用的 Secret 的“Data”字段中的每个键值对都将投影到卷中,作为文件存在,其中名称为键,内容为值。如果指定,系统会将列出的密钥投影到指定的路径,并且不会显示未列出的密钥。如果指定的密钥未在 Secret 中,除非将其标记为可选,否则卷设置将出错。路径必须是相对路径,不得包含“..”路径或以“..”开头。
additionalVolumes[].secret.items[]
object
可选
将字符串键映射到卷中的路径。
additionalVolumes[].secret.items[].key
string
必填
key 是项目的键。
additionalVolumes[].secret.items[].mode
integer
可选
mode(模式)是可选的:用于设置此文件权限的模式位。必须是介于 0000 到 0777 之间的八进制值,或介于 0 到 511 之间的十进制值。YAML 接受八进制和十进制值,JSON 则要求模式位使用十进制值。如果未指定,系统将使用音量 defaultMode。 这可能会与影响文件模式的其他选项(例如 fsGroup)冲突,结果可能会是设置其他模式位。
additionalVolumes[].secret.items[].path
string
必填
path 是要将密钥映射到的文件的相对路径。可以是相对路径,也可以是绝对路径。 不得包含路径元素“..”。不得以字符串“..”开头。
additionalVolumes[].secret.optional
boolean
可选
可选字段,用于指定是否必须定义 Secret 或其密钥
additionalVolumes[].secret.secretName
string
可选
secretName 是要使用的 pod 命名空间中的 Secret 的名称。更多信息:https://kubernetes.io/docs/concepts/storage/volumes#secret
additionalVolumes[].storageos
object
可选
storageOS 表示已附加到 Kubernetes 节点并在其上挂载的 StorageOS 卷。
additionalVolumes[].storageos.fsType
string
可选
fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。 例如:“ext4”“xfs”“ntfs”。如果未指定,则隐式推断为“ext4”。
additionalVolumes[].storageos.readOnly
boolean
可选
readOnly 默认为 false(读写)。此处的 ReadOnly 将强制使用 VolumeMounts 中的 ReadOnly 设置。
additionalVolumes[].storageos.secretRef
object
可选
secretRef 用于指定用于获取 StorageOS API 凭据的 Secret。如果未指定,系统会尝试使用默认值。
additionalVolumes[].storageos.secretRef.name
string
可选
被指称对象的名称。更多信息:https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
additionalVolumes[].storageos.volumeName
string
可选
volumeName 是 StorageOS 卷的直观易懂的名称。卷名称仅在命名空间内保持唯一性。
additionalVolumes[].storageos.volumeNamespace
string
可选
volumeNamespace 用于指定 StorageOS 中卷的范围。如果未指定命名空间,则使用 Pod 的命名空间。这样,Kubernetes 名称级范围便可在 StorageOS 中镜像,以实现更紧密的集成。将 VolumeName 设置为任何名称可替换默认行为。如果您未在 StorageOS 中使用命名空间,请将其设置为“default”。系统会创建 StorageOS 中不存在的命名空间。
additionalVolumes[].vsphereVolume
object
可选
vsphereVolume 表示已挂接到 kubelet 主机并在其上挂载的 vSphere 卷
additionalVolumes[].vsphereVolume.fsType
string
可选
fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。 例如:“ext4”“xfs”“ntfs”。如果未指定,则隐式推断为“ext4”。
additionalVolumes[].vsphereVolume.storagePolicyID
string
可选
storagePolicyID 是与 StoragePolicyName 关联的基于存储空间政策的管理 (SPBM) 配置文件 ID。
additionalVolumes[].vsphereVolume.storagePolicyName
string
可选
storagePolicyName 是基于存储空间政策的管理 (SPBM) 配置文件名称。
additionalVolumes[].vsphereVolume.volumePath
string
必填
volumePath 是用于标识 vSphere 卷 vmdk 的路径
sidecars
list (object)
可选
Sidecar 指定要注入到数据库 pod 中的边车容器列表。如需了解详情,请参阅 https://kubernetes.io/docs/concepts/containers/。
sidecars[]
object
可选
您要在 pod 中运行的单个应用容器。
sidecars[].args
list (string)
可选
入口点的参数。如果未提供该值,系统会使用容器映像的 CMD。系统会使用容器的环境来展开变量引用 $(VAR_NAME)。如果无法解析变量,输入字符串中的引用将保持不变。Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax:; on other words, "$$(VAR_NAME)" 将生成字符串字面量“$(VAR_NAME)”。无论变量是否存在,转义引用都不会展开。无法更新。更多信息:https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
sidecars[].args[]
string
可选
sidecars[].command
list (string)
可选
入口点数组。不会在 shell 中执行。 如果未提供此值,系统会使用容器映像的 ENTRYPOINT。 系统会使用容器的环境来展开变量引用 $(VAR_NAME)。如果无法解析变量,输入字符串中的引用将保持不变。Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax; in other words, "$$(VAR_NAME)" 将生成字符串字面量“$(VAR_NAME)"。 无论变量是否存在,转义的引用都不会展开。无法更新。更多信息:https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
sidecars[].command[]
string
可选
sidecars[].env
list (object)
可选
要在容器中设置的环境变量列表。 无法更新。
sidecars[].env[]
object
可选
EnvVar 表示容器中存在的环境变量。
sidecars[].env[].name
string
必填
环境变量的名称。必须是 C_IDENTIFIER。
sidecars[].env[].value
string
可选
系统会使用容器中之前定义的环境变量以及任何服务环境变量来展开变量引用 $(VAR_NAME)。 如果无法解析变量,输入字符串中的引用将保持不变。Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax; in other words, "$$(VAR_NAME)" 将生成字符串字面量“$(VAR_NAME)"。无论变量是否存在,转义的引用都不会展开。默认值为“”。
sidecars[].env[].valueFrom
object
可选
环境变量值的来源。 如果值不为空,则无法使用。
sidecars[].env[].valueFrom.configMapKeyRef
object
可选
选择 ConfigMap 的键。
sidecars[].env[].valueFrom.configMapKeyRef.key
string
必填
要选择的按键。
sidecars[].env[].valueFrom.configMapKeyRef.name
string
可选
被指称对象的名称。更多信息: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
sidecars[].env[].valueFrom.configMapKeyRef.optional
boolean
可选
指定是否必须定义 ConfigMap 或其键
sidecars[].env[].valueFrom.fieldRef
object
可选
选择 Pod 的字段:支持 metadata.name、metadata.namespace、metadata.labels['<KEY>']、metadata.annotations['<KEY>']、spec.nodeName、spec.serviceAccountName、status.hostIP、status.podIP、status.podIPs。
sidecars[].env[].valueFrom.fieldRef.apiVersion
string
可选
用于编写 FieldPath 的架构版本,默认为“v1”。
sidecars[].env[].valueFrom.fieldRef.fieldPath
string
必填
要在指定 API 版本中选择的字段的路径。
sidecars[].env[].valueFrom.resourceFieldRef
object
可选
选择容器的资源:仅支持资源限制和请求(limits.cpu、limits.memory、limits.ephemeral-storage、requests.cpu、requests.memory 和 requests.ephemeral-storage)。
sidecars[].env[].valueFrom.resourceFieldRef.containerName
string
可选
容器名称:对于卷是必需的,对于环境变量是可选的
sidecars[].env[].valueFrom.resourceFieldRef.divisor
integer or string
可选
指定公开资源的输出格式,默认为“1”
sidecars[].env[].valueFrom.resourceFieldRef.resource
string
必填
必填:要选择的资源
sidecars[].env[].valueFrom.secretKeyRef
object
可选
选择 pod 命名空间中的 Secret 的密钥
sidecars[].env[].valueFrom.secretKeyRef.key
string
必填
要从中选择的 Secret 的键。必须是有效的私钥。
sidecars[].env[].valueFrom.secretKeyRef.name
string
可选
被指称对象的名称。更多信息: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
sidecars[].env[].valueFrom.secretKeyRef.optional
boolean
可选
指定是否必须定义 Secret 或其密钥
sidecars[].envFrom
list (object)
可选
用于在容器中填充环境变量的来源列表。在来源中定义的键必须是 C_IDENTIFIER。容器启动时,所有无效键都会报告为事件。如果某个键存在于多个来源中,则与最后一个来源关联的值将优先。具有重复键的 Env 定义的值将优先。无法更新。
sidecars[].envFrom[]
object
可选
EnvFromSource 表示一组 ConfigMap 的来源
sidecars[].envFrom[].configMapRef
object
可选
要从中选择的 ConfigMap
sidecars[].envFrom[].configMapRef.name
string
可选
被指称对象的名称。更多信息:https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
sidecars[].envFrom[].configMapRef.optional
boolean
可选
指定是否必须定义 ConfigMap
sidecars[].envFrom[].prefix
string
可选
可选标识符,用于附加到 ConfigMap 中的每个键。必须是 C_IDENTIFIER。
sidecars[].envFrom[].secretRef
object
可选
要从中选择的 Secret
sidecars[].envFrom[].secretRef.name
string
可选
被指称对象的名称。更多信息:https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
sidecars[].envFrom[].secretRef.optional
boolean
可选
指定是否必须定义 Secret
sidecars[].image
string
可选
容器映像名称。更多信息:https://kubernetes.io/docs/concepts/containers/images 此字段是可选字段,可让更高级别的配置管理在工作负载控制器(如部署和 StatefulSet)中默认或替换容器映像。
sidecars[].imagePullPolicy
string
可选
映像拉取政策。可选值包括 Always、Never 和 IfNotPresent。 如果指定了 :{{ .Chart.Version }} 标记,则默认为 Always;否则默认为 IfNotPresent。无法更新。更多信息:https://kubernetes.io/docs/concepts/containers/images#updating-images
sidecars[].lifecycle
object
可选
管理系统应在响应容器生命周期事件时执行的操作。无法更新。
sidecars[].lifecycle.postStart
object
可选
系统会在创建容器后立即调用 PostStart。如果处理程序失败,容器会终止并根据其重启政策重启。容器的其他管理会被阻塞,直到钩子完成。更多信息:https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
sidecars[].lifecycle.postStart.exec
object
可选
Exec 用于指定要执行的操作。
sidecars[].lifecycle.postStart.exec.command
list (string)
可选
命令是指要在容器内执行的命令行,该命令的工作目录是容器文件系统中的根目录 (/)。该命令会被执行,而不是在 shell 中运行,因此标准 shell 指令(“|”等)不起作用。如需使用某个 shell,您需要显式调用该 shell。退出状态为 0 表示运行/正常,非零表示不正常。
sidecars[].lifecycle.postStart.exec.command[]
string
可选
sidecars[].lifecycle.postStart.httpGet
object
可选
HTTPGet 用于指定要执行的 HTTP 请求。
sidecars[].lifecycle.postStart.httpGet.host
string
可选
要连接的主机名,默认为 pod IP。您可能需要改为在 httpHeaders 中设置“Host”。
sidecars[].lifecycle.postStart.httpGet.httpHeaders
list (object)
可选
要在请求中设置的自定义标头。 HTTP 允许使用重复的标头。
sidecars[].lifecycle.postStart.httpGet.httpHeaders[]
object
可选
HTTPHeader 用于描述要在 HTTP 探测中使用的自定义标头
sidecars[].lifecycle.postStart.httpGet.httpHeaders[].name
string
必填
标头字段名称。系统会在输出时对其进行规范化处理,因此大小写变体名称将被视为同一标头。
sidecars[].lifecycle.postStart.httpGet.httpHeaders[].value
string
必填
标头字段值
sidecars[].lifecycle.postStart.httpGet.path
string
可选
HTTP 服务器上的访问路径。
sidecars[].lifecycle.postStart.httpGet.port
integer or string
必填
要访问容器上的端口的名称或编号。数字必须介于 1 到 65535 之间。名称必须是 IANA_SVC_NAME。
sidecars[].lifecycle.postStart.httpGet.scheme
string
可选
用于连接到主机的架构。默认为 HTTP。
sidecars[].lifecycle.postStart.tcpSocket
object
可选
已弃用。TCPSocket 不支持用作 LifecycleHandler,但保留了它以实现向后兼容性。 系统不会对此字段进行验证,并且在指定 tcp 处理程序后,生命周期钩子将在运行时失败。
sidecars[].lifecycle.postStart.tcpSocket.host
string
可选
可选:要连接到的的主机名,默认为 Pod IP。
sidecars[].lifecycle.postStart.tcpSocket.port
integer or string
必填
要在容器上访问的端口的编号或名称。数字必须介于 1 到 65535 之间。名称必须是 IANA_SVC_NAME。
sidecars[].lifecycle.preStop
object
可选
在容器因 API 请求或管理事件(例如活跃性/启动探测失败、抢占和资源争用)而终止之前,系统会立即调用 PreStop。如果容器崩溃或退出,系统不会调用处理程序。在执行 PreStop 钩子之前,Pod 的终止宽限期倒计时便会开始。 无论处理程序的结果如何,容器最终都会在 Pod 的终止宽限期内终止(除非被终结器延迟)。容器的其他管理操作会被阻塞,直到钩子完成或达到终止宽限期。更多信息:https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
sidecars[].lifecycle.preStop.exec
object
可选
Exec 用于指定要执行的操作。
sidecars[].lifecycle.preStop.exec.command
list (string)
可选
命令是指要在容器内执行的命令行,该命令的工作目录是容器文件系统中的根目录 (/)。该命令只是被执行,而不是在 shell 中运行,因此传统的 shell 指令(“|”等)不起作用。如需使用某个 shell,您需要显式调用该 shell。退出状态为 0 表示运行/正常,非零表示不正常。
sidecars[].lifecycle.preStop.exec.command[]
string
可选
sidecars[].lifecycle.preStop.httpGet
object
可选
HTTPGet 用于指定要执行的 HTTP 请求。
sidecars[].lifecycle.preStop.httpGet.host
string
可选
要连接的主机名,默认为 pod IP。您可能需要改为在 httpHeaders 中设置“Host”。
sidecars[].lifecycle.preStop.httpGet.httpHeaders
list (object)
可选
要在请求中设置的自定义标头。 HTTP 允许使用重复的标头。
sidecars[].lifecycle.preStop.httpGet.httpHeaders[]
object
可选
HTTPHeader 用于描述要在 HTTP 探测中使用的自定义标头
sidecars[].lifecycle.preStop.httpGet.httpHeaders[].name
string
必填
标头字段名称。系统会在输出时对其进行规范化处理,因此大小写变体名称将被视为同一标头。
sidecars[].lifecycle.preStop.httpGet.httpHeaders[].value
string
必填
标头字段值
sidecars[].lifecycle.preStop.httpGet.path
string
可选
HTTP 服务器上的访问路径。
sidecars[].lifecycle.preStop.httpGet.port
integer or string
必填
要访问容器上的端口的名称或编号。数字必须介于 1 到 65535 之间。名称必须是 IANA_SVC_NAME。
sidecars[].lifecycle.preStop.httpGet.scheme
string
可选
用于连接到主机的架构。默认为 HTTP。
sidecars[].lifecycle.preStop.tcpSocket
object
可选
已弃用。TCPSocket 不支持用作 LifecycleHandler,但保留了它以实现向后兼容性。 系统不会对此字段进行验证,并且在指定 tcp 处理程序后,生命周期钩子将在运行时失败。
sidecars[].lifecycle.preStop.tcpSocket.host
string
可选
可选:要连接到的的主机名,默认为 Pod IP。
sidecars[].lifecycle.preStop.tcpSocket.port
integer or string
必填
要在容器上访问的端口的编号或名称。数字必须介于 1 到 65535 之间。名称必须是 IANA_SVC_NAME。
sidecars[].livenessProbe
object
可选
定期探测容器活跃性。如果探测失败,容器将重启。无法更新。更多信息:https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
sidecars[].livenessProbe.exec
object
可选
Exec 用于指定要执行的操作。
sidecars[].livenessProbe.exec.command
list (string)
可选
命令是指要在容器内执行的命令行,该命令的工作目录为容器文件系统中的根目录 (/)。 该命令会被执行,而不是在 shell 中运行,因此标准 shell 指令(“|”等)不起作用。如需使用某个 shell,您需要显式调用该 shell。退出状态为 0 表示正常运行/健康,非零表示不健康。
sidecars[].livenessProbe.exec.command[]
string
可选
sidecars[].livenessProbe.failureThreshold
integer
可选
探测在成功后被视为失败所需的连续失败次数下限。默认值为 3。最小值为 1。
sidecars[].livenessProbe.grpc
object
可选
GRPC 指定涉及 GRPC 端口的操作。
sidecars[].livenessProbe.grpc.port
integer
必填
gRPC 服务的端口号。数字必须介于 1 到 65535 之间。
sidecars[].livenessProbe.grpc.service
string
可选
Service 是指要放入 gRPC HealthCheckRequest 中的服务的名称(请参阅 https://github.com/grpc/grpc/blob/master/doc/health-checking.md)。 \n 如果未指定此值,则默认行为由 gRPC 定义。
sidecars[].livenessProbe.httpGet
object
可选
HTTPGet 用于指定要执行的 HTTP 请求。
sidecars[].livenessProbe.httpGet.host
string
可选
要连接的主机名,默认为 Pod IP。您可能需要改为在 httpHeaders 中设置“Host”。
sidecars[].livenessProbe.httpGet.httpHeaders
list (object)
可选
要在请求中设置的自定义标头。HTTP 允许使用重复的标头。
sidecars[].livenessProbe.httpGet.httpHeaders[]
object
可选
HTTPHeader 用于描述要在 HTTP 探测中使用的自定义标头
sidecars[].livenessProbe.httpGet.httpHeaders[].name
string
必填
标头字段名称。系统会在输出时对其进行规范化处理,因此大小写变体名称将被视为同一标头。
sidecars[].livenessProbe.httpGet.httpHeaders[].value
string
必填
标头字段值
sidecars[].livenessProbe.httpGet.path
string
可选
HTTP 服务器上的访问路径。
sidecars[].livenessProbe.httpGet.port
integer or string
必填
要访问容器上的端口的名称或编号。数字必须介于 1 到 65535 之间。 名称必须是 IANA_SVC_NAME。
sidecars[].livenessProbe.httpGet.scheme
string
可选
用于连接到主机的架构。 默认为 HTTP。
sidecars[].livenessProbe.initialDelaySeconds
integer
可选
容器启动后,在启动活跃探测之前经过的秒数。更多信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
sidecars[].livenessProbe.periodSeconds
integer
可选
执行探测的频率(以秒为单位)。 默认为 10 秒。最小值为 1。
sidecars[].livenessProbe.successThreshold
integer
可选
探测在失败后被视为成功所需的连续成功次数下限。默认值为 1。对于活跃性和启动,必须为 1。最小值为 1。
sidecars[].livenessProbe.tcpSocket
object
可选
TCPSocket 用于指定涉及 TCP 端口的操作。
sidecars[].livenessProbe.tcpSocket.host
string
可选
可选:要连接到的的主机名,默认为 Pod IP。
sidecars[].livenessProbe.tcpSocket.port
integer or string
必填
要在容器上访问的端口的编号或名称。数字必须介于 1 到 65535 之间。 名称必须是 IANA_SVC_NAME。
sidecars[].livenessProbe.terminationGracePeriodSeconds
integer
可选
可选时长(以秒为单位),表示在探测失败后 Pod 需要正常终止的时长。宽限期是指向 Pod 中运行的进程发送终止信号后,到使用终止信号强制停止这些进程之间的时长(以秒为单位)。将此值设置为长于进程的预期清理时间。如果此值为 nil,则系统将使用 pod 的 terminationGracePeriodSeconds。否则,此值会替换 pod 规范提供的值。值必须为非负整数。值零表示使用终止信号立即停止(没有机会关闭)。此字段处于 Beta 版阶段,需要启用 ProbeTerminationGracePeriod 功能门限。最小值为 1。如果未设置,则使用 spec.terminationGracePeriodSeconds。
sidecars[].livenessProbe.timeoutSeconds
integer
可选
探测的超时秒数。默认为 1 秒。最小值为 1。更多信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
sidecars[].name
string
必填
指定为 DNS_LABEL 的容器的名称。 pod 中的每个容器都必须具有唯一的名称 (DNS_LABEL)。 无法更新。
sidecars[].ports
list (object)
可选
要从容器公开的端口列表。在此处不指定端口并不会阻止该端口被公开。容器中侦听默认“0.0.0.0”地址的任何端口都可以从网络访问。 使用策略性合并补丁修改此数组可能会损坏数据。如需了解详情,请参阅 https://github.com/kubernetes/kubernetes/issues/108255。 无法更新。
sidecars[].ports[]
object
可选
ContainerPort 表示单个容器中的网络端口。
sidecars[].ports[].containerPort
integer
必填
要在 Pod 的 IP 地址上公开的端口数量。此值必须是有效的端口号,且 x 应介于 0 到 65536 之间。
sidecars[].ports[].hostIP
string
可选
要将外部端口绑定到的哪个主机 IP。
sidecars[].ports[].hostPort
integer
可选
要在主机上公开的端口数量。如果指定,此值必须为有效的端口号,即 0 < x < 65536。如果指定了 HostNetwork,则此值必须与 ContainerPort 相匹配。大多数容器不需要这样做。
sidecars[].ports[].name
string
可选
如果指定,此值必须为 IANA_SVC_NAME,并且在 pod 中是唯一的。pod 中的每个命名端口都必须具有唯一的名称。端口的名称,可供服务引用。
sidecars[].ports[].protocol
string
可选

默认值:TCP

端口的协议。必须是 UDP、TCP 或 SCTP。 默认值为“TCP”。
sidecars[].readinessProbe
object
可选
定期探测容器服务就绪性。 如果探测失败,则容器将从服务端点中移除。无法更新。更多信息:https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
sidecars[].readinessProbe.exec
object
可选
Exec 用于指定要执行的操作。
sidecars[].readinessProbe.exec.command
list (string)
可选
命令是指要在容器内执行的命令行,该命令的工作目录为容器文件系统中的根目录 (/)。 该命令是被执行的,而不是在 shell 中运行的,因此标准 shell 指令(“|”等)不起作用。如需使用某个 shell,您需要显式调用该 shell。退出状态为 0 表示正常运行/健康,非零表示不健康。
sidecars[].readinessProbe.exec.command[]
string
可选
sidecars[].readinessProbe.failureThreshold
integer
可选
探测在成功后被视为失败所需的连续失败次数下限。默认值为 3。最小值为 1。
sidecars[].readinessProbe.grpc
object
可选
GRPC 指定涉及 GRPC 端口的操作。
sidecars[].readinessProbe.grpc.port
integer
必填
gRPC 服务的端口号。数字必须介于 1 到 65535 之间。
sidecars[].readinessProbe.grpc.service
string
可选
Service 是指要放入 gRPC HealthCheckRequest 中的服务的名称(请参阅 https://github.com/grpc/grpc/blob/master/doc/health-checking.md)。 \n 如果未指定此值,则默认行为由 gRPC 定义。
sidecars[].readinessProbe.httpGet
object
可选
HTTPGet 用于指定要执行的 HTTP 请求。
sidecars[].readinessProbe.httpGet.host
string
可选
要连接的主机名,默认为 Pod IP。您可能需要改为在 httpHeaders 中设置“Host”。
sidecars[].readinessProbe.httpGet.httpHeaders
list (object)
可选
要在请求中设置的自定义标头。HTTP 允许使用重复的标头。
sidecars[].readinessProbe.httpGet.httpHeaders[]
object
可选
HTTPHeader 用于描述要在 HTTP 探测中使用的自定义标头
sidecars[].readinessProbe.httpGet.httpHeaders[].name
string
必填
标头字段名称。系统会在输出时对其进行规范化处理,因此大小写变体名称将被视为同一标头。
sidecars[].readinessProbe.httpGet.httpHeaders[].value
string
必填
标头字段值
sidecars[].readinessProbe.httpGet.path
string
可选
HTTP 服务器上的访问路径。
sidecars[].readinessProbe.httpGet.port
integer or string
必填
要访问容器上的端口的名称或编号。数字必须介于 1 到 65535 之间。 名称必须是 IANA_SVC_NAME。
sidecars[].readinessProbe.httpGet.scheme
string
可选
用于连接到主机的架构。 默认为 HTTP。
sidecars[].readinessProbe.initialDelaySeconds
integer
可选
容器启动后,在启动活跃探测之前经过的秒数。更多信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
sidecars[].readinessProbe.periodSeconds
integer
可选
执行探测的频率(以秒为单位)。 默认为 10 秒。最小值为 1。
sidecars[].readinessProbe.successThreshold
integer
可选
探测在失败后被视为成功所需的连续成功次数下限。默认值为 1。对于活跃性和启动,必须为 1。最小值为 1。
sidecars[].readinessProbe.tcpSocket
object
可选
TCPSocket 用于指定涉及 TCP 端口的操作。
sidecars[].readinessProbe.tcpSocket.host
string
可选
可选:要连接到的的主机名,默认为 Pod IP。
sidecars[].readinessProbe.tcpSocket.port
integer or string
必填
要在容器上访问的端口的编号或名称。数字必须介于 1 到 65535 之间。 名称必须是 IANA_SVC_NAME。
sidecars[].readinessProbe.terminationGracePeriodSeconds
integer
可选
可选时长(以秒为单位),表示在探测失败后 Pod 需要正常终止的时长。宽限期是指向 Pod 中运行的进程发送终止信号后,到使用终止信号强制停止这些进程之间的时长(以秒为单位)。将此值设置为长于进程的预期清理时间。如果此值为 nil,则系统将使用 pod 的 terminationGracePeriodSeconds。否则,此值会替换 pod 规范提供的值。值必须为非负整数。值零表示使用终止信号立即停止(没有机会关闭)。此字段处于 Beta 版阶段,需要启用 ProbeTerminationGracePeriod 功能门限。最小值为 1。如果未设置,则使用 spec.terminationGracePeriodSeconds。
sidecars[].readinessProbe.timeoutSeconds
integer
可选
探测的超时秒数。默认为 1 秒。最小值为 1。更多信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
sidecars[].resizePolicy
list (object)
可选
容器的资源调整大小政策。
sidecars[].resizePolicy[]
object
可选
ContainerResizePolicy 表示容器的资源调整大小政策。
sidecars[].resizePolicy[].resourceName
string
必填
此资源大小调整政策适用的资源的名称。支持的值:cpu、内存。
sidecars[].resizePolicy[].restartPolicy
string
必填
在调整指定资源大小时要应用的重启政策。如果未指定,则默认为 NotRequired。
sidecars[].resources
object
可选
此容器所需的计算资源。 无法更新。更多信息:https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
sidecars[].resources.claims
list (object)
可选
claims 列出了此容器使用的 spec.resourceClaims 中定义的资源名称。 \n 此字段处于 Alpha 版阶段,需要启用 DynamicResourceAllocation 特性门控。\n 此字段不可更改。此属性只能为容器设置。
sidecars[].resources.claims[]
object
可选
ResourceClaim 引用 PodSpec.ResourceClaims 中的条目。
sidecars[].resources.claims[].name
string
必填
名称必须与使用此字段的 Pod 的 pod.spec.resourceClaims 中的某个条目的名称一致。它可使该资源在容器内可用。
sidecars[].resources.limits
integer or string
可选
限制描述允许的计算资源数量上限。更多信息:https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
sidecars[].resources.requests
integer or string
可选
请求描述所需的最低计算资源量。如果为容器省略了“请求”,则默认为“限制”(如果明确指定了),否则为实现定义的值。请求不得超出限制。更多信息:https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
sidecars[].restartPolicy
string
可选
RestartPolicy 用于定义 pod 中各个容器的重启行为。此字段只能为初始化容器设置,且唯一允许的值为“Always”。 对于非初始化容器或未指定此字段时,重启行为由 Pod 的重启政策和容器类型定义。为 init 容器将 RestartPolicy 设置为“Always”将产生以下影响:此 init 容器将在退出时持续重启,直到所有常规容器都终止。所有常规容器完成后,所有 restartPolicy 为“Always”的初始化容器都将关闭。此生命周期不同于常规的 init 容器,通常称为“侧边容器”。 虽然此 init 容器仍会在 init 容器序列中启动,但它不会等待该容器完成,而是会直接进入下一个 init 容器。而是在该 init 容器启动后或任何 startupProbe 成功完成后立即启动下一个 init 容器。
sidecars[].securityContext
object
可选
SecurityContext 用于定义容器应采用的安全选项。如果设置,SecurityContext 的字段会替换 PodSecurityContext 的等效字段。更多信息:https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
sidecars[].securityContext.allowPrivilegeEscalation
boolean
可选
AllowPrivilegeEscalation 用于控制进程能否获得比其父进程更多的权限。 此布尔值直接控制是否将 no_new_privs 标志设置在容器进程上。当容器满足以下条件时,AllowPrivilegeEscalation 始终为 true:1) 以特权身份运行 2) 具有 CAP_SYS_ADMIN。请注意,当 spec.os.name 为 windows 时,无法设置此字段。
sidecars[].securityContext.capabilities
object
可选
运行容器时可添加/移除的功能。 默认为容器运行时授予的一组默认功能。请注意,当 spec.os.name 为 windows 时,无法设置此字段。
sidecars[].securityContext.capabilities.add
list (string)
可选
添加了功能
sidecars[].securityContext.capabilities.add[]
string
可选
Capability 表示 POSIX Capability 类型
sidecars[].securityContext.capabilities.drop
list (string)
可选
已移除的功能
sidecars[].securityContext.capabilities.drop[]
string
可选
Capability 表示 POSIX Capability 类型
sidecars[].securityContext.privileged
boolean
可选
在特权模式下运行容器。特权容器中的进程在本质上等同于主机上的 root 用户。默认值为 false。请注意,当 spec.os.name 为 windows 时,无法设置此字段。
sidecars[].securityContext.procMount
string
可选
procMount 表示要为容器使用的 proc 挂载类型。默认值为 DefaultProcMount,它会针对只读路径和屏蔽路径使用容器运行时默认值。这需要启用 ProcMountType 功能标志。请注意,当 spec.os.name 为 windows 时,无法设置此字段。
sidecars[].securityContext.readOnlyRootFilesystem
boolean
可选
此容器是否具有只读根文件系统。默认值为 False。请注意,当 spec.os.name 为 windows 时,无法设置此字段。
sidecars[].securityContext.runAsGroup
integer
可选
用于运行容器进程入口点的 GID。如果未设置,则使用运行时默认值。也可以在 PodSecurityContext 中进行设置。如果同时在 SecurityContext 和 PodSecurityContext 中设置,则 SecurityContext 中指定的值优先。请注意,当 spec.os.name 为 windows 时,无法设置此字段。
sidecars[].securityContext.runAsNonRoot
boolean
可选
表示容器必须以非根用户身份运行。如果为 true,Kubelet 将在运行时验证映像,以确保其不会以 UID 0(root)运行,如果以 UID 0 运行,则会导致容器启动失败。如果未设置或为 false,则不会执行此类验证。 也可以在 PodSecurityContext 中进行设置。如果同时在 SecurityContext 和 PodSecurityContext 中设置,则 SecurityContext 中指定的值优先。
sidecars[].securityContext.runAsUser
integer
可选
用于运行容器进程入口点的 UID。如果未指定,则默认为图片元数据中指定的用户。也可以在 PodSecurityContext 中进行设置。如果同时在 SecurityContext 和 PodSecurityContext 中设置,则 SecurityContext 中指定的值优先。请注意,当 spec.os.name 为 windows 时,无法设置此字段。
sidecars[].securityContext.seLinuxOptions
object
可选
要应用于容器的 SELinux 上下文。 如果未指定,容器运行时将为每个容器分配随机 SELinux 上下文。也可以在 PodSecurityContext 中进行设置。如果同时在 SecurityContext 和 PodSecurityContext 中设置,则 SecurityContext 中指定的值优先。请注意,当 spec.os.name 为 windows 时,无法设置此字段。
sidecars[].securityContext.seLinuxOptions.level
string
可选
级别是适用于容器的 SELinux 级别标签。
sidecars[].securityContext.seLinuxOptions.role
string
可选
角色是应用于容器的 SELinux 角色标签。
sidecars[].securityContext.seLinuxOptions.type
string
可选
Type 是适用于容器的 SELinux 类型标签。
sidecars[].securityContext.seLinuxOptions.user
string
可选
“用户”是适用于容器的 SELinux 用户标签。
sidecars[].securityContext.seccompProfile
object
可选
此容器要使用的 seccomp 选项。 如果在 pod 和容器级别都提供了 seccomp 选项,则容器选项会替换 pod 选项。 请注意,当 spec.os.name 为 windows 时,无法设置此字段。
sidecars[].securityContext.seccompProfile.localhostProfile
string
可选
localhostProfile 表示应使用节点上文件中定义的配置文件。必须先在节点上预配置该配置文件,才能正常运行。必须是相对于 kubelet 的配置 Seccomp 配置文件位置的向下路径。如果类型为“Localhost”,则必须设置此字段。 不得为任何其他类型设置。
sidecars[].securityContext.seccompProfile.type
string
必填
type 指明将应用哪种 seccomp 配置文件。有效选项包括:\n 本地主机 - 应使用节点上文件中定义的配置文件。RuntimeDefault - 应使用容器运行时默认配置文件。未受限 - 不应应用任何配置文件。
sidecars[].securityContext.windowsOptions
object
可选
应用于所有容器的 Windows 专用设置。如果未指定,则使用 PodSecurityContext 中的选项。如果同时在 SecurityContext 和 PodSecurityContext 中设置,则 SecurityContext 中指定的值优先。 请注意,当 spec.os.name 为 linux 时,无法设置此字段。
sidecars[].securityContext.windowsOptions.gmsaCredentialSpec
string
可选
GMSACredentialSpec 是 GMSA 准入 webhook (https://github.com/kubernetes-sigs/windows-gmsa) 将 GMSACredentialSpecName 字段命名的 GMSA 凭据规范的内容内嵌到其中的位置。
sidecars[].securityContext.windowsOptions.gmsaCredentialSpecName
string
可选
GMSACredentialSpecName 是要使用的 GMSA 凭据规范的名称。
sidecars[].securityContext.windowsOptions.hostProcess
boolean
可选
HostProcess 用于确定容器是否应以“Host Process”容器的身份运行。Pod 的所有容器都必须具有相同的有效 HostProcess 值(不允许混合使用 HostProcess 容器和非 HostProcess 容器)。此外,如果 HostProcess 为 true,则 HostNetwork 也必须设置为 true。
sidecars[].securityContext.windowsOptions.runAsUserName
string
可选
Windows 中的 UserName,用于运行容器进程的入口点。如果未指定,则默认为图片元数据中指定的用户。也可以在 PodSecurityContext 中进行设置。如果同时在 SecurityContext 和 PodSecurityContext 中设置,则 SecurityContext 中指定的值优先。
sidecars[].startupProbe
object
可选
StartupProbe 表示 Pod 已成功初始化。如果您指定了此标志,则只有在探测成功完成后,系统才会执行其他探测。如果此探测失败,Pod 将重启,就像 livenessProbe 失败一样。这可用于在 Pod 生命周期的开始(此时加载数据或预热缓存可能需要很长时间,而非在稳定状态下运行时)提供不同的探测参数。 此设置无法更新。更多信息:https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
sidecars[].startupProbe.exec
object
可选
Exec 用于指定要执行的操作。
sidecars[].startupProbe.exec.command
list (string)
可选
命令是指要在容器内执行的命令行,该命令的工作目录为容器文件系统中的根目录 (/)。 该命令会被执行,而不是在 shell 中运行,因此标准 shell 指令(“|”等)不起作用。如需使用某个 shell,您需要显式调用该 shell。退出状态为 0 表示正常运行/健康,非零表示不健康。
sidecars[].startupProbe.exec.command[]
string
可选
sidecars[].startupProbe.failureThreshold
integer
可选
探测在成功后被视为失败所需的连续失败次数下限。默认值为 3。最小值为 1。
sidecars[].startupProbe.grpc
object
可选
GRPC 指定涉及 GRPC 端口的操作。
sidecars[].startupProbe.grpc.port
integer
必填
gRPC 服务的端口号。数字必须介于 1 到 65535 之间。
sidecars[].startupProbe.grpc.service
string
可选
Service 是指要放入 gRPC HealthCheckRequest 中的服务的名称(请参阅 https://github.com/grpc/grpc/blob/master/doc/health-checking.md)。 \n 如果未指定此值,则默认行为由 gRPC 定义。
sidecars[].startupProbe.httpGet
object
可选
HTTPGet 用于指定要执行的 HTTP 请求。
sidecars[].startupProbe.httpGet.host
string
可选
要连接的主机名,默认为 Pod IP。您可能需要改为在 httpHeaders 中设置“Host”。
sidecars[].startupProbe.httpGet.httpHeaders
list (object)
可选
要在请求中设置的自定义标头。HTTP 允许使用重复的标头。
sidecars[].startupProbe.httpGet.httpHeaders[]
object
可选
HTTPHeader 用于描述要在 HTTP 探测中使用的自定义标头
sidecars[].startupProbe.httpGet.httpHeaders[].name
string
必填
标头字段名称。系统会在输出时对其进行规范化处理,因此大小写变体名称将被视为同一标头。
sidecars[].startupProbe.httpGet.httpHeaders[].value
string
必填
标头字段值
sidecars[].startupProbe.httpGet.path
string
可选
HTTP 服务器上的访问路径。
sidecars[].startupProbe.httpGet.port
integer or string
必填
要访问容器上的端口的名称或编号。数字必须介于 1 到 65535 之间。 名称必须是 IANA_SVC_NAME。
sidecars[].startupProbe.httpGet.scheme
string
可选
用于连接到主机的架构。 默认为 HTTP。
sidecars[].startupProbe.initialDelaySeconds
integer
可选
容器启动后,在启动活跃探测之前经过的秒数。更多信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
sidecars[].startupProbe.periodSeconds
integer
可选
执行探测的频率(以秒为单位)。 默认为 10 秒。最小值为 1。
sidecars[].startupProbe.successThreshold
integer
可选
探测在失败后被视为成功所需的连续成功次数下限。默认值为 1。对于活跃性和启动,必须为 1。最小值为 1。
sidecars[].startupProbe.tcpSocket
object
可选
TCPSocket 用于指定涉及 TCP 端口的操作。
sidecars[].startupProbe.tcpSocket.host
string
可选
可选:要连接到的的主机名,默认为 Pod IP。
sidecars[].startupProbe.tcpSocket.port
integer or string
必填
要在容器上访问的端口的编号或名称。数字必须介于 1 到 65535 之间。 名称必须是 IANA_SVC_NAME。
sidecars[].startupProbe.terminationGracePeriodSeconds
integer
可选
可选时长(以秒为单位),表示在探测失败后 Pod 需要正常终止的时长。宽限期是指向 Pod 中运行的进程发送终止信号后,到使用终止信号强制停止这些进程之间的时长(以秒为单位)。将此值设置为长于进程的预期清理时间。如果此值为 nil,则系统将使用 pod 的 terminationGracePeriodSeconds。否则,此值会替换 pod 规范提供的值。值必须为非负整数。值零表示使用终止信号立即停止(没有机会关闭)。此字段处于 Beta 版阶段,需要启用 ProbeTerminationGracePeriod 功能门限。最小值为 1。如果未设置,则使用 spec.terminationGracePeriodSeconds。
sidecars[].startupProbe.timeoutSeconds
integer
可选
探测的超时秒数。默认为 1 秒。最小值为 1。更多信息: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
sidecars[].stdin
boolean
可选
此容器是否应在容器运行时中为 stdin 分配缓冲区。如果不进行这项设置,则从容器中的 stdin 执行读取操作时始终会导致 EOF。默认值为 false。
sidecars[].stdinOnce
boolean
可选
容器运行时应在通过单次附加打开 stdin 通道后关闭该通道。 当 stdin 为 true 时,stdin 流将在多个附加会话中保持打开状态。如果 stdinOnce 设置为 true,stdin 会在容器启动时打开,并在第一个客户端附加到 stdin 之前保持空白状态,然后保持打开状态并接受数据,直到客户端断开连接为止。此时,stdin 会关闭,并保持关闭状态,直到容器重启。如果此标志为 false,则从 stdin 读取的容器进程将永远不会收到 EOF。默认值为 false
sidecars[].terminationMessagePath
string
可选
可选:将要将容器终止消息写入的文件装载到容器文件系统的路径。写入的消息应是简短的最终状态,例如断言失败消息。 如果大于 4096 字节,则会被节点截断。 所有容器中的消息总长度将限制为 12kb。默认为 /dev/termination-log。无法更新。
sidecars[].terminationMessagePolicy
string
可选
指明应如何填充终止消息。文件将使用 terminationMessagePath 的内容在成功和失败时填充容器状态消息。如果终止消息文件为空且容器因出错而退出,FallbackToLogsOnError 将使用容器日志输出的最后一部分。日志输出限制为 2048 字节或 80 行,以较小者为准。默认值为“File”。无法更新。
sidecars[].tty
boolean
可选
此容器是否应为自身分配 TTY,还需要“stdin”为 true。默认值为 false。
sidecars[].volumeDevices
list (object)
可选
volumeDevices 是容器要使用的块设备列表。
sidecars[].volumeDevices[]
object
可选
volumeDevice 用于描述容器内原始块设备的映射。
sidecars[].volumeDevices[].devicePath
string
必填
devicePath 是设备将映射到的容器内的路径。
sidecars[].volumeDevices[].name
string
必填
name 必须与 pod 中的 persistentVolumeClaim 的名称一致
sidecars[].volumeMounts
list (object)
可选
要装载到容器文件系统中的 Pod 卷。 无法更新。
sidecars[].volumeMounts[]
object
可选
VolumeMount 用于描述在容器中装载卷。
sidecars[].volumeMounts[].mountPath
string
必填
容器中应装载卷的路径。不得包含“:”。
sidecars[].volumeMounts[].mountPropagation
string
可选
mountPropagation 用于确定如何将挂载从主机传播到容器,反之亦然。如果未设置,则使用 MountPropagationNone。 此字段在 1.10 中处于 Beta 版阶段。
sidecars[].volumeMounts[].name
string
必填
此值必须与卷的名称一致。
sidecars[].volumeMounts[].readOnly
boolean
可选
如果为 true,则已挂载为只读;否则(false 或未指定)则已挂载为读写。默认值为 false。
sidecars[].volumeMounts[].subPath
string
可选
容器卷应从中装载的卷内的路径。默认为“””(卷的根目录)。
sidecars[].volumeMounts[].subPathExpr
string
可选
卷中的展开路径,应从该路径装载容器的卷。与 SubPath 类似,但环境变量引用 $(VAR_NAME) 会使用容器的环境进行展开。默认为“”(卷的根目录)。SubPathExpr 和 SubPath 是互斥的。
sidecars[].workingDir
string
可选
容器的工作目录。如果未指定,则使用容器运行时的默认值,该值可能在容器映像中配置。无法更新。

状态架构

SidecarStatus 指定了 Sidecar 的观察状态。

conditions:
- lastTransitionTime: string
  message: string
  observedGeneration: integer
  reason: string
  status: string
  type: string
criticalIncidents:
- code: string
  createTime: string
  message: string
  messageTemplateParams:
  resource:
    component: string
    location:
      cluster: string
      group: string
      kind: string
      name: string
      namespace: string
      version: string
  stackTrace:
  - component: string
    message: string
  transientUntil: string
observedGeneration: integer
reconciled: boolean

字段

类型
必填或可选

 

说明
conditions
list (object)
可选
条件表示实体当前状态的最新可用观察结果。
conditions[]
object
可选
Condition 包含此 API 资源当前状态的一个方面。--- 此结构体旨在直接用作字段路径 .status.conditions 中的数组。例如, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }
conditions[].lastTransitionTime
string
必填
lastTransitionTime 是条件上次从一种状态转换到另一种状态的时间。此时间应为底层条件发生变化的时间。如果时间未知,则可以使用 API 字段更改的时间。
conditions[].message
string
必填

长度上限:32768

message 是人类可读的消息,指示有关转换的详细信息。此值可以是空字符串。
conditions[].observedGeneration
integer
可选
observedGeneration 表示设置条件所基于的 .metadata.generation。例如,如果 .metadata.generation 为 12,但 .status.conditions[x].observedGeneration 为 9,则表示相应条件对于实例的当前状态已过时。
conditions[].reason
string
必填

最小长度:1;最大长度:1024

reason 包含一个程序化标识符,用于指明条件上次转换的原因。特定条件类型的生产者可以定义此字段的预期值和含义,以及这些值是否被视为有保证的 API。该值应为驼峰式字符串。 此字段不得为空。
conditions[].status
string
必填

有效值:"True""False"Unknown

条件的状态,为 True、False、Unknown 之一。
conditions[].type
string
必填

长度上限:316

条件类型(采用驼峰命名法)或 foo.example.com/CamelCase。 --- 许多 .condition.type 值在不同资源之间是一致的,例如“可用”,但由于任意条件可能很有用(请参阅 .node.status.conditions),因此能够解析冲突非常重要。与其匹配的正则表达式为 (dns1123SubdomainFmt/)?(qualifiedNameFmt)
criticalIncidents
list (object)
可选
CriticalIncidents 是所有有效严重事件的平面列表。
criticalIncidents[]
object
可选
CriticalIncident 包含与正在发生的严重突发事件相关的所有信息。
criticalIncidents[].code
string
必填
Code 是此特定错误的错误代码。 错误代码为 DBSE+数字字符串,例如“DBSE1012”。
criticalIncidents[].createTime
string
必填
CreateTime 是此突发事件在来源处创建时的时间戳。
criticalIncidents[].message
string
可选
Message 用于描述发生的事故/错误。
criticalIncidents[].messageTemplateParams
object
可选
MessageTemplateParams 包含在界面中生成易于使用的数据驱动型消息版本所需的键值对。
criticalIncidents[].resource
object
必填
资源包含有关报告了相应事故的数据库服务组件以及 Kubernetes 资源的信息。
criticalIncidents[].resource.component
string
必填
组件是报告了相应事故的数据库服务子系统的内部标识符。
criticalIncidents[].resource.location
object
可选
位置信息
criticalIncidents[].resource.location.cluster
string
可选
Cluster 是受影响 Kubernetes 资源所属集群的名称。
criticalIncidents[].resource.location.group
string
可选
Group 是 Kubernetes 资源的组名称。
criticalIncidents[].resource.location.kind
string
可选
Kind 是 Kubernetes 资源的 Kind。
criticalIncidents[].resource.location.name
string
可选
名称是受影响 Kubernetes 资源的名称。
criticalIncidents[].resource.location.namespace
string
可选
命名空间是受影响 Kubernetes 资源的命名空间。
criticalIncidents[].resource.location.version
string
可选
版本是 Kubernetes 资源的版本。
criticalIncidents[].stackTrace
list (object)
可选
StackTrace 包含堆栈轨迹中的消息的非结构化列表。
criticalIncidents[].stackTrace[]
object
可选
CriticalIncidentStackTraceMessage 包含可用于相应事故的堆栈轨迹信息。
criticalIncidents[].stackTrace[].component
string
可选
组件是记录消息的数据库服务组件的名称。
criticalIncidents[].stackTrace[].message
string
可选
记录的消息。
criticalIncidents[].transientUntil
string
可选
如果存在 TransientUntil,则表示在指定时间之前应将问题视为暂时性问题。
observedGeneration
integer
可选
内部:控制器观察到的生成。
reconciled
boolean
可选
内部:资源是否已由控制器协调。