kusionstack / controller-mesh Goto Github PK
View Code? Open in Web Editor NEWOperator sharding, canary, circuitbreaker and more...
License: Apache License 2.0
Operator sharding, canary, circuitbreaker and more...
License: Apache License 2.0
TODO:
support webhook routing.
My Operator : mysql-operator
k8s version : v1.21.5
controller-mesh : v0.1.2
shardingconfig-root :
apiVersion: ctrlmesh.kusionstack.io/v1alpha1
kind: ShardingConfig
metadata:
name: sharding-root
namespace: test-mysql
spec:
root:
prefix: mysql-operator
targetStatefulSet: mysql-operator
canary:
replicas: 1
inNamespaces:
- demo-0a
- demo-0b
- demo-0c
auto:
everyShardReplicas: 2
shardingSize: 2
resourceSelector:
- relateResources:
- apiGroups:
- '*'
resources:
- '*'
controller:
leaderElectionName: mysql-operator-leader-election
My Operator has 2 containers (operator and orchestrator). When not using patch to add the labels required by ctrlmesh (ctrlmesh.kusionstack.io/enable-proxy: "true", ctrlmesh.kusionstack.io/watching: "true") , can be started successfully. After using patch to request labeling, ctrlmesh-proxy and operator can start normally, but orchestrator fails to start with the following error:
Error starting command: `--kubeconfig=/etc/kubernetes/kubeconfig/fake-kubeconfig.yaml` - fork/exec --kubeconfig=/etc/kubernetes/kubeconfig/fake-kubeconfig.yaml: no such file or directory
kubectl get pod/mysql-operator-0 -oyaml
Check the pod and find that the /etc/kubernetes/kubeconfig/fake-kubeconfig.yaml
file has been mounted
Who can help me?
Update .goreleaser.yaml to release linux/arm64 image.
Currently, the proxy container can only proxy apiserver requests in the current K8s. We need to proxy multi-cluster requests in the future.
By default Manager injects an init container in pods deployed in the mesh. The init container sets up the pod network traffic redirection to/from the sidecar proxy.
api demo:
apiVersion: ctrlmesh.kusionstack.io/v1alpha1
kind: FaultInjection
metadata:
name: breaker-demo
namespace: default
spec:
httpFault:
- delay:
fixedDelay: 5s
percent: 10
match:
- method: POST
url: https://xxx.com/*/trafficOff
- abort:
httpStatus: 500
percent: 100
resourceRules:
- apiGroups:
- ""
namespaces:
- '*'
resources:
- pods
verbs:
- delete
- names:
- pod-a
I am confused about how the sidecar of ctrlmesh-proxy proxies requests to the operator's k8s api-server. Although ctrlmesh-proxy has been successfully injected into the operator, it has not been injected into initContainers. The proxy-init.sh script is also used as an init image, and the image address is not filled in at startup. Additionally, transparent proxying for http_proxy only proxies fault injection and circuit breaker because the operator typically accesses via serviceAccount, so fake-kubeconfig should not take effect. I hope you can help clarify this. Thank you. @Eikykun
Enable throttling controller to distribute CircuitBreaker
(Circuit Breaker and Ratelimiter)
I read getting-started doc in this url: https://github.com/KusionStack/controller-mesh/blob/main/docs/getting-started.md. When installing the kusionstack/sample-operator Operator, there is an issue where the StatefulSet misses a ServiceName, preventing a normal installation. Additionally, I am not quite sure what this Operator is for, and after sharding, I don't know if the Operator reconciles according to the sharding rules.
Therefore, I would like to understand what this Operator is for in the getting-started documentation section, and to verify that the traffic is being routed according to the sharding rules.
A feasible solution is to use kubebuilder to quickly generate a simple, leaderable Operator and place it in a GitHub repository, then configure sharding and determine whether routing meets the requirements based on log information. It would be even better if a canary release of different versions of the Operator could be implemented, for example, by assigning a value in the reconcile phase of the preceding Operator (eg: Foo="123" in version 0.2, Foo=null in version 0.1 to distinguish diffrent versions).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.