Skip to content

Commit

Permalink
[WIP] Adapt webhosting-operator to external sharding implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
timebertt committed Nov 3, 2023
1 parent bfe3492 commit 4d93081
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ To experience how they work, the webhosting-operator is deployed in the followin
While webhosting-operator is developed in the same repository, it only serves as an example.
Sharding support can be implemented in any other controller and programming language as well, so that it works well with the sharding components from this project.

> [!NOTE]
> The external sharding components are work in progress.
> While the following steps also deploy the new sharding components, they are not activated for now (no `ClusterRing` object is created).
> Instead, the existing sharding implementation in controller-runtime embedded in webhosting-operator is used.
## Quick Start

```bash
Expand Down
15 changes: 15 additions & 0 deletions webhosting-operator/config/manager/clusterring/clusterring.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: sharding.timebertt.dev/v1alpha1
kind: ClusterRing
metadata:
name: operator
spec:
kinds:
- apiGroup: webhosting.timebertt.dev
kind: Website
controlledKinds:
- apiGroup: apps
kind: Deployment
- kind: ConfigMap
- kind: Service
- apiGroup: networking.k8s.io
kind: Ingress
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- clusterring.yaml
2 changes: 1 addition & 1 deletion webhosting-operator/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
)

// https://github.com/timebertt/controller-runtime/tree/sharding-0.15
replace sigs.k8s.io/controller-runtime => github.com/timebertt/controller-runtime v0.6.1-0.20230910160759-61c8e6d9a2de
replace sigs.k8s.io/controller-runtime => github.com/timebertt/controller-runtime v0.6.1-0.20231103173444-c2f2d2ddd36b

require (
github.com/beorn7/perks v1.0.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions webhosting-operator/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/timebertt/controller-runtime v0.6.1-0.20230910160759-61c8e6d9a2de h1:LxfB3lU0Su0pjmdqB3NsI5oIF4835lhFqPH+RNbJ1mM=
github.com/timebertt/controller-runtime v0.6.1-0.20230910160759-61c8e6d9a2de/go.mod h1:dC7gCD9Y6rWUT9YaaCuR/kHLZqppXydmPLCc/2KffF4=
github.com/timebertt/controller-runtime v0.6.1-0.20231103173444-c2f2d2ddd36b h1:6lRmAbgfx8z5A+7y6JgNIIQ//l7RBIm00UJzu6l8KfQ=
github.com/timebertt/controller-runtime v0.6.1-0.20231103173444-c2f2d2ddd36b/go.mod h1:LBDKEuL9yGGrRraKBF6dSprE/R33ehmfCDYnh3fexwA=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
Expand Down
24 changes: 24 additions & 0 deletions webhosting-operator/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@ profiles:
path: /manifests/kustomize/paths/0
value: config/manager/shoot-non-sharded
---
# This is an optional module that activates the external sharding implementation by deploying the ClusterRing object.
# Set the USE_CLUSTERRING env var to true to activate this module.
# We keep this optional for now until the external sharding implementation is fully implemented so that we don't break
# trying out the existing implementation.
apiVersion: skaffold/v4beta6
kind: Config
metadata:
name: clusterring
profiles:
- name: clusterring
activation:
- command: USE_CLUSTERRING=true
manifests:
kustomize:
paths:
- config/manager/clusterring
deploy:
kubectl:
defaultNamespace: ""
flags:
apply:
- --server-side
- --force-conflicts
---
apiVersion: skaffold/v4beta6
kind: Config
metadata:
Expand Down

0 comments on commit 4d93081

Please sign in to comment.