-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add cloud api assets and docs #466
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
Open
olzemal
wants to merge
1
commit into
main
Choose a base branch
from
feature/cloud-api-assets
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # consumer assets | ||
|
|
||
| These manifests configure a kcp consumer workspace to subscribe to the ARC | ||
| `APIExport`. An `APIBinding` references the export and explicitly accepts the | ||
| provider's `PermissionClaims` for `Secrets`, `Namespaces`, `Events`, and | ||
| `LogicalClusters` so the sync agent can operate across workspaces. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| apiVersion: apis.kcp.io/v1alpha2 | ||
| kind: APIBinding | ||
| metadata: | ||
| name: arc.opendefense.cloud | ||
| spec: | ||
| reference: | ||
| export: | ||
| name: arc.opendefense.cloud | ||
| # path: root:somepath | ||
| permissionClaims: | ||
| - group: "" | ||
| resource: "secrets" | ||
| verbs: ["get", "list", "watch", "create", "update", "patch"] | ||
| selector: | ||
| matchAll: true | ||
| state: Accepted | ||
| - group: "" | ||
| resource: "namespaces" | ||
| verbs: ["get", "list", "watch"] | ||
| selector: | ||
| matchAll: true | ||
| state: Accepted | ||
| - group: "" | ||
| resource: "events" | ||
| verbs: ["get", "list", "watch", "create", "update", "patch"] | ||
| selector: | ||
| matchAll: true | ||
| state: Accepted | ||
| - group: "core.kcp.io" | ||
| resource: "logicalclusters" | ||
| verbs: ["get", "list", "watch"] | ||
| selector: | ||
| matchAll: true | ||
| state: Accepted | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # provider assets | ||
|
|
||
| These manifests configure a kcp provider workspace to expose ARC APIs (`orders` | ||
| and `endpoints`) to consumer workspaces through the kcp | ||
| [`APIExport`][apiexport] marketplace. They define the | ||
| [`APIResourceSchema`][ars] for each resource, the export, an | ||
| `APIExportEndpointSlice` for virtual-workspace discovery, and the RBAC grants | ||
| that let consumers [`APIBind`][apibinding] the export. | ||
|
|
||
| [`PermissionClaims`][permissionclaims] for `Secrets`, `Namespaces`, `Events`, | ||
| and `LogicalClusters` are offered on the export so consumer workspaces can | ||
| accept them — the sync agent needs cross-workspace access to operate. | ||
|
|
||
| A [`DependencyRule`][dep] prevents deletion of `Endpoints` while `Orders` still | ||
| reference them. | ||
|
|
||
| The sync agent's own schema and export controllers are intentionally disabled; | ||
| schemas and exports are maintained here as plain Git-managed manifests for full | ||
| reproducibility. | ||
|
|
||
| Subdirectories: | ||
|
|
||
| - **`syncagent/`** — Flux-based deployment of the kcp api-syncagent | ||
| (HelmRelease, RBAC, kubeconfig Secret). | ||
| - **`ui/`** — ProviderMetadata and ContentConfiguration manifests that surface | ||
| ARC in the platform-mesh marketplace UI. | ||
|
|
||
| [apiexport]: https://docs.kcp.io/kcp/latest/reference/apis/apiexport/ | ||
| [apibinding]: https://docs.kcp.io/kcp/latest/reference/apis/apibinding/ | ||
| [ars]: https://docs.kcp.io/kcp/latest/reference/apis/apiresourceschema/ | ||
| [permissionclaims]: https://docs.kcp.io/kcp/latest/reference/apis/apiexport/#permissionclaims | ||
| [dep]: https://github.com/opendefensecloud/dependency-controller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| # Grants the bind verb so marketplace consumers can APIBind this export. | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: arc-apiexport-bind | ||
| rules: | ||
| - apiGroups: ["apis.kcp.io"] | ||
| resources: ["apiexports"] | ||
| resourceNames: ["arc.opendefense.cloud"] | ||
| verbs: ["bind"] | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: arc-apiexport-bind | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: arc-apiexport-bind | ||
| subjects: | ||
| - apiGroup: rbac.authorization.k8s.io | ||
| kind: Group | ||
| name: system:authenticated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| --- | ||
| apiVersion: apis.kcp.io/v1alpha2 | ||
| kind: APIExport | ||
| metadata: | ||
| name: arc.opendefense.cloud | ||
| labels: | ||
| # Surfaces ARC's provider ContentConfigurations to binding consumers — the | ||
| # /services/contentconfigurations VW selects provider CCs by this label. | ||
| ui.platform-mesh.io/content-for: arc.opendefense.cloud | ||
| spec: | ||
| resources: | ||
| - group: arc.opendefense.cloud | ||
| name: orders | ||
| schema: v4d632a97.orders.arc.opendefense.cloud | ||
| storage: | ||
| crd: {} | ||
| - group: arc.opendefense.cloud | ||
| name: endpoints | ||
| schema: vcf11840f.endpoints.arc.opendefense.cloud | ||
| storage: | ||
| crd: {} | ||
| permissionClaims: | ||
| - group: "" | ||
| resource: "events" | ||
| verbs: ["get", "list", "watch", "create", "update", "patch"] | ||
| - group: "" | ||
| resource: "secrets" | ||
| verbs: ["get", "list", "watch", "create", "update", "patch"] | ||
| - group: "" | ||
| resource: "namespaces" | ||
| verbs: ["get", "list", "watch"] | ||
| - group: "core.kcp.io" | ||
| resource: "logicalclusters" | ||
| verbs: ["get", "list", "watch"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| # kcp populates .status.endpoints with the virtual-workspace URLs the agent connects to. | ||
| apiVersion: apis.kcp.io/v1alpha1 | ||
| kind: APIExportEndpointSlice | ||
| metadata: | ||
| name: arc.opendefense.cloud | ||
| spec: | ||
| export: | ||
| name: arc.opendefense.cloud |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| --- | ||
| # Hand-authored APIResourceSchema — workarounds for autogeneration failures (see #442). | ||
| # Fixes: empty EndpointStatus → preserve-unknown-fields; added /status subresource. | ||
| # Immutable: bumps metadata.name on schema changes. | ||
| apiVersion: apis.kcp.io/v1alpha1 | ||
| kind: APIResourceSchema | ||
| metadata: | ||
| name: vcf11840f.endpoints.arc.opendefense.cloud | ||
| labels: | ||
| syncagent.kcp.io/agent-name: arc | ||
| annotations: | ||
| syncagent.kcp.io/agent-name: arc | ||
| syncagent.kcp.io/source-generation: "0" | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| spec: | ||
| group: arc.opendefense.cloud | ||
| nameValidation: DNS1123Subdomain | ||
| names: | ||
| kind: Endpoint | ||
| listKind: EndpointList | ||
| plural: endpoints | ||
| singular: endpoint | ||
| scope: Namespaced | ||
| versions: | ||
| - name: v1alpha1 | ||
| schema: | ||
| description: Endpoint is the Schema for the endpoints API | ||
| type: object | ||
| properties: | ||
| apiVersion: | ||
| 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' | ||
| type: string | ||
| kind: | ||
| 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' | ||
| type: string | ||
| metadata: | ||
| type: object | ||
| spec: | ||
| description: EndpointSpec specifies a single artifact which is translated | ||
| into a corresponding Workflow based on its type. | ||
| type: object | ||
| required: | ||
| - type | ||
| - remoteURL | ||
| - usage | ||
| properties: | ||
| type: | ||
| description: Type specifies which ArtifactType is used to process this | ||
| artifact. | ||
| type: string | ||
| remoteURL: | ||
| description: RemoteURL defines the URL which is used to interact with | ||
| the endpoint. | ||
| type: string | ||
| usage: | ||
| description: |- | ||
| Usage defines how the endpoint is allowed to be used. | ||
|
|
||
| Possible enum values: | ||
| - `"All"` means the endpoint can be used with all kinds of usage patterns. | ||
| - `"PullOnly"` means the endpoint can only be used to pull data. | ||
| - `"PushOnly"` means the endpoint can only be used to push data. | ||
| type: string | ||
| enum: | ||
| - All | ||
| - PullOnly | ||
| - PushOnly | ||
| secretRef: | ||
| description: SecretRef specifies the secret containing the relevant | ||
| credentials for the endpoint. | ||
| type: object | ||
| properties: | ||
| name: | ||
| description: 'Name of the referent. This field is effectively required, | ||
| but due to backwards compatibility is allowed to be empty. Instances | ||
| of this type with an empty value here are almost certainly wrong. | ||
| More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' | ||
| type: string | ||
| status: | ||
| description: EndpointStatus defines the observed state of Endpoint | ||
| type: object | ||
| x-kubernetes-preserve-unknown-fields: true | ||
| served: true | ||
| storage: true | ||
| subresources: | ||
| status: {} | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.