From a60dd677d798d5d3d5e5ad7f8fbb75fcbd52346d Mon Sep 17 00:00:00 2001 From: Reza Ramezanpour <54559947+frozenprocess@users.noreply.github.com> Date: Mon, 15 May 2023 01:09:28 -0700 Subject: [PATCH] Update: Plugin resources. (#7732) * Experimental annotation until we can sort out the approval. https://github.com/kedacore/keda/issues/552 * Url in docs pointing to the right resource --- docs/plugins/README.md | 6 ++-- hack/test-resources/plugin-crd.yml | 56 +++++++++++++++-------------- hack/test-resources/plugin-test.yml | 4 +-- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/docs/plugins/README.md b/docs/plugins/README.md index f63d9ea7840e..ee775436fb71 100644 --- a/docs/plugins/README.md +++ b/docs/plugins/README.md @@ -10,7 +10,7 @@ To enable plugin support in the dashboard you must register a custom [CRD](../../aio/test-resources/plugin-crd.yml) in your cluster. ```shell -kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/test-resources/plugin-crd.yml +kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/hack/test-resources/plugin-crd.yml ``` ### Compiling Plugins @@ -32,7 +32,7 @@ The key thing here is that we specify the `custom-plugin` project in the `angula Once the custom CRD is registered we can now create [instances](../../aio/test-resources/plugin-test.yml) of the CRD which will hold the spec for plugin. ```shell -kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/test-resources/plugin-test.yml +kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/hack/test-resources/plugin-test.yml ``` > Note: The backend reads the compiled plugin source from a ConfigMap and we need to create that also. @@ -49,4 +49,4 @@ kubectl create configmap plugin1-src --from-file="./dist/bundle/plugin1.js" After following all the above steps, your new plugin should be available in the dashboard. ---- -_Copyright 2021 [The Kubernetes Dashboard Authors](https://github.com/kubernetes/dashboard/graphs/contributors)_ \ No newline at end of file +_Copyright 2021 [The Kubernetes Dashboard Authors](https://github.com/kubernetes/dashboard/graphs/contributors)_ diff --git a/hack/test-resources/plugin-crd.yml b/hack/test-resources/plugin-crd.yml index 2988cf376e86..a65dc0659400 100644 --- a/hack/test-resources/plugin-crd.yml +++ b/hack/test-resources/plugin-crd.yml @@ -11,49 +11,53 @@ # 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. -# + +# A manifest that creates test plugin custom resource definition. + apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: plugins.dashboard.k8s.io + annotations: + "api-approved.kubernetes.io": "unapproved - Experimental" spec: group: dashboard.k8s.io scope: Namespaced versions: - - name: v1alpha1 + - name: v1 served: true storage: true - names: - kind: Plugin - plural: plugins - singular: plugin - validation: - openAPIV3Schema: - type: object - properties: - spec: + schema: + openAPIV3Schema: type: object properties: - source: + spec: type: object properties: - configMapRef: + source: type: object properties: - name: + configMapRef: + type: object + properties: + name: + type: string + required: + - name + filename: type: string required: - - name - filename: - type: string + - configMapRef + - filename + dependencies: + type: array + items: + type: string required: - - configMapRef - - filename - dependencies: - type: array - items: - type: string + - source required: - - source - required: - - spec + - spec + names: + kind: Plugin + plural: plugins + singular: plugin diff --git a/hack/test-resources/plugin-test.yml b/hack/test-resources/plugin-test.yml index 4fe018e910dd..c013ee286588 100644 --- a/hack/test-resources/plugin-test.yml +++ b/hack/test-resources/plugin-test.yml @@ -14,7 +14,7 @@ # A manifest that creates test plugin resources. -apiVersion: dashboard.k8s.io/v1alpha1 +apiVersion: dashboard.k8s.io/v1 kind: Plugin metadata: name: k8s-plugin @@ -26,7 +26,7 @@ spec: --- -apiVersion: dashboard.k8s.io/v1alpha1 +apiVersion: dashboard.k8s.io/v1 kind: Plugin metadata: name: plugin1