Skip to content

Commit 623ae87

Browse files
committed
provide basic usage docs
On-behalf-of: @SAP christoph.mewes@sap.com
1 parent 9b4cc97 commit 623ae87

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

docs/content/architecture/.pages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ nav:
22
- index.md
33
- basics.md
44
- front-proxy.md
5+
- cache-server.md
56
- kubeconfig.md
67
- Certificate Management: pki.md
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
description: >
3+
Explains how to use an external cache server in a kcp installation.
4+
---
5+
6+
# kcp cache-server
7+
8+
The kcp cache-server is used to coordinate all shards within one kcp installation. It holds data used
9+
by all of them, like `APIExports`, `Workspaces` and RBAC to some degree. If no standalone cache is
10+
configured, then the kcp root shard will run an in-process cache that uses the root shard's etcd as
11+
its storage backend. However once multiple shards are involved, a standalone cache server should be
12+
provisioned.
13+
14+
!!! warning
15+
Currently there is no support for persistence in kcp's cache-server, so whenever the Pod is
16+
restarted, it will have to be re-filled over time by the kcp shards.
17+
18+
## Architecture
19+
20+
The cache server is a purely passive server: It doesn't connect to any shard or proxy, but instead
21+
all the kcp shards connect to it, in order to store their data on the cache. This makes the server
22+
conceptually very simple, since it all it needs to function is a TLS serving certificate.
23+
24+
As of kcp 0.30, there is only a single cache server supported for a whole kcp installation
25+
consisting of multiple shads). Future kcp releases might extend this to allow multiple, geographically
26+
close, cache servers.
27+
28+
## Usage
29+
30+
To deploy a cache server, create a `CacheServer` object:
31+
32+
```yaml
33+
apiVersion: operator.kcp.io/v1alpha1
34+
kind: CacheServer
35+
metadata:
36+
name: my-cache-server
37+
namespace: example
38+
spec:
39+
certificates:
40+
issuerRef:
41+
group: cert-manager.io
42+
kind: ClusterIssuer
43+
name: selfsigned
44+
```
45+
46+
The kcp-operator will provision a root CA and a serving certificate for the cache server. For this,
47+
similar to how `RootShard` work, you need to configure either your desired `ClusterIssuer` or provide
48+
a pre-existing CA certificate/key as a `Secret`.
49+
50+
Once the `CacheServer` object is created and reconciled, you need to configure the `RootShard` and each
51+
`Shard` to make use of it, since by default the embedded cache would be enabled. To do so, refer to
52+
the new `CacheServer` object in your shard:
53+
54+
```yaml
55+
apiVersion: operator.kcp.io/v1alpha1
56+
kind: RootShard
57+
metadata:
58+
name: my-root
59+
namespace: example
60+
spec:
61+
# ...
62+
63+
cache:
64+
ref:
65+
name: my-cache-server
66+
67+
# ...
68+
```
69+
70+
Once applied, the kcp-operator will reconfigure the shard `Deployments` accordingly and briefly after
71+
that, the cache server will be filled with data.

docs/content/architecture/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This section describes how the kcp-operator is designed and meant to be used.
66

77
- [Basics](basics.md) – A general overview over the resources provided by the kcp-operator.
88
- [front-proxy](front-proxy.md) – Explains how the kcp front-proxy can be used to ingest traffic.
9+
- [cache-server](cache-server.md) – Explains how to use an external cache server in a kcp installation.
910
- [Certificate Management](pki.md) – This page describes the various CAs and certificates used in a kcp installation.
1011
- [Kubeconfig](kubeconfig.md) – Shows how `Kubeconfig` objects can be used to provide credentials to kcp.
1112
<!--

0 commit comments

Comments
 (0)