Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
21929462
Commit
21929462
authored
Oct 08, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14522 from lavalamp/3p-api-group
Auto commit by PR queue bot
parents
fa8bb5f1
72c1340d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
extending-api.md
docs/design/extending-api.md
+15
-16
No files found.
docs/design/extending-api.md
View file @
21929462
...
@@ -73,11 +73,11 @@ Kubernetes API server to provide the following features:
...
@@ -73,11 +73,11 @@ Kubernetes API server to provide the following features:
The
`Kind`
for an instance of a third-party object (e.g. CronTab) below is expected to be
The
`Kind`
for an instance of a third-party object (e.g. CronTab) below is expected to be
programmatically convertible to the name of the resource using
programmatically convertible to the name of the resource using
the following conversion. Kinds are expected to be of the form
`<CamelCaseKind>`
, the
the following conversion. Kinds are expected to be of the form
`<CamelCaseKind>`
, the
`APIVersion`
for the object is expected to be
`<domain-name>/<api-group>/<api-version>`
.
`APIVersion`
for the object is expected to be
`<api-group>/<api-version>`
. To
prevent collisions, it's expected that you'll use a fulling qualified domain
name for the API group, e.g.
`example.com`
.
For example
`example.com/stable/v1`
For example
`stable.example.com/v1`
`domain-name`
is expected to be a fully qualified domain name.
'CamelCaseKind' is the specific type name.
'CamelCaseKind' is the specific type name.
...
@@ -113,18 +113,17 @@ For example, if a user creates:
...
@@ -113,18 +113,17 @@ For example, if a user creates:
```
yaml
```
yaml
metadata
:
metadata
:
name
:
cron-tab.example.com
name
:
cron-tab.
stable.
example.com
apiVersion
:
experimental/v1alpha1
apiVersion
:
experimental/v1alpha1
kind
:
ThirdPartyResource
kind
:
ThirdPartyResource
description
:
"
A
specification
of
a
Pod
to
run
on
a
cron
style
schedule"
description
:
"
A
specification
of
a
Pod
to
run
on
a
cron
style
schedule"
versions
:
versions
:
-
name
:
stable/
v1
-
name
:
v1
-
name
:
experimental/
v2
-
name
:
v2
```
```
Then the API server will program in two new RESTful resource paths:
Then the API server will program in the new RESTful resource path:
*
`/thirdparty/example.com/stable/v1/namespaces/<namespace>/crontabs/...`
*
`/apis/stable.example.com/v1/namespaces/<namespace>/crontabs/...`
*
`/thirdparty/example.com/experimental/v2/namespaces/<namespace>/crontabs/...`
Now that this schema has been created, a user can
`POST`
:
Now that this schema has been created, a user can
`POST`
:
...
@@ -134,19 +133,19 @@ Now that this schema has been created, a user can `POST`:
...
@@ -134,19 +133,19 @@ Now that this schema has been created, a user can `POST`:
"metadata"
:
{
"metadata"
:
{
"name"
:
"my-new-cron-object"
"name"
:
"my-new-cron-object"
},
},
"apiVersion"
:
"
example.com/stable
/v1"
,
"apiVersion"
:
"
stable.example.com
/v1"
,
"kind"
:
"CronTab"
,
"kind"
:
"CronTab"
,
"cronSpec"
:
"* * * * /5"
,
"cronSpec"
:
"* * * * /5"
,
"image"
:
"my-awesome-chron-image"
"image"
:
"my-awesome-chron-image"
}
}
```
```
to:
`/
third-party/example.com/stable/v1/namespaces/default/crontabs/my-new-cron-object
`
to:
`/
apis/stable.example.com/v1/namespaces/default/crontabs
`
and the corresponding data will be stored into etcd by the APIServer, so that when the user issues:
and the corresponding data will be stored into etcd by the APIServer, so that when the user issues:
```
```
GET /
third-party/example.com/stable
/v1/namespaces/default/crontabs/my-new-cron-object`
GET /
apis/stable.example.com
/v1/namespaces/default/crontabs/my-new-cron-object`
```
```
And when they do that, they will get back the same data, but with additional Kubernetes metadata
And when they do that, they will get back the same data, but with additional Kubernetes metadata
...
@@ -155,21 +154,21 @@ And when they do that, they will get back the same data, but with additional Kub
...
@@ -155,21 +154,21 @@ And when they do that, they will get back the same data, but with additional Kub
Likewise, to list all resources, a user can issue:
Likewise, to list all resources, a user can issue:
```
```
GET /
third-party/example.com/stable
/v1/namespaces/default/crontabs
GET /
apis/stable.example.com
/v1/namespaces/default/crontabs
```
```
and get back:
and get back:
```
json
```
json
{
{
"apiVersion"
:
"
example.com/stable
/v1"
,
"apiVersion"
:
"
stable.example.com
/v1"
,
"kind"
:
"CronTabList"
,
"kind"
:
"CronTabList"
,
"items"
:
[
"items"
:
[
{
{
"metadata"
:
{
"metadata"
:
{
"name"
:
"my-new-cron-object"
"name"
:
"my-new-cron-object"
},
},
"apiVersion"
:
"
example.com/stable
/v1"
,
"apiVersion"
:
"
stable.example.com
/v1"
,
"kind"
:
"CronTab"
,
"kind"
:
"CronTab"
,
"cronSpec"
:
"* * * * /5"
,
"cronSpec"
:
"* * * * /5"
,
"image"
:
"my-awesome-chron-image"
"image"
:
"my-awesome-chron-image"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment