kubernetes_schemas 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/Gemfile +6 -0
  4. data/README.md +35 -0
  5. data/Rakefile +28 -0
  6. data/bin/console +14 -0
  7. data/bin/setup +8 -0
  8. data/kubernetes_schemas.gemspec +30 -0
  9. data/lib/kubernetes_schemas/kubernetes_versions.rb +3 -0
  10. data/lib/kubernetes_schemas/version.rb +3 -0
  11. data/lib/kubernetes_schemas.rb +33 -0
  12. data/schemas/1.22/apigroup.json +119 -0
  13. data/schemas/1.22/apigrouplist.json +156 -0
  14. data/schemas/1.22/apiresourcelist.json +138 -0
  15. data/schemas/1.22/apiservice.json +431 -0
  16. data/schemas/1.22/apiservicelist.json +512 -0
  17. data/schemas/1.22/apiversions.json +76 -0
  18. data/schemas/1.22/binding.json +344 -0
  19. data/schemas/1.22/certificatesigningrequest.json +457 -0
  20. data/schemas/1.22/certificatesigningrequestlist.json +535 -0
  21. data/schemas/1.22/clusterrole.json +445 -0
  22. data/schemas/1.22/clusterrolebinding.json +355 -0
  23. data/schemas/1.22/clusterrolebindinglist.json +433 -0
  24. data/schemas/1.22/clusterrolelist.json +526 -0
  25. data/schemas/1.22/componentstatus.json +326 -0
  26. data/schemas/1.22/componentstatuslist.json +407 -0
  27. data/schemas/1.22/configmap.json +316 -0
  28. data/schemas/1.22/configmaplist.json +397 -0
  29. data/schemas/1.22/controllerrevision.json +300 -0
  30. data/schemas/1.22/controllerrevisionlist.json +378 -0
  31. data/schemas/1.22/cronjob.json +9720 -0
  32. data/schemas/1.22/cronjoblist.json +9801 -0
  33. data/schemas/1.22/csidriver.json +375 -0
  34. data/schemas/1.22/csidriverlist.json +453 -0
  35. data/schemas/1.22/csinode.json +354 -0
  36. data/schemas/1.22/csinodelist.json +432 -0
  37. data/schemas/1.22/csistoragecapacity.json +390 -0
  38. data/schemas/1.22/csistoragecapacitylist.json +472 -0
  39. data/schemas/1.22/daemonset.json +9453 -0
  40. data/schemas/1.22/daemonsetlist.json +9534 -0
  41. data/schemas/1.22/deleteoptions.json +334 -0
  42. data/schemas/1.22/deployment.json +9474 -0
  43. data/schemas/1.22/deploymentlist.json +9555 -0
  44. data/schemas/1.22/endpoints.json +538 -0
  45. data/schemas/1.22/endpointslice.json +519 -0
  46. data/schemas/1.22/endpointslicelist.json +594 -0
  47. data/schemas/1.22/endpointslist.json +619 -0
  48. data/schemas/1.22/event.json +523 -0
  49. data/schemas/1.22/eventlist.json +601 -0
  50. data/schemas/1.22/eviction.json +618 -0
  51. data/schemas/1.22/flowschema.json +619 -0
  52. data/schemas/1.22/flowschemalist.json +700 -0
  53. data/schemas/1.22/horizontalpodautoscaler.json +1770 -0
  54. data/schemas/1.22/horizontalpodautoscalerlist.json +1851 -0
  55. data/schemas/1.22/ingress.json +638 -0
  56. data/schemas/1.22/ingressclass.json +340 -0
  57. data/schemas/1.22/ingressclasslist.json +421 -0
  58. data/schemas/1.22/ingresslist.json +719 -0
  59. data/schemas/1.22/job.json +9470 -0
  60. data/schemas/1.22/joblist.json +9551 -0
  61. data/schemas/1.22/lease.json +330 -0
  62. data/schemas/1.22/leaselist.json +411 -0
  63. data/schemas/1.22/limitrange.json +429 -0
  64. data/schemas/1.22/limitrangelist.json +510 -0
  65. data/schemas/1.22/localsubjectaccessreview.json +458 -0
  66. data/schemas/1.22/mutatingwebhookconfiguration.json +617 -0
  67. data/schemas/1.22/mutatingwebhookconfigurationlist.json +698 -0
  68. data/schemas/1.22/namespace.json +370 -0
  69. data/schemas/1.22/namespacelist.json +451 -0
  70. data/schemas/1.22/networkpolicy.json +850 -0
  71. data/schemas/1.22/networkpolicylist.json +931 -0
  72. data/schemas/1.22/node.json +905 -0
  73. data/schemas/1.22/nodelist.json +986 -0
  74. data/schemas/1.22/persistentvolume.json +1775 -0
  75. data/schemas/1.22/persistentvolumeclaim.json +614 -0
  76. data/schemas/1.22/persistentvolumeclaimlist.json +695 -0
  77. data/schemas/1.22/persistentvolumelist.json +1856 -0
  78. data/schemas/1.22/pod.json +9911 -0
  79. data/schemas/1.22/poddisruptionbudget.json +505 -0
  80. data/schemas/1.22/poddisruptionbudgetlist.json +586 -0
  81. data/schemas/1.22/podlist.json +9992 -0
  82. data/schemas/1.22/podsecuritypolicy.json +797 -0
  83. data/schemas/1.22/podsecuritypolicylist.json +878 -0
  84. data/schemas/1.22/podtemplate.json +9180 -0
  85. data/schemas/1.22/podtemplatelist.json +9261 -0
  86. data/schemas/1.22/priorityclass.json +314 -0
  87. data/schemas/1.22/priorityclasslist.json +392 -0
  88. data/schemas/1.22/prioritylevelconfiguration.json +445 -0
  89. data/schemas/1.22/prioritylevelconfigurationlist.json +526 -0
  90. data/schemas/1.22/replicaset.json +9372 -0
  91. data/schemas/1.22/replicasetlist.json +9453 -0
  92. data/schemas/1.22/replicationcontroller.json +9320 -0
  93. data/schemas/1.22/replicationcontrollerlist.json +9401 -0
  94. data/schemas/1.22/resourcequota.json +433 -0
  95. data/schemas/1.22/resourcequotalist.json +514 -0
  96. data/schemas/1.22/role.json +363 -0
  97. data/schemas/1.22/rolebinding.json +355 -0
  98. data/schemas/1.22/rolebindinglist.json +433 -0
  99. data/schemas/1.22/rolelist.json +444 -0
  100. data/schemas/1.22/runtimeclass.json +400 -0
  101. data/schemas/1.22/runtimeclasslist.json +478 -0
  102. data/schemas/1.22/scale.json +323 -0
  103. data/schemas/1.22/secret.json +323 -0
  104. data/schemas/1.22/secretlist.json +404 -0
  105. data/schemas/1.22/selfsubjectaccessreview.json +412 -0
  106. data/schemas/1.22/selfsubjectrulesreview.json +430 -0
  107. data/schemas/1.22/service.json +688 -0
  108. data/schemas/1.22/serviceaccount.json +381 -0
  109. data/schemas/1.22/serviceaccountlist.json +462 -0
  110. data/schemas/1.22/servicelist.json +769 -0
  111. data/schemas/1.22/statefulset.json +10076 -0
  112. data/schemas/1.22/statefulsetlist.json +10157 -0
  113. data/schemas/1.22/status.json +180 -0
  114. data/schemas/1.22/storageclass.json +391 -0
  115. data/schemas/1.22/storageclasslist.json +469 -0
  116. data/schemas/1.22/subjectaccessreview.json +458 -0
  117. data/schemas/1.22/tokenreview.json +405 -0
  118. data/schemas/1.22/validatingwebhookconfiguration.json +610 -0
  119. data/schemas/1.22/validatingwebhookconfigurationlist.json +691 -0
  120. data/schemas/1.22/volumeattachment.json +1860 -0
  121. data/schemas/1.22/volumeattachmentlist.json +1938 -0
  122. data/schemas/1.22/watchevent.json +276 -0
  123. metadata +207 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 25a9924eb3ad5716b1fa9295e05bbfc06209ba296b92e6c2f46828a153b5e0d4
