From 80fe32f52e9417d6d5e473ca6847c2a4e65bf444 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 3 Dec 2020 11:43:21 -0500 Subject: [PATCH] just looking at outputs of CBOR for comparison pulled the serving-crds.yaml for knative, then made a json form of it, for marshaling to cbor for comparison Signed-off-by: Vincent Batts --- Makefile | 8 + go.mod | 9 + go.sum | 16 ++ mtest.go | 104 +++++++ mtest_test.go | 8 + serving-crds.json | 690 ++++++++++++++++++++++++++++++++++++++++++++++ serving-crds.yaml | 673 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 1508 insertions(+) create mode 100644 Makefile create mode 100644 go.mod create mode 100644 go.sum create mode 100644 mtest.go create mode 100644 mtest_test.go create mode 100644 serving-crds.json create mode 100644 serving-crds.yaml diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ca09af5 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ + + +default: test + + +test: $(wildcard *.go) serving-crds.json + go test -v . + diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..709b93c --- /dev/null +++ b/go.mod @@ -0,0 +1,9 @@ +module mtest + +go 1.15 + +require ( + github.com/fxamacker/cbor v1.5.1 + github.com/fxamacker/cbor/v2 v2.2.0 + github.com/sirupsen/logrus v1.7.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..b3c719a --- /dev/null +++ b/go.sum @@ -0,0 +1,16 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fxamacker/cbor v1.5.1 h1:XjQWBgdmQyqimslUh5r4tUGmoqzHmBFQOImkWGi2awg= +github.com/fxamacker/cbor v1.5.1/go.mod h1:3aPGItF174ni7dDzd6JZ206H8cmr4GDNBGpPa971zsU= +github.com/fxamacker/cbor/v2 v2.2.0 h1:6eXqdDDe588rSYAi1HfZKbx6YYQO4mxQ9eC6xYpU/JQ= +github.com/fxamacker/cbor/v2 v2.2.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/mtest.go b/mtest.go new file mode 100644 index 0000000..3d410ec --- /dev/null +++ b/mtest.go @@ -0,0 +1,104 @@ +package mtest + +import ( + "encoding/json" + "io/ioutil" + "os" + + "github.com/fxamacker/cbor/v2" + "github.com/sirupsen/logrus" +) + +type Sample struct { + User struct { + Name string `json:"n",cbor:"n"` + Email string `json:"e",cbor:"e"` + } `json:"n",cbor:"n"` + Annotations map[string]string `json:"a",cbor:"a"` +} + +func OtherThings() { + opts := cbor.CanonicalEncOptions() + // If needed, modify opts. For example: opts.Time = cbor.TimeUnix + + // Create reusable EncMode interface with immutable options, safe for concurrent use. + em, err := opts.EncMode() + if err != nil { + logrus.Fatal(err) + } + + jbuf, err := ioutil.ReadFile("serving-crds.json") + if err != nil { + logrus.Fatal(err) + } + d := []map[string]interface{}{} + err = json.Unmarshal(jbuf, &d) + if err != nil { + logrus.Fatal(err) + } + + logrus.Info("writing to serving-crds.cbor") + fd, err := os.OpenFile("serving-crds.cbor", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.FileMode(0644)) + if err != nil { + logrus.Fatal(err) + } + defer fd.Close() + + encoder := em.NewEncoder(fd) // create encoder with io.Writer w + err = encoder.Encode(d) // encode v to io.Writer w + if err != nil { + logrus.Fatal(err) + } + +} + +func Things() { + opts := cbor.CanonicalEncOptions() + // If needed, modify opts. For example: opts.Time = cbor.TimeUnix + + // Create reusable EncMode interface with immutable options, safe for concurrent use. + em, err := opts.EncMode() + if err != nil { + logrus.Fatal(err) + } + + s := Sample{} + s.User.Name = "Vincent Batts" + s.User.Email = "vbatts@hashbangbash.com" + s.Annotations = map[string]string{ + "farts": "a lot", + } + + // Use EncMode like encoding/json, with same function signatures. + b, err := em.Marshal(s) // encode v to []byte b + if err != nil { + logrus.Fatal(err) + } + _ = b + + logrus.Info("writing to output.cbor") + fd1, err := os.OpenFile("output.cbor", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.FileMode(0644)) + if err != nil { + logrus.Fatal(err) + } + defer fd1.Close() + + encoder := em.NewEncoder(fd1) // create encoder with io.Writer w + err = encoder.Encode(s) // encode v to io.Writer w + if err != nil { + logrus.Fatal(err) + } + + logrus.Info("writing to output.json") + fd2, err := os.OpenFile("output.json", os.O_CREATE|os.O_WRONLY, os.FileMode(0644)) + if err != nil { + logrus.Fatal(err) + } + defer fd2.Close() + + jenc := json.NewEncoder(fd2) // create encoder with io.Writer w + err = jenc.Encode(s) // encode v to io.Writer w + if err != nil { + logrus.Fatal(err) + } +} diff --git a/mtest_test.go b/mtest_test.go new file mode 100644 index 0000000..448b823 --- /dev/null +++ b/mtest_test.go @@ -0,0 +1,8 @@ +package mtest + +import "testing" + +func TestMarshal(t *testing.T) { + Things() + OtherThings() +} diff --git a/serving-crds.json b/serving-crds.json new file mode 100644 index 0000000..ec25c8c --- /dev/null +++ b/serving-crds.json @@ -0,0 +1,690 @@ +[ + { + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "name": "certificates.networking.internal.knative.dev", + "labels": { + "serving.knative.dev/release": "v0.19.0", + "knative.dev/crd-install": "true" + } + }, + "spec": { + "group": "networking.internal.knative.dev", + "versions": [ + { + "name": "v1alpha1", + "served": true, + "storage": true, + "subresources": { + "status": { + } + }, + "schema": { + "openAPIV3Schema": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true + } + }, + "additionalPrinterColumns": [ + { + "name": "Ready", + "type": "string", + "jsonPath": ".status.conditions[?(@.type==\"Ready\")].status" + }, + { + "name": "Reason", + "type": "string", + "jsonPath": ".status.conditions[?(@.type==\"Ready\")].reason" + } + ] + } + ], + "names": { + "kind": "Certificate", + "plural": "certificates", + "singular": "certificate", + "categories": [ + "knative-internal", + "networking" + ], + "shortNames": [ + "kcert" + ] + }, + "scope": "Namespaced" + } +}, +{ + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "name": "configurations.serving.knative.dev", + "labels": { + "serving.knative.dev/release": "v0.19.0", + "knative.dev/crd-install": "true", + "duck.knative.dev/podspecable": "true" + } + }, + "spec": { + "group": "serving.knative.dev", + "versions": [ + { + "name": "v1", + "served": true, + "storage": true, + "subresources": { + "status": { + } + }, + "schema": { + "openAPIV3Schema": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true + } + }, + "additionalPrinterColumns": [ + { + "name": "LatestCreated", + "type": "string", + "jsonPath": ".status.latestCreatedRevisionName" + }, + { + "name": "LatestReady", + "type": "string", + "jsonPath": ".status.latestReadyRevisionName" + }, + { + "name": "Ready", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].status" + }, + { + "name": "Reason", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].reason" + } + ] + } + ], + "names": { + "kind": "Configuration", + "plural": "configurations", + "singular": "configuration", + "categories": [ + "all", + "knative", + "serving" + ], + "shortNames": [ + "config", + "cfg" + ] + }, + "scope": "Namespaced" + } +}, +{ + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "name": "ingresses.networking.internal.knative.dev", + "labels": { + "serving.knative.dev/release": "v0.19.0", + "knative.dev/crd-install": "true" + } + }, + "spec": { + "group": "networking.internal.knative.dev", + "versions": [ + { + "name": "v1alpha1", + "served": true, + "storage": true, + "subresources": { + "status": { + } + }, + "schema": { + "openAPIV3Schema": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true + } + }, + "additionalPrinterColumns": [ + { + "name": "Ready", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].status" + }, + { + "name": "Reason", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].reason" + } + ] + } + ], + "names": { + "kind": "Ingress", + "plural": "ingresses", + "singular": "ingress", + "categories": [ + "knative-internal", + "networking" + ], + "shortNames": [ + "kingress", + "king" + ] + }, + "scope": "Namespaced" + } +}, +{ + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "name": "metrics.autoscaling.internal.knative.dev", + "labels": { + "serving.knative.dev/release": "v0.19.0", + "knative.dev/crd-install": "true" + } + }, + "spec": { + "group": "autoscaling.internal.knative.dev", + "versions": [ + { + "name": "v1alpha1", + "served": true, + "storage": true, + "subresources": { + "status": { + } + }, + "schema": { + "openAPIV3Schema": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true + } + }, + "additionalPrinterColumns": [ + { + "name": "Ready", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].status" + }, + { + "name": "Reason", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].reason" + } + ] + } + ], + "names": { + "kind": "Metric", + "plural": "metrics", + "singular": "metric", + "categories": [ + "knative-internal", + "autoscaling" + ] + }, + "scope": "Namespaced" + } +}, +{ + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "name": "podautoscalers.autoscaling.internal.knative.dev", + "labels": { + "serving.knative.dev/release": "v0.19.0", + "knative.dev/crd-install": "true" + } + }, + "spec": { + "group": "autoscaling.internal.knative.dev", + "versions": [ + { + "name": "v1alpha1", + "served": true, + "storage": true, + "subresources": { + "status": { + } + }, + "schema": { + "openAPIV3Schema": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true + } + }, + "additionalPrinterColumns": [ + { + "name": "DesiredScale", + "type": "integer", + "jsonPath": ".status.desiredScale" + }, + { + "name": "ActualScale", + "type": "integer", + "jsonPath": ".status.actualScale" + }, + { + "name": "Ready", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].status" + }, + { + "name": "Reason", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].reason" + } + ] + } + ], + "names": { + "kind": "PodAutoscaler", + "plural": "podautoscalers", + "singular": "podautoscaler", + "categories": [ + "knative-internal", + "autoscaling" + ], + "shortNames": [ + "kpa", + "pa" + ] + }, + "scope": "Namespaced" + } +}, +{ + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "name": "revisions.serving.knative.dev", + "labels": { + "serving.knative.dev/release": "v0.19.0", + "knative.dev/crd-install": "true" + } + }, + "spec": { + "group": "serving.knative.dev", + "versions": [ + { + "name": "v1", + "served": true, + "storage": true, + "subresources": { + "status": { + } + }, + "schema": { + "openAPIV3Schema": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true + } + }, + "additionalPrinterColumns": [ + { + "name": "Config Name", + "type": "string", + "jsonPath": ".metadata.labels['serving\\.knative\\.dev/configuration']" + }, + { + "name": "K8s Service Name", + "type": "string", + "jsonPath": ".status.serviceName" + }, + { + "name": "Generation", + "type": "string", + "jsonPath": ".metadata.labels['serving\\.knative\\.dev/configurationGeneration']" + }, + { + "name": "Ready", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].status" + }, + { + "name": "Reason", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].reason" + } + ] + } + ], + "names": { + "kind": "Revision", + "plural": "revisions", + "singular": "revision", + "categories": [ + "all", + "knative", + "serving" + ], + "shortNames": [ + "rev" + ] + }, + "scope": "Namespaced" + } +}, +{ + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "name": "routes.serving.knative.dev", + "labels": { + "serving.knative.dev/release": "v0.19.0", + "knative.dev/crd-install": "true", + "duck.knative.dev/addressable": "true" + } + }, + "spec": { + "group": "serving.knative.dev", + "versions": [ + { + "name": "v1", + "served": true, + "storage": true, + "subresources": { + "status": { + } + }, + "schema": { + "openAPIV3Schema": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true + } + }, + "additionalPrinterColumns": [ + { + "name": "URL", + "type": "string", + "jsonPath": ".status.url" + }, + { + "name": "Ready", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].status" + }, + { + "name": "Reason", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].reason" + } + ] + } + ], + "names": { + "kind": "Route", + "plural": "routes", + "singular": "route", + "categories": [ + "all", + "knative", + "serving" + ], + "shortNames": [ + "rt" + ] + }, + "scope": "Namespaced" + } +}, +{ + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "name": "serverlessservices.networking.internal.knative.dev", + "labels": { + "serving.knative.dev/release": "v0.19.0", + "knative.dev/crd-install": "true" + } + }, + "spec": { + "group": "networking.internal.knative.dev", + "versions": [ + { + "name": "v1alpha1", + "served": true, + "storage": true, + "subresources": { + "status": { + } + }, + "schema": { + "openAPIV3Schema": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true + } + }, + "additionalPrinterColumns": [ + { + "name": "Mode", + "type": "string", + "jsonPath": ".spec.mode" + }, + { + "name": "Activators", + "type": "integer", + "jsonPath": ".spec.numActivators" + }, + { + "name": "ServiceName", + "type": "string", + "jsonPath": ".status.serviceName" + }, + { + "name": "PrivateServiceName", + "type": "string", + "jsonPath": ".status.privateServiceName" + }, + { + "name": "Ready", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].status" + }, + { + "name": "Reason", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].reason" + } + ] + } + ], + "names": { + "kind": "ServerlessService", + "plural": "serverlessservices", + "singular": "serverlessservice", + "categories": [ + "knative-internal", + "networking" + ], + "shortNames": [ + "sks" + ] + }, + "scope": "Namespaced" + } +}, +{ + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "name": "services.serving.knative.dev", + "labels": { + "serving.knative.dev/release": "v0.19.0", + "knative.dev/crd-install": "true", + "duck.knative.dev/addressable": "true", + "duck.knative.dev/podspecable": "true" + } + }, + "spec": { + "group": "serving.knative.dev", + "versions": [ + { + "name": "v1", + "served": true, + "storage": true, + "subresources": { + "status": { + } + }, + "schema": { + "openAPIV3Schema": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true, + "properties": { + "spec": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true, + "properties": { + "template": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true, + "description": "A template for the current desired application state.\nChanges to `template` will cause a new Revision to be created as\ndefined in the lifecycle section. The contents of the Service's\nRevisionTemplateSpec is used to create a corresponding Configuration.\n" + }, + "traffic": { + "x-kubernetes-preserve-unknown-fields": true, + "type": "array", + "description": "Traffic specifies how to distribute traffic over a\ncollection of Revisions belonging to the Service. If traffic is\nempty or not provided, defaults to 100% traffic to the latest\n`Ready` Revision. The contents of the Service's TrafficTarget is\nused to create a corresponding Route.\n", + "items": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true, + "properties": { + "revisionName": { + "type": "string", + "description": "A specific revision to which to send this portion\nof traffic.\nThis is mutually exclusive with configurationName.\n" + }, + "configurationName": { + "type": "string", + "description": "ConfigurationName of a configuration to whose latest revision we will send\nthis portion of traffic. When the \"status.latestReadyRevisionName\" of the\nreferenced configuration changes, we will automatically migrate traffic\nfrom the prior \"latest ready\" revision to the new one. This field is never\nset in Route's status, only its spec.\nThis is mutually exclusive with RevisionName.\n" + }, + "latestRevision": { + "type": "boolean", + "description": "`latestRevision` may be optionally provided to indicate\nthat the latest ready Revision of the Configuration should be used\nfor this traffic target. When provided latestRevision MUST be true\nif revisionName is empty, and it MUST be false when revisionName is non-empty.\n" + }, + "tag": { + "type": "string", + "description": "Tag is optionally used to expose a dedicated URL for\nreferencing this target exclusively. The dedicated URL MUST include\nin it the string provided by tag.\n" + }, + "percent": { + "type": "integer", + "description": "The percentage of requests which should be allocated\nfrom the main Route domain name to the specified `revisionName` or\n`configurationName`.\nAll `percent` values in `traffic` MUST sum to 100.\n", + "minimum": 0, + "maximum": 100 + } + } + } + } + } + }, + "status": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true + } + } + } + }, + "additionalPrinterColumns": [ + { + "name": "URL", + "type": "string", + "jsonPath": ".status.url" + }, + { + "name": "LatestCreated", + "type": "string", + "jsonPath": ".status.latestCreatedRevisionName" + }, + { + "name": "LatestReady", + "type": "string", + "jsonPath": ".status.latestReadyRevisionName" + }, + { + "name": "Ready", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].status" + }, + { + "name": "Reason", + "type": "string", + "jsonPath": ".status.conditions[?(@.type=='Ready')].reason" + } + ] + } + ], + "names": { + "kind": "Service", + "plural": "services", + "singular": "service", + "categories": [ + "all", + "knative", + "serving" + ], + "shortNames": [ + "kservice", + "ksvc" + ] + }, + "scope": "Namespaced" + } +}, +{ + "apiVersion": "apiextensions.k8s.io/v1", + "kind": "CustomResourceDefinition", + "metadata": { + "name": "images.caching.internal.knative.dev", + "labels": { + "knative.dev/crd-install": "true" + } + }, + "spec": { + "group": "caching.internal.knative.dev", + "names": { + "kind": "Image", + "plural": "images", + "singular": "image", + "categories": [ + "knative-internal", + "caching" + ], + "shortNames": [ + "img" + ] + }, + "scope": "Namespaced", + "versions": [ + { + "name": "v1alpha1", + "served": true, + "storage": true, + "subresources": { + "status": { + } + }, + "schema": { + "openAPIV3Schema": { + "type": "object", + "x-kubernetes-preserve-unknown-fields": true + } + }, + "additionalPrinterColumns": [ + { + "name": "Image", + "type": "string", + "jsonPath": ".spec.image" + } + ] + } + ] + } +} +] diff --git a/serving-crds.yaml b/serving-crds.yaml new file mode 100644 index 0000000..2d8eaad --- /dev/null +++ b/serving-crds.yaml @@ -0,0 +1,673 @@ +# Copyright 2020 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: certificates.networking.internal.knative.dev + labels: + serving.knative.dev/release: "v0.19.0" + knative.dev/crd-install: "true" +spec: + group: networking.internal.knative.dev + versions: + - name: v1alpha1 + served: true + storage: true + subresources: + status: {} + schema: + openAPIV3Schema: + type: object + # this is a work around so we don't need to flush out the + # schema for each version at this time + # + # see issue: https://github.com/knative/serving/issues/912 + x-kubernetes-preserve-unknown-fields: true + additionalPrinterColumns: + - name: Ready + type: string + jsonPath: ".status.conditions[?(@.type==\"Ready\")].status" + - name: Reason + type: string + jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason" + names: + kind: Certificate + plural: certificates + singular: certificate + categories: + - knative-internal + - networking + shortNames: + - kcert + scope: Namespaced + +--- +# Copyright 2019 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: configurations.serving.knative.dev + labels: + serving.knative.dev/release: "v0.19.0" + knative.dev/crd-install: "true" + duck.knative.dev/podspecable: "true" +spec: + group: serving.knative.dev + versions: + - name: v1 + served: true + storage: true + subresources: + status: {} + schema: + openAPIV3Schema: + type: object + # this is a work around so we don't need to flush out the + # schema for each version at this time + # + # see issue: https://github.com/knative/serving/issues/912 + x-kubernetes-preserve-unknown-fields: true + additionalPrinterColumns: + - name: LatestCreated + type: string + jsonPath: .status.latestCreatedRevisionName + - name: LatestReady + type: string + jsonPath: .status.latestReadyRevisionName + - name: Ready + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].status" + - name: Reason + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].reason" + names: + kind: Configuration + plural: configurations + singular: configuration + categories: + - all + - knative + - serving + shortNames: + - config + - cfg + scope: Namespaced + +--- +# Copyright 2020 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: ingresses.networking.internal.knative.dev + labels: + serving.knative.dev/release: "v0.19.0" + knative.dev/crd-install: "true" +spec: + group: networking.internal.knative.dev + versions: + - name: v1alpha1 + served: true + storage: true + subresources: + status: {} + schema: + openAPIV3Schema: + type: object + # this is a work around so we don't need to flush out the + # schema for each version at this time + # + # see issue: https://github.com/knative/serving/issues/912 + x-kubernetes-preserve-unknown-fields: true + additionalPrinterColumns: + - name: Ready + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].status" + - name: Reason + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].reason" + names: + kind: Ingress + plural: ingresses + singular: ingress + categories: + - knative-internal + - networking + shortNames: + - kingress + - king + scope: Namespaced + +--- +# Copyright 2019 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: metrics.autoscaling.internal.knative.dev + labels: + serving.knative.dev/release: "v0.19.0" + knative.dev/crd-install: "true" +spec: + group: autoscaling.internal.knative.dev + versions: + - name: v1alpha1 + served: true + storage: true + subresources: + status: {} + schema: + openAPIV3Schema: + type: object + # this is a work around so we don't need to flush out the + # schema for each version at this time + # + # see issue: https://github.com/knative/serving/issues/912 + x-kubernetes-preserve-unknown-fields: true + additionalPrinterColumns: + - name: Ready + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].status" + - name: Reason + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].reason" + names: + kind: Metric + plural: metrics + singular: metric + categories: + - knative-internal + - autoscaling + scope: Namespaced + +--- +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: podautoscalers.autoscaling.internal.knative.dev + labels: + serving.knative.dev/release: "v0.19.0" + knative.dev/crd-install: "true" +spec: + group: autoscaling.internal.knative.dev + versions: + - name: v1alpha1 + served: true + storage: true + subresources: + status: {} + schema: + openAPIV3Schema: + type: object + # this is a work around so we don't need to flush out the + # schema for each version at this time + # + # see issue: https://github.com/knative/serving/issues/912 + x-kubernetes-preserve-unknown-fields: true + additionalPrinterColumns: + - name: DesiredScale + type: integer + jsonPath: ".status.desiredScale" + - name: ActualScale + type: integer + jsonPath: ".status.actualScale" + - name: Ready + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].status" + - name: Reason + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].reason" + names: + kind: PodAutoscaler + plural: podautoscalers + singular: podautoscaler + categories: + - knative-internal + - autoscaling + shortNames: + - kpa + - pa + scope: Namespaced + +--- +# Copyright 2019 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: revisions.serving.knative.dev + labels: + serving.knative.dev/release: "v0.19.0" + knative.dev/crd-install: "true" +spec: + group: serving.knative.dev + versions: + - name: v1 + served: true + storage: true + subresources: + status: {} + schema: + openAPIV3Schema: + type: object + # this is a work around so we don't need to flush out the + # schema for each version at this time + # + # see issue: https://github.com/knative/serving/issues/912 + x-kubernetes-preserve-unknown-fields: true + additionalPrinterColumns: + - name: Config Name + type: string + jsonPath: ".metadata.labels['serving\\.knative\\.dev/configuration']" + - name: K8s Service Name + type: string + jsonPath: ".status.serviceName" + - name: Generation + type: string # int in string form :( + jsonPath: ".metadata.labels['serving\\.knative\\.dev/configurationGeneration']" + - name: Ready + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].status" + - name: Reason + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].reason" + names: + kind: Revision + plural: revisions + singular: revision + categories: + - all + - knative + - serving + shortNames: + - rev + scope: Namespaced + +--- +# Copyright 2019 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: routes.serving.knative.dev + labels: + serving.knative.dev/release: "v0.19.0" + knative.dev/crd-install: "true" + duck.knative.dev/addressable: "true" +spec: + group: serving.knative.dev + versions: + - name: v1 + served: true + storage: true + subresources: + status: {} + schema: + openAPIV3Schema: + type: object + # this is a work around so we don't need to flush out the + # schema for each version at this time + # + # see issue: https://github.com/knative/serving/issues/912 + x-kubernetes-preserve-unknown-fields: true + additionalPrinterColumns: + - name: URL + type: string + jsonPath: .status.url + - name: Ready + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].status" + - name: Reason + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].reason" + names: + kind: Route + plural: routes + singular: route + categories: + - all + - knative + - serving + shortNames: + - rt + scope: Namespaced + +--- +# Copyright 2019 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: serverlessservices.networking.internal.knative.dev + labels: + serving.knative.dev/release: "v0.19.0" + knative.dev/crd-install: "true" +spec: + group: networking.internal.knative.dev + versions: + - name: v1alpha1 + served: true + storage: true + subresources: + status: {} + schema: + openAPIV3Schema: + type: object + # this is a work around so we don't need to flush out the + # schema for each version at this time + # + # see issue: https://github.com/knative/serving/issues/912 + x-kubernetes-preserve-unknown-fields: true + additionalPrinterColumns: + - name: Mode + type: string + jsonPath: ".spec.mode" + - name: Activators + type: integer + jsonPath: ".spec.numActivators" + - name: ServiceName + type: string + jsonPath: ".status.serviceName" + - name: PrivateServiceName + type: string + jsonPath: ".status.privateServiceName" + - name: Ready + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].status" + - name: Reason + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].reason" + names: + kind: ServerlessService + plural: serverlessservices + singular: serverlessservice + categories: + - knative-internal + - networking + shortNames: + - sks + scope: Namespaced + +--- +# Copyright 2019 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: services.serving.knative.dev + labels: + serving.knative.dev/release: "v0.19.0" + knative.dev/crd-install: "true" + duck.knative.dev/addressable: "true" + duck.knative.dev/podspecable: "true" +spec: + group: serving.knative.dev + versions: + - name: v1 + served: true + storage: true + subresources: + status: {} + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + properties: + spec: + type: object + x-kubernetes-preserve-unknown-fields: true + properties: + template: + type: object + x-kubernetes-preserve-unknown-fields: true + description: | + A template for the current desired application state. + Changes to `template` will cause a new Revision to be created as + defined in the lifecycle section. The contents of the Service's + RevisionTemplateSpec is used to create a corresponding Configuration. + traffic: + x-kubernetes-preserve-unknown-fields: true + type: array + description: | + Traffic specifies how to distribute traffic over a + collection of Revisions belonging to the Service. If traffic is + empty or not provided, defaults to 100% traffic to the latest + `Ready` Revision. The contents of the Service's TrafficTarget is + used to create a corresponding Route. + items: + type: object + x-kubernetes-preserve-unknown-fields: true + properties: + revisionName: + type: string + description: | + A specific revision to which to send this portion + of traffic. + This is mutually exclusive with configurationName. + configurationName: + type: string + description: | + ConfigurationName of a configuration to whose latest revision we will send + this portion of traffic. When the "status.latestReadyRevisionName" of the + referenced configuration changes, we will automatically migrate traffic + from the prior "latest ready" revision to the new one. This field is never + set in Route's status, only its spec. + This is mutually exclusive with RevisionName. + latestRevision: + type: boolean + description: | + `latestRevision` may be optionally provided to indicate + that the latest ready Revision of the Configuration should be used + for this traffic target. When provided latestRevision MUST be true + if revisionName is empty, and it MUST be false when revisionName is non-empty. + tag: + type: string + description: | + Tag is optionally used to expose a dedicated URL for + referencing this target exclusively. The dedicated URL MUST include + in it the string provided by tag. + percent: + type: integer + description: | + The percentage of requests which should be allocated + from the main Route domain name to the specified `revisionName` or + `configurationName`. + All `percent` values in `traffic` MUST sum to 100. + minimum: 0 + maximum: 100 + status: + type: object + x-kubernetes-preserve-unknown-fields: true + additionalPrinterColumns: + - name: URL + type: string + jsonPath: .status.url + - name: LatestCreated + type: string + jsonPath: .status.latestCreatedRevisionName + - name: LatestReady + type: string + jsonPath: .status.latestReadyRevisionName + - name: Ready + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].status" + - name: Reason + type: string + jsonPath: ".status.conditions[?(@.type=='Ready')].reason" + names: + kind: Service + plural: services + singular: service + categories: + - all + - knative + - serving + shortNames: + - kservice + - ksvc + scope: Namespaced + +--- +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: images.caching.internal.knative.dev + labels: + knative.dev/crd-install: "true" +spec: + group: caching.internal.knative.dev + names: + kind: Image + plural: images + singular: image + categories: + - knative-internal + - caching + shortNames: + - img + scope: Namespaced + versions: + - name: v1alpha1 + served: true + storage: true + subresources: + status: {} + schema: + openAPIV3Schema: + type: object + # this is a work around so we don't need to flush out the + # schema for each version at this time + # + # see issue: https://github.com/knative/serving/issues/912 + x-kubernetes-preserve-unknown-fields: true + additionalPrinterColumns: + - name: Image + type: string + jsonPath: .spec.image + +---