Skip to content

Commit

Permalink
mount: kwok.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: sivchari <shibuuuu5@gmail.com>
  • Loading branch information
sivchari committed Feb 7, 2024
1 parent 258f115 commit 10b6860
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
5 changes: 3 additions & 2 deletions docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ services:
environment:
- PORT=1212
- KUBE_SCHEDULER_SIMULATOR_ETCD_URL=http://127.0.0.1:2379
- CORS_ALLOWED_ORIGIN_LIST=http://${SIMULATOR_EXTERNAL_IP:-localhost}:3000
- KUBE_API_HOST=0.0.0.0
- KUBE_API_PORT=3131
ports:
- "1212:1212"
- "3131:3131"
- "1313:1313"
- "3131:3131"
restart: always
tty: true
networks:
- simulator-internal-network
volumes:
- ./kwok.yaml:/.kwok/kwok.yaml
simulator-frontend:
image: simulator-frontend
restart: always
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ services:
container_name: simulator-server
environment:
- PORT=1212
- KUBE_SCHEDULER_SIMULATOR_ETCD_URL=http://127.0.0.1:32765
- CORS_ALLOWED_ORIGIN_LIST=http://${SIMULATOR_EXTERNAL_IP:-localhost}:3000
- KUBE_SCHEDULER_SIMULATOR_ETCD_URL=http://127.0.0.1:2379
- KUBE_API_HOST=0.0.0.0
- KUBE_API_PORT=32765
- KUBE_API_PORT=3131
ports:
- "1212:1212"
- "1313:1313"
- "32765:32765"
restart: always
tty: true
Expand All @@ -23,7 +23,7 @@ services:
environment:
- HOST=0.0.0.0
- BASE_URL=http://${SIMULATOR_EXTERNAL_IP:-localhost}:1212
- KUBE_API_SERVER_URL=http://${SIMULATOR_EXTERNAL_IP:-localhost}:32765
- KUBE_API_SERVER_URL=http://${SIMULATOR_EXTERNAL_IP:-localhost}:1313
ports:
- "3000:3000"
tty: true
Expand Down
1 change: 1 addition & 0 deletions simulator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ FROM golang:1.21.6-alpine3.19
COPY --from=build-env /go/src/simulator/bin/simulator .
RUN chmod a+x ./simulator
COPY config.yaml .
COPY kwok.yaml /root/.kwok/kwok.yaml

EXPOSE 1212
CMD ["./simulator"]
12 changes: 12 additions & 0 deletions simulator/kwok.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: KwokctlConfiguration
apiVersion: config.kwok.x-k8s.io/v1alpha1
options:
kubeApiserverPort: 3131
etcdPort: 2379
etcdPrefix: /kube-scheduler-simulator
disableKubeScheduler: true
componentsPatches:
- name: kube-apiserver
extraArgs:
- key: cors-allowed-origins
value: ^*$
7 changes: 1 addition & 6 deletions simulator/simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ func startSimulator() error {
defer cancel()

cluster := kwok.NewCluster("kwok").WithVersion("v0.5.0")
_, err = cluster.Create(ctx,
"--kube-apiserver-port=3131",
"--etcd-port=2379",
"--etcd-prefix=/kube-scheduler-simulator",
"--disable-kube-scheduler",
)
_, err = cluster.Create(ctx)
if err != nil {
return xerrors.Errorf("create cluster: %w", err)
}
Expand Down

0 comments on commit 10b6860

Please sign in to comment.