-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: wip combine SWIM's infection style with Raft's leader election …
…algo
- Loading branch information
1 parent
bf78d3d
commit e72274c
Showing
7 changed files
with
920 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: zgroup | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: zgroup | ||
replicas: 1 | ||
revisionHistoryLimit: 5 | ||
template: | ||
metadata: | ||
labels: | ||
app: zgroup | ||
spec: | ||
containers: | ||
- name: zgroup | ||
image: asia.gcr.io/mobingi-main/zgroup:v39 | ||
command: ["/bin/sh"] | ||
args: ["-c", '/app/zgroup group1 ${K8S_MY_POD_IP}:8080'] | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 500Mi | ||
limits: | ||
cpu: 100m | ||
memory: 500Mi | ||
imagePullPolicy: Always | ||
env: | ||
# Downward value to know if we are running in k8s. | ||
- name: K8S_MY_POD_IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP | ||
- name: GET_HOSTS_FROM | ||
value: dns | ||
ports: | ||
- containerPort: 8080 | ||
|
||
--- | ||
|
||
apiVersion: autoscaling/v1 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: zgroup-hpa | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: zgroup | ||
minReplicas: 3 | ||
maxReplicas: 3 | ||
targetCPUUtilizationPercentage: 40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM debian:bookworm | ||
RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl xz-utils ca-certificates && rm -rf /var/lib/apt/lists/* | ||
WORKDIR /tmp/ | ||
COPY src/ ./src/ | ||
COPY build* ./ | ||
RUN curl -O https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz && \ | ||
xz --decompress zig-linux-x86_64-0.13.0.tar.xz && tar -xf zig-linux-x86_64-0.13.0.tar && \ | ||
./zig-linux-x86_64-0.13.0/zig build -Doptimize=ReleaseFast --summary all | ||
|
||
FROM debian:stable-slim | ||
RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/* | ||
WORKDIR /app/ | ||
COPY --from=0 /tmp/zig-out/bin/zgroup . | ||
ENTRYPOINT ["/app/zgroup"] | ||
CMD ["group1", "0.0.0.0:8080"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kubectl delete -f deployment.yaml | ||
docker build --rm -t zgroup . | ||
docker tag zgroup asia.gcr.io/mobingi-main/zgroup:$1 | ||
docker push asia.gcr.io/mobingi-main/zgroup:$1 | ||
docker rmi $(docker images --filter "dangling=true" -q --no-trunc) -f | ||
sed -i -e 's/image\:\ asia.gcr.io\/mobingi\-main\/zgroup[\:@].*$/image\:\ asia.gcr.io\/mobingi\-main\/zgroup\:'$1'/g' deployment.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.