@@ -43,139 +43,168 @@ subgraph Consumer
4343end
4444```
4545
46- ## KCP to Kube
46+ ## Kube to KCP to Kube
4747
4848### Problem Description
4949
50- TODO
50+ The problem is specified on the example of an Internal Developer
51+ Platform (IDP). Teams can be Providers and Consumer of Services.
5152
52- ### Solution
53-
54- api-syncagent is run by the provider to export offerings in the KCP workspace.
55- Consumers bind the APIExport and use kube-bind the pull the resulting CRD and push instances.
53+ The Database Team (DB) offers a Postgres Service.
54+ The Observability Team (Obs) wants to use the Postgres Service as the
55+ database for their Elastic service.
56+ The Webshop Team (WS) wants to use the Postgres Services as the database
57+ for the Webshops they maintain for their customers and the Elastic
58+ Service for logging and metrics.
5659
57- kube-bind can be a kube-bind backend in KCP or konnector run by the consumers.
60+ This diagram shows the premise of the problem:
5861
5962``` mermaid
6063flowchart LR
6164
62- subgraph PC1[Provider Compute 1]
63- providerCRD1([CRD1])
64- providerCRD2([CRD2])
65- instancep1([Instance])
65+ subgraph KCP
66+ subgraph KCP_DB[root:team:database]
67+ PGExport[Postgres APIExport]
6668 end
6769
68-
69- providerCRD1 --> |api-syncagent| providerwsCRD1
70- providerCRD2 --> |api-syncagent| providerwsCRD2
71-
72- subgraph KCP
73- subgraph PWS[Provider WS]
74- providerwsCRD1([CRD1])
75- providerwsCRD2([CRD2])
76- end
77-
78- subgraph CAWS[Consumer A WS]
79- consumerawsCRD1([CRD1])
80- end
81-
82- providerwsCRD1 --> |APIBinding| consumerawsCRD1
83-
84- subgraph CBWS[Consumer B WS]
85- consumerbwsCRD2([CRD2])
86- instancews1([Instance])
87- end
88-
89- providerwsCRD2 --> |APIBinding| consumerbwsCRD2
90- instancews1 --> |VW| instancep1
70+ subgraph KCP_Obs[root:team:observability]
71+ PGBindingObs[Postgres APIBinding]
72+ ElasticExport[Elastic APIExport]
9173 end
74+ PGExport -.-> PGBindingObs
9275
93- consumerawsCRD1 --> |kube-bind| consumeraCRD1
94-
95- subgraph CA[Consumer A]
96- consumeraCRD1([CRD1])
76+ subgraph KCP_WS[root:team:webshop]
77+ ElasticBinding[Elastic APIBinding]
78+ PGBindingWS[Postgres APIBinding]
9779 end
80+ PGExport -.-> PGBindingWS
81+ ElasticExport -.-> ElasticBinding
82+ end
9883
99- consumerbwsCRD2 --> |kube-bind| consumerbCRD2
100- instanceb1 --> |kube-bind| instancews1
84+ subgraph DBCompute[Database Compute Cluster]
85+ PGCRD[Postgres CRD]
86+ PGCRD -.-> |api-syncagent| PGExport
87+ end
10188
102- subgraph CB[Cosumer B]
103- consumerbCRD2([CRD2])
104- instanceb1([Instnce])
105- end
89+ subgraph ObsCompute[Observability Compute Cluster]
90+ ElasticCRD[Elastic CRD]
91+ ElasticCRD -.-> |api-syncagent| ElasticExport
92+ end
93+
94+ subgraph WSCompute[Workshop Compute Cluster]
95+ Webshop
96+ end
10697```
10798
108- ## Internal Development Platform
99+ Not pictures is the teams using e.g. GitOps to manage the components of
100+ their services, which are running in the respective clusters.
109101
110- ### Problem Description
102+ ### Tools Solution
111103
112- TODO
104+ This solution focuses on using commonly available tools to manage and
105+ apply the manifests.
113106
114- ### Solution
107+ The Obersvability Team uses KRO (Kubernetes Resource Orchestrator) to
108+ instantiate their Elastic Service, including the Postgres Instance from
109+ the Database Team.
115110
116- KCP used as an internal developer platform with teams offering services that in turn utilize other services on the IDP.
111+ Since KRO works only on one Cluster they are using kube-bind to pull the
112+ CRD of the Postgres Services from the APIBinding they created in their
113+ workspace to their compute cluster.
117114
118- Here the Observability team is offering Elastic instances. For Elastic they need a relational database and chose Postgres, which the Database team offers.
115+ The postgres instance for an elastic service is created as part of the
116+ KRO Resource Graph Definition, which is mirrored back to KCP by
117+ kube-bind.
119118
120119``` mermaid
121120flowchart TD
122121
123122subgraph KCP
124- subgraph DatabaseWS[Database Team Workspace ]
123+ subgraph KCP_DB[root:team:database ]
125124 PGExport[Postgres APIExport]
126- subgraph PGExportVW[Postgres VW]
127- PGInstanceDbWs
128- end
129- end
130-
131- PGExport -.-> PGBinding
132- PGInstanceObsWs --> |VW| PGInstanceDbWs
133-
134- subgraph ObservabilityWS[Observability Team Workspace]
135- PGBinding[Postgres APIBinding]
136- PGInstanceObsWs[Postgres Instance]
137-
138- ELKExport[Elastic APIExport]
139- subgraph ELKExportVW[Elastic VW]
140- ELKInstanceProvider[ELK Instance]
141- end
142125 end
143126
144- ELKExport -.-> ELKBinding
145- ELKInstance --> ELKInstanceProvider
146-
147- subgraph ConsumerWs[Consumer]
148- ELKBinding[Elastic APIBinding]
149- ELKInstance[ELK Instance]
150- ELKBinding -.-> ELKInstance
127+ subgraph KCP_Obs[root:team:observability]
128+ ElasticExport[Elastic APIExport]
129+ PGBindingObs[Postgres APIBinding]
130+ PGInstanceObsWs[Obs Postgres Instance]
151131 end
132+ PGExport -.-> PGBindingObs
152133end
153134
154- subgraph DBKube [Database Team Clusters ]
135+ subgraph DBCompute [Database Compute Cluster ]
155136 PGCRD[Postgres CRD]
156137 PGCRD -.-> |api-syncagent| PGExport
138+ PGInstanceObsReal[Obs Postgres Instance]
139+ PGInstanceObsWs --> PGInstanceObsReal
140+ end
141+
142+ subgraph ObsCompute[Observability Compute Cluster]
143+ ElasticCRD[Elastic CRD]
144+ ElasticCRD -.-> |api-syncagent| ElasticExport
145+
146+ PGCRDObs[Postgres CRD]
147+ PGBindingObs -.-> |kube-bind| PGCRDObs
148+
149+ ElasticInstance
150+ ElasticCRD -.-> ElasticInstance
151+
152+ PGInstanceObs[Obs Postgres Instance]
153+ ElasticInstance -.-> PGInstanceObs
154+ PGCRDObs -.-> PGInstanceObs
157155
158- PGInstanceKube[Postgres Instance]
156+ PGInstanceObs --> |kube-bind| PGInstanceObsWs
159157end
158+ ```
159+
160+ ### Operator Solution
161+
162+ The Webshop team uses their own operator to manage their Webshop, which
163+ they wrote using multicluster-runtime, allowing them to interact with
164+ many clusters at once.
160165
161- PGInstanceDbWs -.-> |api-syncagent| PGInstanceKube
166+ The Webshop team maintains definitions of the Webshop instances in their
167+ KCP Workspace and are deploying resources based on these definitions
168+ where they are needed.
162169
163- subgraph ObservabilityKube[Observability Team Clusters]
164- ELKCRD[Elastic CRD]
165- ELKCRD -.-> |api-syncagent| ELKExport
170+ ``` mermaid
171+ flowchart LR
166172
167- ELKInstanceKube[Elastic Instance]
168- ELKInstanceKube -.-> ElasticResource
169- subgraph ElasticResource[Elastic Resources]
170- PGInstanceObsKube[Postgres Instance]
173+ subgraph KCP
174+ subgraph KCP_DB[root:team:database]
175+ PGExport[Postgres APIExport]
171176 end
172177
173- PGCRDObs[Postgres CRD]
174- PGCRDObs -.-> PGInstanceObsKube
178+ subgraph KCP_Obs[root:team:observability]
179+ ElasticExport[Elastic APIExport]
180+ end
181+
182+ subgraph KCP_WS[root:team:webshop]
183+ ElasticBinding[Elastic APIBinding]
184+ PGBinding[Postgres APIBinding]
185+
186+ WebshopCRD[Webshop CRD]
187+ WebshopInstance[Webshop Instance]
188+ WebshopCRD -.-> WebshopInstance
189+ WebshopInstanceDB[Webshop Instance PG]
190+ WebshopInstanceDB --> PGBinding
191+ WebshopInstanceElastic[Webshop Instance Elastic]
192+ WebshopInstanceElastic --> ElasticBinding
193+ end
194+
195+ PGBinding -.-> PGExport
196+ ElasticBinding -.-> ElasticExport
175197end
176198
177- ELKInstanceProvider -.-> |api-syncagent| ELKInstanceKube
178- PGBinding -.-> |kube-bind| PGCRDObs
179- PGInstanceObsKube --> |kube-bind| PGInstanceObsWs
199+ subgraph WSCompute[Workshop Compute Cluster]
200+ WebshopOperator[Webshop Operator]
201+ Webshop
202+ end
203+ WebshopOperator -.-> WebshopInstance
204+ WebshopOperator --> WebshopInstanceDB
205+ WebshopOperator --> WebshopInstanceElastic
206+ WebshopOperator --> Webshop
180207```
181208
209+ The operator also provides the information from the database and elastic
210+ service to the webshop instance.
0 commit comments