4
+ data.tar.gz: fb1a7df55ad49c7f53def88edebf68d4b7bf23cd16a7d255f809135facb37eed
5
+ SHA512:
6
+ metadata.gz: ccac79277a0ecaa938c9dfb772eb8bfa656c80b5ce27c18efa7677af7016da2a5b7b08ce99f64e839d1633e1b260ee07c2d3263bb5b8ef923bd22ad73f902bf4
7
+ data.tar.gz: 4807e0aa0c53e0727432cd2cac7022f9804a4f3bf8aa5b5baae48891fd22d73bbab7b4147ac73784b66cf15102f95131c0c3f5400025444d43e86534bacd0610
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in kubernetes_schemas.gemspec
6
+ gemspec
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # KubernetesSchemas
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/kubernetes_schemas`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'kubernetes_schemas'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install kubernetes_schemas
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/fxposter/kubernetes_schemas.
data/Rakefile ADDED
@@ -0,0 +1,28 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
3
+
4
+ task :schemas do
5
+ require "kubernetes_schemas/kubernetes_versions"
6
+ require "tmpdir"
7
+ require "json"
8
+ require "fileutils"
9
+
10
+ KubernetesSchemas::KUBERNETES_VERSIONS.each do |kubernetes_version, kind_docker_image|
11
+ openapi_path = "#{Dir.tmpdir}/kubernetes-openapi-#{kubernetes_version}"
12
+ jsonschema_dir = "./schemas/#{kubernetes_version}"
13
+
14
+ system("kind", "delete", "cluster", "--name", "schemas-#{kubernetes_version}")
15
+ FileUtils.rm_rf(jsonschema_dir)
16
+
17
+ system("kind", "create", "cluster", "--name", "schemas-#{kubernetes_version}", "--image", kind_docker_image) or raise "could not create kind cluster for version #{kubernetes_version}"
18
+ system("kubectl", "--context", "kind-schemas-#{kubernetes_version}", "get", "--raw", "/openapi/v2", :out => "#{Dir.tmpdir}/kubernetes-openapi-#{kubernetes_version}") or raise "could not get OpenAPI schemas from kubernetes apiserver"
19
+ system("openapi2jsonschema", "--kubernetes", "--stand-alone", "--output", jsonschema_dir, openapi_path) or raise "failed to run openapi2jsonschema"
20
+
21
+ Dir.each_child(jsonschema_dir) do|filename|
22
+ path = File.join(jsonschema_dir, filename)
23
+ File.unlink(path) unless JSON.parse(File.read(path))['x-kubernetes-group-version-kind']
24
+ end
25
+ ensure
26
+ system("kind", "delete", "cluster", "--name", "schemas-#{kubernetes_version}")
27
+ end
28
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "kubernetes_schemas"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,30 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "kubernetes_schemas/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "kubernetes_schemas"
8
+ spec.version = KubernetesSchemas::VERSION
9
+ spec.authors = ["Pavel Forkert"]
10
+ spec.email = ["fxposter@gmail.com"]
11
+
12
+ spec.summary = %q{Validate your kubernetes resources against specific version of kubernetes api}
13
+ spec.description = %q{Validate your kubernetes resources against specific version of kubernetes api}
14
+ spec.homepage = "https://github.com/fxposter/kubernetes_schemas"
15
+
16
+
17
+ # Specify which files should be added to the gem when it is released.
18
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ end
22
+ spec.bindir = "exe"
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ["lib"]
25
+
26
+ spec.add_dependency "json-schema"
27
+
28
+ spec.add_development_dependency "bundler", "~> 1.17"
29
+ spec.add_development_dependency "rake", "~> 10.0"
30
+ end
@@ -0,0 +1,3 @@
1
+ module KubernetesSchemas
2
+ KUBERNETES_VERSIONS = { "1.22" => "kindest/node:v1.22.9@sha256:8135260b959dfe320206eb36b3aeda9cffcb262f4b44cda6b33f7bb73f453105" }
3
+ end
@@ -0,0 +1,3 @@
1
+ module KubernetesSchemas
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,33 @@
1
+ require "kubernetes_schemas/version"
2
+ require "json-schema"
3
+
4
+ module KubernetesSchemas
5
+ def self.load(kubernetes_version)
6
+ path = File.expand_path("../../schemas/#{kubernetes_version}", __FILE__)
7
+ Dir.each_child(path).with_object({}) { |filename, hash|
8
+ definition = JSON.parse(File.read(File.join(path, filename)))
9
+ if definition["x-kubernetes-group-version-kind"]
10
+ definition["$schema"] = "http://json-schema.org/draft-04/schema#"
11
+ definition["x-kubernetes-group-version-kind"].each do |meta|
12
+ hash["#{meta["group"]}/#{meta["version"]}/#{meta["kind"]}"] = definition
13
+ end
14
+ end
15
+ }
16
+ end
17
+
18
+ class Validator
19
+ def initialize(schemas)
20
+ @schemas = schemas
21
+ end
22
+
23
+ def validate(resource)
24
+ if schema = @schemas["#{resource["apiVersion"]}/#{resource["kind"]}"]
25
+ validator = JSON::Validator.new(schema, resource, :record_errors => true)
26
+ validator.validate
27
+ validator.validation_errors.map(&:message)
28
+ else
29
+ []
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,119 @@
1
+ {
2
+ "description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
3
+ "type": "object",
4
+ "required": [
5
+ "name",
6
+ "versions"
7
+ ],
8
+ "properties": {
9
+ "apiVersion": {
10
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
11
+ "type": [
12
+ "string",
13
+ "null"
14
+ ]
15
+ },
16
+ "kind": {
17
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
18
+ "type": [
19
+ "string",
20
+ "null"
21
+ ],
22
+ "enum": [
23
+ "APIGroup"
24
+ ]
25
+ },
26
+ "name": {
27
+ "description": "name is the name of the group.",
28
+ "type": [
29
+ "string",
30
+ "null"
31
+ ]
32
+ },
33
+ "preferredVersion": {
34
+ "description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.",
35
+ "type": [
36
+ "object",
37
+ "null"
38
+ ],
39
+ "required": [
40
+ "groupVersion",
41
+ "version"
42
+ ],
43
+ "properties": {
44
+ "groupVersion": {
45
+ "description": "groupVersion specifies the API group and version in the form \"group/version\"",
46
+ "type": "string"
47
+ },
48
+ "version": {
49
+ "description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.",
50
+ "type": "string"
51
+ }
52
+ }
53
+ },
54
+ "serverAddressByClientCIDRs": {
55
+ "description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.",
56
+ "type": [
57
+ "array",
58
+ "null"
59
+ ],
60
+ "items": {
61
+ "description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
62
+ "type": [
63
+ "object",
64
+ "null"
65
+ ],
66
+ "required": [
67
+ "clientCIDR",
68
+ "serverAddress"
69
+ ],
70
+ "properties": {
71
+ "clientCIDR": {
72
+ "description": "The CIDR with which clients can match their IP to figure out the server address that they should use.",
73
+ "type": "string"
74
+ },
75
+ "serverAddress": {
76
+ "description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.",
77
+ "type": "string"
78
+ }
79
+ }
80
+ }
81
+ },
82
+ "versions": {
83
+ "description": "versions are the versions supported in this group.",
84
+ "type": [
85
+ "array",
86
+ "null"
87
+ ],
88
+ "items": {
89
+ "description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.",
90
+ "type": [
91
+ "object",
92
+ "null"
93
+ ],
94
+ "required": [
95
+ "groupVersion",
96
+ "version"
97
+ ],
98
+ "properties": {
99
+ "groupVersion": {
100
+ "description": "groupVersion specifies the API group and version in the form \"group/version\"",
101
+ "type": "string"
102
+ },
103
+ "version": {
104
+ "description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.",
105
+ "type": "string"
106
+ }
107
+ }
108
+ }
109
+ }
110
+ },
111
+ "x-kubernetes-group-version-kind": [
112
+ {
113
+ "group": "",
114
+ "kind": "APIGroup",
115
+ "version": "v1"
116
+ }
117
+ ],
118
+ "$schema": "http://json-schema.org/schema#"
119
+ }
@@ -0,0 +1,156 @@
1
+ {
2
+ "description": "APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.",
3
+ "type": "object",
4
+ "required": [
5
+ "groups"
6
+ ],
7
+ "properties": {
8
+ "apiVersion": {
9
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
10
+ "type": [
11
+ "string",
12
+ "null"
13
+ ]
14
+ },
15
+ "groups": {
16
+ "description": "groups is a list of APIGroup.",
17
+ "type": [
18
+ "array",
19
+ "null"
20
+ ],
21
+ "items": {
22
+ "description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
23
+ "type": [
24
+ "object",
25
+ "null"
26
+ ],
27
+ "required": [
28
+ "name",
29
+ "versions"
30
+ ],
31
+ "properties": {
32
+ "apiVersion": {
33
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
34
+ "type": [
35
+ "string",
36
+ "null"
37
+ ]
38
+ },
39
+ "kind": {
40
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
41
+ "type": [
42
+ "string",
43
+ "null"
44
+ ],
45
+ "enum": [
46
+ "APIGroup"
47
+ ]
48
+ },
49
+ "name": {
50
+ "description": "name is the name of the group.",
51
+ "type": "string"
52
+ },
53
+ "preferredVersion": {
54
+ "description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.",
55
+ "type": [
56
+ "object",
57
+ "null"
58
+ ],
59
+ "required": [
60
+ "groupVersion",
61
+ "version"
62
+ ],
63
+ "properties": {
64
+ "groupVersion": {
65
+ "description": "groupVersion specifies the API group and version in the form \"group/version\"",
66
+ "type": "string"
67
+ },
68
+ "version": {
69
+ "description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.",
70
+ "type": "string"
71
+ }
72
+ }
73
+ },
74
+ "serverAddressByClientCIDRs": {
75
+ "description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.",
76
+ "type": [
77
+ "array",
78
+ "null"
79
+ ],
80
+ "items": {
81
+ "description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
82
+ "type": [
83
+ "object",
84
+ "null"
85
+ ],
86
+ "required": [
87
+ "clientCIDR",
88
+ "serverAddress"
89
+ ],
90
+ "properties": {
91
+ "clientCIDR": {
92
+ "description": "The CIDR with which clients can match their IP to figure out the server address that they should use.",
93
+ "type": "string"
94
+ },
95
+ "serverAddress": {
96
+ "description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.",
97
+ "type": "string"
98
+ }
99
+ }
100
+ }
101
+ },
102
+ "versions": {
103
+ "description": "versions are the versions supported in this group.",
104
+ "type": "array",
105
+ "items": {
106
+ "description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.",
107
+ "type": [
108
+ "object",
109
+ "null"
110
+ ],
111
+ "required": [
112
+ "groupVersion",
113
+ "version"
114
+ ],
115
+ "properties": {
116
+ "groupVersion": {
117
+ "description": "groupVersion specifies the API group and version in the form \"group/version\"",
118
+ "type": "string"
119
+ },
120
+ "version": {
121
+ "description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.",
122
+ "type": "string"
123
+ }
124
+ }
125
+ }
126
+ }
127
+ },
128
+ "x-kubernetes-group-version-kind": [
129
+ {
130
+ "group": "",
131
+ "kind": "APIGroup",
132
+ "version": "v1"
133
+ }
134
+ ]
135
+ }
136
+ },
137
+ "kind": {
138
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
139
+ "type": [
140
+ "string",
141
+ "null"
142
+ ],
143
+ "enum": [
144
+ "APIGroupList"
145
+ ]
146
+ }
147
+ },
148
+ "x-kubernetes-group-version-kind": [
149
+ {
150
+ "group": "",
151
+ "kind": "APIGroupList",
152
+ "version": "v1"
153
+ }
154
+ ],
155
+ "$schema": "http://json-schema.org/schema#"
156
+ }
@@ -0,0 +1,138 @@
1
+ {
2
+ "description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.",
3
+ "type": "object",
4
+ "required": [
5
+ "groupVersion",
6
+ "resources"
7
+ ],
8
+ "properties": {
9
+ "apiVersion": {
10
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
11
+ "type": [
12
+ "string",
13
+ "null"
14
+ ]
15
+ },
16
+ "groupVersion": {
17
+ "description": "groupVersion is the group and version this APIResourceList is for.",
18
+ "type": [
19
+ "string",
20
+ "null"
21
+ ]
22
+ },
23
+ "kind": {
24
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
25
+ "type": [
26
+ "string",
27
+ "null"
28
+ ],
29
+ "enum": [
30
+ "APIResourceList"
31
+ ]
32
+ },
33
+ "resources": {
34
+ "description": "resources contains the name of the resources and if they are namespaced.",
35
+ "type": [
36
+ "array",
37
+ "null"
38
+ ],
39
+ "items": {
40
+ "description": "APIResource specifies the name of a resource and whether it is namespaced.",
41
+ "type": [
42
+ "object",
43
+ "null"
44
+ ],
45
+ "required": [
46
+ "name",
47
+ "singularName",
48
+ "namespaced",
49
+ "kind",
50
+ "verbs"
51
+ ],
52
+ "properties": {
53
+ "categories": {
54
+ "description": "categories is a list of the grouped resources this resource belongs to (e.g. 'all')",
55
+ "type": [
56
+ "array",
57
+ "null"
58
+ ],
59
+ "items": {
60
+ "type": [
61
+ "string",
62
+ "null"
63
+ ]
64
+ }
65
+ },
66
+ "group": {
67
+ "description": "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".",
68
+ "type": [
69
+ "string",
70
+ "null"
71
+ ]
72
+ },
73
+ "kind": {
74
+ "description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')",
75
+ "type": "string"
76
+ },
77
+ "name": {
78
+ "description": "name is the plural name of the resource.",
79
+ "type": "string"
80
+ },
81
+ "namespaced": {
82
+ "description": "namespaced indicates if a resource is namespaced or not.",
83
+ "type": "boolean"
84
+ },
85
+ "shortNames": {
86
+ "description": "shortNames is a list of suggested short names of the resource.",
87
+ "type": [
88
+ "array",
89
+ "null"
90
+ ],
91
+ "items": {
92
+ "type": [
93
+ "string",
94
+ "null"
95
+ ]
96
+ }
97
+ },
98
+ "singularName": {
99
+ "description": "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.",
100
+ "type": "string"
101
+ },
102
+ "storageVersionHash": {
103
+ "description": "The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.",
104
+ "type": [
105
+ "string",
106
+ "null"
107
+ ]
108
+ },
109
+ "verbs": {
110
+ "description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)",
111
+ "type": "array",
112
+ "items": {
113
+ "type": [
114
+ "string",
115
+ "null"
116
+ ]
117
+ }
118
+ },
119
+ "version": {
120
+ "description": "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".",
121
+ "type": [
122
+ "string",
123
+ "null"
124
+ ]
125
+ }
126
+ }
127
+ }
128
+ }
129
+ },
130
+ "x-kubernetes-group-version-kind": [
131
+ {
132
+ "group": "",
133
+ "kind": "APIResourceList",
134
+ "version": "v1"
135
+ }
136
+ ],
137
+ "$schema": "http://json-schema.org/schema#"
138
+ }