API Aggregation — extend Kubernetes API with custom API servers.
1# APIService registration2apiVersion: apiregistration.k8s.io/v13kind: APIService4metadata:5 name: v1beta1.custom.example.com6spec:7 service:8 name: custom-api-server9 namespace: kube-system10 port: 44311 group: custom.example.com12 version: v1beta113 insecureSkipTLSVerify: false14 caBundle: <base64-ca-cert>15 groupPriorityMinimum: 100016 versionPriority: 1517---18# Custom resource definition19apiVersion: apiextensions.k8s.io/v120kind: CustomResourceDefinition21metadata:22 name: dashboards.custom.example.com23spec:24 group: custom.example.com25 versions:26 - name: v1beta127 served: true28 storage: true29 schema:30 openAPIV3Schema:31 type: object32 scope: Namespaced33 names:34 plural: dashboards35 singular: dashboard36 kind: Dashboard37 shortNames: ["dash"]38 conversion:39 strategy: Webhook40 webhook:41 clientConfig:42 service:43 name: conversion-webhook44 namespace: kube-system45 caBundle: <base64-ca-cert>
1# Commands2kubectl get apiservices | grep custom3kubectl describe apiservice v1beta1.custom.example.com45# Access custom API6kubectl get --raw /apis/custom.example.com/v1beta1/dashboards7kubectl get --raw /apis/custom.example.com/v1beta1/namespaces/default/dashboards89# Check availability10kubectl get apiservice v1beta1.custom.example.com -o jsonpath='{.status.conditions}' | jq
Use cases: