Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update: Plugin resources, and docs #7732

Merged
merged 1 commit into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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)_
_Copyright 2021 [The Kubernetes Dashboard Authors](https://github.com/kubernetes/dashboard/graphs/contributors)_
56 changes: 30 additions & 26 deletions hack/test-resources/plugin-crd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions hack/test-resources/plugin-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,7 +26,7 @@ spec:

---

apiVersion: dashboard.k8s.io/v1alpha1
apiVersion: dashboard.k8s.io/v1
kind: Plugin
metadata:
name: plugin1
Expand Down