k8s crd设置额外header

可以通过设置crd.spec.additionalPrinterColumns来实现:

XML 复制代码
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: crontabs.stable.example.com
spec:
  group: stable.example.com
  scope: Namespaced
  names:
    plural: crontabs
    singular: crontab
    kind: CronTab
    shortNames:
    - ct
  versions:
  - name: v1
    served: true
    storage: true
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            properties:
              cronSpec:
                type: string
              image:
                type: string
              replicas:
                type: integer
    additionalPrinterColumns:
    - name: Spec
      type: string
      description: The cron spec defining the interval a CronJob is run
      jsonPath: .spec.cronSpec
    - name: Replicas
      type: integer
      description: The number of jobs launched by the CronJob
      jsonPath: .spec.replicas
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp

参考:

使用 CustomResourceDefinition 扩展 Kubernetes API | Kubernetes

相关推荐
l1t6 小时前
用docker安装测试crate数据库
数据库·docker·容器·cratedb
平行云PVT7 小时前
数字孪生信创云渲染技术解析:从混合信创到全国产化架构
linux·unity·云原生·ue5·图形渲染·webgl·gpu算力
heimeiyingwang8 小时前
【架构实战】云原生架构设计原则
云原生·架构
枕书8 小时前
实战记录:如何使用 Docker 一键部署长亭 PandaWiki 智能知识库
运维·docker·容器
Cyber4K10 小时前
【妙招系列】Harbor 镜像私有仓库搭建手册
linux·云原生·容器
王码码203510 小时前
Flutter for OpenHarmony:Flutter 三方库 algoliasearch 毫秒级云端搜索体验(云原生搜索引擎)
android·前端·git·flutter·搜索引擎·云原生·harmonyos
IT199512 小时前
Docker笔记-对docker-compose.yml基本认识
笔记·docker·容器
阿里云云原生12 小时前
同学,你好!阿里云云原生 2027 实习生招聘启动
云原生
阿里云云原生12 小时前
一行命令,给你的 OpenClaw 龙虾装上 X 光机——阿里云可观测,让养虾更经济更安全
云原生
阿里云云原生14 小时前
SLS 智能问答助手:秒解游戏运营客服难题
云原生