Skip to content

Commit 3794792

Browse files
committed
rename ctrlmesh
1 parent 9485f32 commit 3794792

File tree

159 files changed

+859
-822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+859
-822
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Thank you for contributing to Kridge!
1+
<!-- Thank you for contributing to ctrlmesh!
22
33
Note:
44

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
with:
104104
go-version: ${{ env.GO_VERSION }}
105105
cache: false
106-
- name: Release the kridge with GoReleaser
106+
- name: Release the ctrlmesh with GoReleaser
107107
uses: goreleaser/goreleaser-action@v4
108108
with:
109109
distribution: goreleaser

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ bin/
1919
.idea/**
2020
demo/**
2121
testdemo/**
22+
.DS_Store

.goreleaser.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ builds:
2222
ldflags:
2323
- -s -w
2424
main: ./pkg/cmd/manager
25-
id: "kridge-manager"
26-
binary: kridge-manager
25+
id: "ctrlmesh-manager"
26+
binary: ctrlmesh-manager
2727
- env:
2828
- CGO_ENABLED=0
2929
# GOOS list to build for.
@@ -39,8 +39,8 @@ builds:
3939
ldflags:
4040
- -s -w
4141
main: ./pkg/cmd/proxy
42-
id: "kridge-proxy"
43-
binary: kridge-proxy
42+
id: "ctrlmesh-proxy"
43+
binary: ctrlmesh-proxy
4444
- env:
4545
- CGO_ENABLED=0
4646
goos:
@@ -60,7 +60,7 @@ archives:
6060
- "manager"
6161
- "proxy"
6262
- "cert-generator"
63-
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
63+
name_template: "ctrlmesh_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
6464
builds_info:
6565
mode: 0644
6666
# format is `time.RFC3339Nano`
@@ -130,49 +130,49 @@ changelog:
130130
release:
131131
github:
132132
owner: KusionStack
133-
name: kridge
133+
name: controller-mesh
134134
draft: false
135135
footer: |
136136
## Docker Images
137-
* `kusionstack/kridge-manager:{{ .Tag }}`
138-
* `kusionstack/kridge-proxy:{{ .Tag }}`
139-
* `kusionstack/kridge-init:{{ .Tag }}`
137+
* `kusionstack/ctrlmesh-manager:{{ .Tag }}`
138+
* `kusionstack/ctrlmesh-proxy:{{ .Tag }}`
139+
* `kusionstack/ctrlmesh-init:{{ .Tag }}`
140140
141141
dockers:
142142
- id: manager
143143
ids:
144-
- kridge-manager
144+
- ctrlmesh-manager
145145
goos: linux
146146
goarch: amd64
147147
image_templates:
148-
- 'kusionstack/{{ .ProjectName }}-manager:{{ .Tag }}'
149-
- 'kusionstack/{{ .ProjectName }}-manager:latest'
148+
- 'kusionstack/ctrlmesh-manager:{{ .Tag }}'
149+
- 'kusionstack/ctrlmesh-manager:latest'
150150
dockerfile: ./artifacts/goreleaser/manager.Dockerfile
151151
use: docker
152152
build_flag_templates:
153153
- "--pull"
154154
- "--label=org.opencontainers.image.created={{.Date}}"
155-
- "--label=org.opencontainers.image.name={{.ProjectName}}-manager"
155+
- "--label=org.opencontainers.image.name=ctrlmesh-manager"
156156
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
157157
- "--label=org.opencontainers.image.version={{.Version}}"
158158
- "--label=org.opencontainers.image.source={{.GitURL}}"
159159
- "--platform=linux/amd64"
160160
- id: proxy
161161
ids:
162-
- kridge-proxy
162+
- ctrlmesh-proxy
163163
goos: linux
164164
goarch: amd64
165165
image_templates:
166-
- 'kusionstack/{{ .ProjectName }}-proxy:{{ .Tag }}'
167-
- 'kusionstack/{{ .ProjectName }}-proxy:latest'
166+
- 'kusionstack/ctrlmesh-proxy:{{ .Tag }}'
167+
- 'kusionstack/ctrlmesh-proxy:latest'
168168
dockerfile: ./artifacts/goreleaser/proxy.Dockerfile
169169
extra_files:
170170
- artifacts/scripts/
171171
use: docker
172172
build_flag_templates:
173173
- "--pull"
174174
- "--label=org.opencontainers.image.created={{.Date}}"
175-
- "--label=org.opencontainers.image.name={{.ProjectName}}-proxy"
175+
- "--label=org.opencontainers.image.name=ctrlmesh-proxy"
176176
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
177177
- "--label=org.opencontainers.image.version={{.Version}}"
178178
- "--label=org.opencontainers.image.source={{.GitURL}}"
@@ -183,16 +183,16 @@ dockers:
183183
goos: linux
184184
goarch: amd64
185185
image_templates:
186-
- 'kusionstack/{{ .ProjectName }}-init:{{ .Tag }}'
187-
- 'kusionstack/{{ .ProjectName }}-init:latest'
186+
- 'kusionstack/ctrlmesh-init:{{ .Tag }}'
187+
- 'kusionstack/ctrlmesh-init:latest'
188188
dockerfile: ./artifacts/goreleaser/init.Dockerfile
189189
extra_files:
190190
- artifacts/scripts/
191191
use: docker
192192
build_flag_templates:
193193
- "--pull"
194194
- "--label=org.opencontainers.image.created={{.Date}}"
195-
- "--label=org.opencontainers.image.name={{.ProjectName}}-init"
195+
- "--label=org.opencontainers.image.name=ctrlmesh-init"
196196
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
197197
- "--label=org.opencontainers.image.version={{.Version}}"
198198
- "--label=org.opencontainers.image.source={{.GitURL}}"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ help: ## Display this help.
3838
##@ Development
3939

4040
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
41-
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=kridge-kusionstack-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
41+
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=ctrlmesh-kusionstack-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
4242

4343
generate-client: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
4444
@artifacts/scripts/generate_client.sh

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
[简体中文](https://github.com/KusionStack/kusion/blob/main/README-zh.md)
44
| [English](https://github.com/KusionStack/kusion/blob/main/README.md)
55

6-
# Kridge
6+
# Controller Mesh
77

8-
Kridge is a solution that helps developers manage their controllers/operators better.
8+
KusionStack Controller Mesh is a solution that helps developers manage their controllers/operators better.
99

1010
The design architecture of this project is based on [openkruise/controllermesh](https://github.com/openkruise/controllermesh).
1111

@@ -16,7 +16,7 @@ The design architecture of this project is based on [openkruise/controllermesh](
1616
3. **Circuit breaker and rate limiter**: Not only Kubernetes operation requests, but also other external operation requests.
1717
4. **Multicluster routing and sharding**: This feature is supported by [kusionstack/kaera(karbour)]()
1818

19-
<p align="center"><img width="800" src="./docs/img/img5.png"/></p>
19+
<p align="center"><img width="800" src="./docs/img/mesh-arch-2.png"/></p>
2020

2121
## Quick Start
2222
Visit [Quick Start]().
@@ -32,34 +32,34 @@ $ helm repo add kusionstack https://kusionstack.io/charts
3232
$ helm repo update
3333

3434
# Install the latest version.
35-
$ helm install kridge kusionstack/kridge --version v0.1.0
35+
$ helm install ctrlmesh kusionstack/ctrlmesh --version v0.1.0
3636

3737
# Uninstall
38-
$ helm uninstall kridge
38+
$ helm uninstall ctrlmesh
3939
```
4040
**Proxy**
4141
1. Apply your [ShardingConfig]().
42-
2. Add label `kridge.kusionstack.io/enable-proxy=true` on pod template.
42+
2. Add label `ctrlmesh.kusionstack.io/enable-proxy=true` on pod template.
4343

4444

4545
## Principles
4646

47-
Generally, a `kridge-proxy` container will be injected into each operator Pod that has configured in Kridge.
47+
Generally, a `ctrlmesh-proxy` container will be injected into each operator Pod that has configured in ShardingConfigs.
4848
This proxy container will intercept and handle the connection by between API/Oth Server and controllers/webhooks in the Pod.
4949

50-
<p align="center"><img width="550" src="./docs/img/img3.png"/></p>
50+
<p align="center"><img width="550" src="./docs/img/fake-configmap.png"/></p>
5151

5252
ApiServer proxy method:
5353
- *iptables nat*:
5454
- *fake kubeconfig*:
5555

56-
The `kridge-manager` dispatches rules to the proxies, so that they can route requests according to the rules.
56+
The `ctrlmesh-manager` dispatches rules to the proxies, so that they can route requests according to the rules.
5757

5858

59-
A core CRD in Kridge is `ShardingConfig`. It contains all rules for user's controller:
59+
A core CRD in ControllerMesh is `ShardingConfig`. It contains all rules for user's controller:
6060

6161
```yaml
62-
apiVersion: kridge.kusionstack.io/v1alpha1
62+
apiVersion: ctrlmesh.kusionstack.io/v1alpha1
6363
kind: ShardingConfig
6464
metadata:
6565
name: sharding-demo
@@ -79,7 +79,7 @@ spec:
7979
- services
8080
selector:
8181
matchExpressions:
82-
- key: kridge.kusionstack.io/namespace
82+
- key: ctrlmesh.kusionstack.io/namespace
8383
operator: In
8484
values:
8585
- ns-a
@@ -101,19 +101,19 @@ spec:
101101

102102
When `manager` is first launched, shard labels will be added to all configured resources.
103103

104-
- `kridge.kusionstack.io/sharding-hash`: the hash value calculated based on the namespace ranges from 0 to 31.
105-
- `kridge.kusionstack.io/namespace`: the namespace referring to this resource.
106-
- `kridge.kusionstack.io/control`: under kridge control.
104+
- `ctrlmesh.kusionstack.io/sharding-hash`: the hash value calculated based on the namespace ranges from 0 to 31.
105+
- `ctrlmesh.kusionstack.io/namespace`: the namespace referring to this resource.
106+
- `ctrlmesh.kusionstack.io/control`: under ctrlmesh-manager control.
107107

108108

109-
In this repo, Kridge only support `ObjectSelector` type of flow control,
110-
which means the `kridge-proxy `will proxy list&watch requests to the ApiServer,
109+
In this repo, we only support `ObjectSelector` type of flow control,
110+
which means the `ctrlmesh-proxy `will proxy http/s requests to the ApiServer,
111111
and inject a `LabelSelector` into the request param for the requested resource type.
112112

113113

114114

115115

116116
Router:
117117

118-
<p align="center"><img width="500" src="./docs/img/img1.png"/></p>
118+
<p align="center"><img width="600" src="./docs/img/mesh-proxy.png"/></p>
119119

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
FROM ubuntu:focal
22

33
WORKDIR /
4-
COPY kridge-manager .
4+
COPY ctrlmesh-manager .
55

66
RUN ln -s /usr/bin/* /usr/sbin/ && apt-get update -y \
77
&& apt-get install --no-install-recommends -y ca-certificates \
88
&& apt-get clean && rm -rf /var/log/*log /var/lib/apt/lists/* /var/log/apt/* /var/lib/dpkg/*-old /var/cache/debconf/*-old
99

1010

11-
ENTRYPOINT ["/kridge-manager"]
11+
ENTRYPOINT ["/ctrlmesh-manager"]

artifacts/goreleaser/proxy.Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ubuntu:focal
22

33
WORKDIR /
4-
COPY kridge-proxy .
4+
COPY ctrlmesh-proxy .
55

66
RUN apt-get update && \
77
apt-get install --no-install-recommends -y \
@@ -20,10 +20,10 @@ RUN apt-get update && \
2020
rm -rf /var/log/*log /var/lib/apt/lists/* /var/log/apt/* /var/lib/dpkg/*-old /var/cache/debconf/*-old
2121

2222
# Sudoers used to allow tcpdump and other debug utilities.
23-
RUN useradd -m --uid 1359 kridge-proxy && \
24-
echo "kridge-proxy ALL=NOPASSWD: ALL" >> /etc/sudoers
23+
RUN useradd -m --uid 1359 ctrlmesh-proxy && \
24+
echo "ctrlmesh-proxy ALL=NOPASSWD: ALL" >> /etc/sudoers
2525

2626
COPY artifacts/scripts/proxy-poststart.sh /poststart.sh
27-
RUN mkdir /kridge && chmod 777 /kridge
27+
RUN mkdir /ctrlmesh && chmod 777 /ctrlmesh
2828

29-
ENTRYPOINT ["/kridge-proxy"]
29+
ENTRYPOINT ["/ctrlmesh-proxy"]

artifacts/images/manager.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ COPY artifacts/ artifacts/
99
COPY pkg/ pkg/
1010
COPY vendor/ vendor/
1111

12-
RUN CGO_ENABLED=0 GO111MODULE=on GOOS=linux GOARCH=amd64 go build -mod=vendor -a -o kridge-manager ./pkg/cmd/manager/main.go
12+
RUN CGO_ENABLED=0 GO111MODULE=on GOOS=linux GOARCH=amd64 go build -mod=vendor -a -o ctrlmesh-manager ./pkg/cmd/manager/main.go
1313

1414

1515
FROM ubuntu:focal
@@ -18,5 +18,5 @@ RUN ln -s /usr/bin/* /usr/sbin/ && apt-get update -y \
1818
&& apt-get install --no-install-recommends -y ca-certificates \
1919
&& apt-get clean && rm -rf /var/log/*log /var/lib/apt/lists/* /var/log/apt/* /var/lib/dpkg/*-old /var/cache/debconf/*-old
2020
WORKDIR /
21-
COPY --from=builder /workspace/kridge-manager .
22-
ENTRYPOINT ["/kridge-manager"]
21+
COPY --from=builder /workspace/ctrlmesh-manager .
22+
ENTRYPOINT ["/ctrlmesh-manager"]

artifacts/images/proxy.Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ COPY artifacts/ artifacts/
88
COPY pkg/ pkg/
99
COPY vendor/ vendor/
1010

11-
RUN CGO_ENABLED=0 GO111MODULE=on GOOS=linux GOARCH=amd64 go build -mod=vendor -a -o kridge-proxy ./pkg/cmd/proxy/main.go
11+
RUN CGO_ENABLED=0 GO111MODULE=on GOOS=linux GOARCH=amd64 go build -mod=vendor -a -o ctrlmesh-proxy ./pkg/cmd/proxy/main.go
1212

1313
FROM ubuntu:focal
1414

@@ -29,10 +29,10 @@ RUN apt-get update && \
2929
rm -rf /var/log/*log /var/lib/apt/lists/* /var/log/apt/* /var/lib/dpkg/*-old /var/cache/debconf/*-old
3030

3131
# Sudoers used to allow tcpdump and other debug utilities.
32-
RUN useradd -m --uid 1359 kridge-proxy && \
33-
echo "kridge-proxy ALL=NOPASSWD: ALL" >> /etc/sudoers
32+
RUN useradd -m --uid 1359 ctrlmesh-proxy && \
33+
echo "ctrlmesh-proxy ALL=NOPASSWD: ALL" >> /etc/sudoers
3434
WORKDIR /
3535
COPY artifacts/scripts/proxy-poststart.sh /poststart.sh
36-
RUN mkdir /kridge && chmod 777 /kridge
37-
COPY --from=builder /workspace/kridge-proxy .
38-
ENTRYPOINT ["/kridge-proxy"]
36+
RUN mkdir /ctrlmesh && chmod 777 /ctrlmesh
37+
COPY --from=builder /workspace/ctrlmesh-proxy .
38+
ENTRYPOINT ["/ctrlmesh-proxy"]

0 commit comments

Comments
 (0)