How to register a new API extension in kubernetes?

5/15/2016

I'm working to add port range support to kubernetes so I need to modify the API and schemas to support a new parameter: portrange instead of the traditional port. To do it, I've follow the official guideline but yet, I'm blocked because when I try to execute:

cluster/kubectl.sh create -f restcomm_rc_range.yml

returns:

error validating "restcomm_rc_range.yml": error validating data: API version "ranges/v2 alpha1" isn't supported, only supports API versions ["extensions/v1beta1" "authentication.k8s.io/v1beta1" "v1" "apps/v1alpha1" "autoscaling/v1" "metrics/v1alpha1" "policy/v1alpha1" "authorization.k8s.io/v1beta1" "batch/v1" "batch/v2alpha1" "componentconfig/v1alpha1"]; if you choose to ignore these errors, turn validation off with --validate=false

I've previously executed:

./hack/update-all.sh -a && ./hack/build-go.sh
./hack/local-up-cluster.sh

And I've modified all the files, but clearly I'm missing some step here to register the API in the API Server. Any guidance about how to do it? Is this solution suitable for the issue?

-- Antón R. Yuste
kubernetes

1 Answer

5/16/2016

You need to register the API in the APIServer code. See:

https://github.com/kubernetes/kubernetes/blob/master/pkg/master/master.go#L245

for an example for v1beta1.

-- Brendan Burns
Source: StackOverflow