{"id":18795000,"url":"https://github.com/fbac/aggregated-api-ex","last_synced_at":"2025-07-30T17:39:29.166Z","repository":{"id":91737545,"uuid":"168518326","full_name":"fbac/aggregated-api-ex","owner":"fbac","description":null,"archived":false,"fork":false,"pushed_at":"2019-02-01T22:07:34.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-21T16:49:42.451Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fbac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-31T12:02:09.000Z","updated_at":"2019-02-01T22:07:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"1665a597-da1a-4a83-b7d3-8c2d7bd6f28f","html_url":"https://github.com/fbac/aggregated-api-ex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fbac/aggregated-api-ex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbac%2Faggregated-api-ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbac%2Faggregated-api-ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbac%2Faggregated-api-ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbac%2Faggregated-api-ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fbac","download_url":"https://codeload.github.com/fbac/aggregated-api-ex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbac%2Faggregated-api-ex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267912106,"owners_count":24164488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T21:32:11.558Z","updated_at":"2025-07-30T17:39:29.125Z","avatar_url":"https://github.com/fbac.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aggregated API Server Example\n\n### Concept\n\nKubernetes API can be easily extended thanks to multiple mechanism, such as Custom Resources (recommended way to do it) or directly by claiming an API path and serving the API endopints on it with your own apiserver, thanks to its [aggregation layer](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/).\n\nIn this repository I'm extending the api with the simplest application possible, it's built in node.js and only serves two handlers, which will be proxied by the kubernetes API to the service where my apiserver listens.\n\n### Install\n\n- Create the apiserver\n\n    ```bash\n    $ oc new-project aggregated-api-ex\n    $ oc process -f https://raw.githubusercontent.com/fbac/aggregated-api-ex/master/deploy/template.yaml | oc apply -f -\n    $ oc start-build aggregated-api-ex\n    ```\n\n- Create the APIService, which is the kubernetes object doing all the work, it looks like:\n\n    ```yaml\n    apiVersion: apiregistration.k8s.io/v1\n    kind: APIService\n    metadata:\n        labels:\n            kube-aggregator.kubernetes.io/automanaged: onstart\n        name: API_NAME\n    spec:\n        caBundle: CA_BUNDLE\n        group: API_GROUP\n        groupPriorityMinimum: 17100\n        service: \n            name: SVC\n            namespace: NS\n        version: VERSION\n        versionPriority: 9\n    ```\n\n    - **caBundle** is a PEM encoded CA bundle which will be used to validate an API server's serving certificate. IIn this case the service is signed by a service-signer-certificate automatically, so the CA is `/etc/origin/master/service-signer.crt` encoded in base64.\n\n    -  **VersionPriority** controls the ordering of this API version inside of its group.\n\n    - **GroupPriorityMininum** is the priority this group should have at least. Higher priority means that the group is preferred by clients over lower priority ones.\n\n\n    ```yaml\n    apiVersion: apiregistration.k8s.io/v1\n    kind: APIService\n    metadata:\n        labels:\n            kube-aggregator.kubernetes.io/automanaged: onstart\n        name: v1beta1.test.k8s.io\n    spec:\n        caBundle: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURDakNDQWZLZ0F3 [...]\n        group: test.k8s.io\n        groupPriorityMinimum: 17100\n        service:\n            name: aggregated-api-ex\n            namespace: aggregated-api-ex\n        version: v1beta1\n        versionPriority: 9\n    ```\n\n- Create the APIService\n  \n    ```bash\n    $ oc create -f apiservice.yaml\n    $ oc get apiservice\n    ```\n\n### References\n- [apiserver-builder](https://github.com/kubernetes-incubator/apiserver-builder)\n- [kubebuilder](https://github.com/kubernetes-sigs/kubebuilder)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbac%2Faggregated-api-ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffbac%2Faggregated-api-ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbac%2Faggregated-api-ex/lists"}