Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.17.3
name: cachedresourceendpointslices.cache.kcp.io
name: clustercachedresourceendpointslices.cache.kcp.io
spec:
group: cache.kcp.io
names:
categories:
- kcp
kind: CachedResourceEndpointSlice
listKind: CachedResourceEndpointSliceList
plural: cachedresourceendpointslices
singular: cachedresourceendpointslice
kind: ClusterCachedResourceEndpointSlice
listKind: ClusterCachedResourceEndpointSliceList
plural: clustercachedresourceendpointslices
singular: clustercachedresourceendpointslice
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.cachedResource.name
name: CachedResource
- jsonPath: .spec.clusterCachedResource.name
name: ClusterCachedResource
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: CachedResourceEndpointSlice is a sink for the endpoints of CachedResource
virtual workspaces.
description: ClusterCachedResourceEndpointSlice is a sink for the endpoints
of ClusterCachedResource virtual workspaces.
properties:
apiVersion:
description: |-
Expand All @@ -49,30 +49,30 @@ spec:
spec:
description: |-
spec holds the desired state:
- the targeted CachedResource
- the targeted ClusterCachedResource
properties:
cachedResource:
description: CachedResource points to the real CachedResource the
slice is created for.
clusterCachedResource:
description: ClusterCachedResource points to the real ClusterCachedResource
the slice is created for.
properties:
name:
description: name is the name of the CachedResource the reference
points to.
description: name is the name of the ClusterCachedResource the
reference points to.
type: string
path:
description: |-
path is a logical cluster path where the CachedResource is defined. If empty,
the CachedResource is assumed to be co-located with the referencing resource.
path is a logical cluster path where the ClusterCachedResource is defined. If empty,
the ClusterCachedResource is assumed to be co-located with the referencing resource.
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(:[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
required:
- name
type: object
x-kubernetes-validations:
- message: CachedResource reference must not be changed
- message: ClusterCachedResource reference must not be changed
rule: self == oldSelf
export:
description: export points to the APIExport that exports this CachedResourceEndpointSlice.
description: export points to the APIExport that exports this ClusterCachedResourceEndpointSlice.
properties:
name:
description: name is the name of the APIExport that describes
Expand All @@ -93,10 +93,10 @@ spec:
partition:
description: |-
partition points to a partition that is used for filtering the endpoints
of the CachedResource part of the slice.
of the ClusterCachedResource part of the slice.
type: string
required:
- cachedResource
- clusterCachedResource
- export
type: object
status:
Expand All @@ -106,7 +106,7 @@ spec:
properties:
conditions:
description: conditions is a list of conditions that apply to the
CachedResourceEndpointSlice.
ClusterCachedResourceEndpointSlice.
items:
description: Condition defines an observation of a object operational
state.
Expand Down Expand Up @@ -153,8 +153,8 @@ spec:
endpoints:
description: endpoints contains all the URLs of the Replication service.
items:
description: CachedResourceEndpoint contains the endpoint information
of a Replication service for a specific shard.
description: ClusterCachedResourceEndpoint contains the endpoint
information of a Replication service for a specific shard.
properties:
url:
description: url is Replication virtual workspace URL.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.17.3
name: cachedresources.cache.kcp.io
name: clustercachedresources.cache.kcp.io
spec:
group: cache.kcp.io
names:
categories:
- kcp
kind: CachedResource
listKind: CachedResourceList
plural: cachedresources
singular: cachedresource
kind: ClusterCachedResource
listKind: ClusterCachedResourceList
plural: clustercachedresources
singular: clustercachedresource
scope: Cluster
versions:
- additionalPrinterColumns:
Expand All @@ -27,8 +27,8 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
description: CachedResource defines a resource that should be published to
other workspaces
description: ClusterCachedResource defines a resource that should be published
to other workspaces
properties:
apiVersion:
description: |-
Expand All @@ -48,7 +48,7 @@ spec:
metadata:
type: object
spec:
description: CachedResourceSpec defines the desired state of CachedResource.
description: ClusterCachedResourceSpec defines the desired state of ClusterCachedResource.
properties:
group:
description: |-
Expand All @@ -59,13 +59,13 @@ spec:
identity:
description: |-
identity points to a secret that contains the API identity in the 'key' file.
The API identity allows access to CachedResource's resources via the APIExport.
The API identity allows access to ClusterCachedResource's resources via the APIExport.

Different CachedResource in a workspace can share a common identity, or have different
Different ClusterCachedResource in a workspace can share a common identity, or have different
ones. The identity (the secret) can also be transferred to another workspace
when the ublishedResource is moved.

The identity is defaulted. A secret with the name of the CachedResource is automatically
The identity is defaulted. A secret with the name of the ClusterCachedResource is automatically
created.
properties:
secretRef:
Expand Down Expand Up @@ -144,7 +144,8 @@ spec:
- resource
type: object
status:
description: CachedResourceStatus defines the observed state of CachedResource.
description: ClusterCachedResourceStatus defines the observed state of
ClusterCachedResource.
properties:
conditions:
description: Current processing state of the Workspace.
Expand Down
14 changes: 7 additions & 7 deletions config/examples/virtualresources/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# VirtualResources Example

This example shows usage of virtual resources, together with CachedResources.
The goal of CachedResources is to distribute static, read-only resources to multiple clusters
This example shows usage of virtual resources, together with ClusterCachedResources.
The goal of ClusterCachedResources is to distribute static, read-only resources to multiple clusters
in a scalable way.

## Setup
Expand All @@ -23,9 +23,9 @@ in a scalable way.
kubectl create -f config/examples/virtualresources/apiresourceschema-instances.yaml
kubectl create -f config/examples/virtualresources/instances.yaml

# create caching for the resources with a pre-made CachedResources identity
kubectl create -f config/examples/virtualresources/cached-resource-identity.yaml
kubectl create -f config/examples/virtualresources/cached-resource-instances.yaml
# create caching for the resources with a pre-made ClusterCachedResources identity
kubectl create -f config/examples/virtualresources/cluster-cached-resource-identity.yaml
kubectl create -f config/examples/virtualresources/cluster-cached-resource-instances.yaml
```

3. Create an APIResourceSchema for actual virtual machines to be distributed,
Expand All @@ -35,11 +35,11 @@ in a scalable way.
kubectl create -f config/examples/virtualresources/apiresourceschema-virtualmachine.yaml
```

4. Create an APIExport for the virtual machines and the CachedResourceEndpointSlice that references it:
4. Create an APIExport for the virtual machines and the ClusterCachedResourceEndpointSlice that references it:

```bash
kubectl create -f config/examples/virtualresources/apiexport.yaml
kubectl create -f config/examples/virtualresources/cached-resource-instances-endpointslice.yaml
kubectl create -f config/examples/virtualresources/cluster-cached-resource-instances-endpointslice.yaml
```

5. Create a consumer workspace, where we will consume the virtual machines:
Expand Down
2 changes: 1 addition & 1 deletion config/examples/virtualresources/apiexport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
virtual:
reference:
apiGroup: cache.kcp.io
kind: CachedResourceEndpointSlice
kind: ClusterCachedResourceEndpointSlice
name: instances
identityHash: 676a1a997f7507fdfcfd1fcf35920efdff1297cd215cad4f486220c30a5c7090
- name: virtualmachines
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: cache.kcp.io/v1alpha1
kind: CachedResourceEndpointSlice
kind: ClusterCachedResourceEndpointSlice
metadata:
name: instances
spec:
cachedResource:
clusterCachedResource:
name: instances
export:
name: virtualmachines
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: cache.kcp.io/v1alpha1
kind: CachedResource
kind: ClusterCachedResource
metadata:
name: instances
spec:
Expand Down
8 changes: 4 additions & 4 deletions config/root-phase0/apiexport-cache.kcp.io.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ metadata:
spec:
resources:
- group: cache.kcp.io
name: cachedresourceendpointslices
schema: v260407-65ee8229a.cachedresourceendpointslices.cache.kcp.io
name: clustercachedresourceendpointslices
schema: v260407-65ee8229a.clustercachedresourceendpointslices.cache.kcp.io
storage:
crd: {}
- group: cache.kcp.io
name: cachedresources
schema: v250920-de0c8484d.cachedresources.cache.kcp.io
name: clustercachedresources
schema: v250920-de0c8484d.clustercachedresources.cache.kcp.io
storage:
crd: {}
status: {}
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
apiVersion: apis.kcp.io/v1alpha1
kind: APIResourceSchema
metadata:
name: v260407-65ee8229a.cachedresourceendpointslices.cache.kcp.io
name: v260407-65ee8229a.clustercachedresourceendpointslices.cache.kcp.io
spec:
group: cache.kcp.io
names:
categories:
- kcp
kind: CachedResourceEndpointSlice
listKind: CachedResourceEndpointSliceList
plural: cachedresourceendpointslices
singular: cachedresourceendpointslice
kind: ClusterCachedResourceEndpointSlice
listKind: ClusterCachedResourceEndpointSliceList
plural: clustercachedresourceendpointslices
singular: clustercachedresourceendpointslice
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.cachedResource.name
name: CachedResource
- jsonPath: .spec.clusterCachedResource.name
name: ClusterCachedResource
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
description: CachedResourceEndpointSlice is a sink for the endpoints of CachedResource
virtual workspaces.
description: ClusterCachedResourceEndpointSlice is a sink for the endpoints
of ClusterCachedResource virtual workspaces.
properties:
apiVersion:
description: |-
Expand All @@ -45,30 +45,30 @@ spec:
spec:
description: |-
spec holds the desired state:
- the targeted CachedResource
- the targeted ClusterCachedResource
properties:
cachedResource:
description: CachedResource points to the real CachedResource the slice
is created for.
clusterCachedResource:
description: ClusterCachedResource points to the real ClusterCachedResource
the slice is created for.
properties:
name:
description: name is the name of the CachedResource the reference
description: name is the name of the ClusterCachedResource the reference
points to.
type: string
path:
description: |-
path is a logical cluster path where the CachedResource is defined. If empty,
the CachedResource is assumed to be co-located with the referencing resource.
path is a logical cluster path where the ClusterCachedResource is defined. If empty,
the ClusterCachedResource is assumed to be co-located with the referencing resource.
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(:[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
required:
- name
type: object
x-kubernetes-validations:
- message: CachedResource reference must not be changed
- message: ClusterCachedResource reference must not be changed
rule: self == oldSelf
export:
description: export points to the APIExport that exports this CachedResourceEndpointSlice.
description: export points to the APIExport that exports this ClusterCachedResourceEndpointSlice.
properties:
name:
description: name is the name of the APIExport that describes the
Expand All @@ -89,10 +89,10 @@ spec:
partition:
description: |-
partition points to a partition that is used for filtering the endpoints
of the CachedResource part of the slice.
of the ClusterCachedResource part of the slice.
type: string
required:
- cachedResource
- clusterCachedResource
- export
type: object
status:
Expand All @@ -101,7 +101,7 @@ spec:
the filtered list of endpoints for the Replication service.
properties:
conditions:
description: conditions is a list of conditions that apply to the CachedResourceEndpointSlice.
description: conditions is a list of conditions that apply to the ClusterCachedResourceEndpointSlice.
items:
description: Condition defines an observation of a object operational
state.
Expand Down Expand Up @@ -148,7 +148,7 @@ spec:
endpoints:
description: endpoints contains all the URLs of the Replication service.
items:
description: CachedResourceEndpoint contains the endpoint information
description: ClusterCachedResourceEndpoint contains the endpoint information
of a Replication service for a specific shard.
properties:
url:
Expand Down
Loading