Dynamic Service Ordering Form #14
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: servala/servala-portal#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stories
As a user, I want to see the service configuration form so that I can configure the service parameters for ordering
This story only concerns the dynamic creation of the service configuration form, not the actual creation of the service (this will be in another story).
Implementation Notes
CompositeResourceDefinition
(akaXRD
) implements the service on a control plane, and to query the OpenAPI spec forhttps://kubernetesapi/apis/apiextensions.k8s.io/v1/customresourcedefinitions/$name
, e.g.http://kubernetesapi/apis/apiextensions.k8s.io/v1/customresourcedefinitions/xvshnredis.vshn.appcat.vshn.io
In the service definition, we currently have the GVK of the resource we want to create. To now get the OpenAPI spec for it, there are multiple ways:
kubectl --kubeconfig tmp/kubeconfig-dev-servala-portal api-resources --api-group=vshn.appcat.vshn.io --output=wide
. Adding-v=9
shows the http requests and responses to learn what the command actually does./openapi/v3/apis/$group/$version
, e.g./openapi/v3/apis/vshn.appcat.vshn.io/v1
. Go through the discovery endpoint/openapi/v3
and get the spec URL from.paths."apis/vshn.appcat.vshn.io/v1"
This spec contains all resources from the group, so the specific kind will have to be extracted accordingly.In the implementation notes is written "The OpenAPI v3 Specification of a XRD is available under
https://kubernetesapi/apis/...
- This is not fully accurate, direct access to the OpenAPI v3 specification is under/openapi/v3
. See https://kubernetes.io/docs/concepts/overview/kubernetes-api/#openapi-v3. Under/apis/...
we do get the Kubernetes resource. InCustomResourceDefinition
we do get access to the OpenAPI spec under.spec.versions[0].schema.openAPIV3Schema
.