Skip to content

Commit 2197a46

Browse files
authored
Additional steps for a local KIND cluster (#406)
Signed-off-by: James Busche <jbusche@us.ibm.com>
1 parent 9174813 commit 2197a46

File tree

2 files changed

+59
-13
lines changed

2 files changed

+59
-13
lines changed

test/perf-test/node.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ spec:
2222
status:
2323
allocatable:
2424
cpu: 32
25+
nvidia.com/gpu: 32
2526
memory: 256Gi
2627
pods: 110
2728
capacity:
2829
cpu: 32
30+
nvidia.com/gpu: 32
2931
memory: 256Gi
3032
pods: 110
3133
nodeInfo:

test/perf-test/simulatingnodesandappwrappers.md

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ The Steps below show two ways to simulated a large number of KWOK kubernetes nod
77
- The second way is running KWOK inside an existing Kubernetes cluster
88

99
# First Way: Using KWOK to simulate a large number of nodes and MCAD Appwrappers on a Mac laptop
10-
## Step 0. Pre-Reqs
11-
### 0.1 Make sure you have podman (I don't have Docker to test with), installed on your mac with a podman machine of at least 4 cpu and 8GB memory:
10+
## Step 0. Pre-Req steps:
11+
### 0.1 Make sure you have podman (I don't have Docker to test with) installed on your mac with a podman machine of at least 4 cpu and 8GB memory:
1212
```
1313
brew update
1414
brew upgrade
@@ -54,7 +54,7 @@ chmod +x install.sh
5454
```
5555
kubectl get pods -A
5656
```
57-
## Step 1. Deploy NCAD on your cluster
57+
## Step 1. Deploy MCAD on your cluster
5858
### 1.1 Make sure you have room: # You'll at least 2 free cpu and at least 2GB memory free
5959
```
6060
kubectl describe node |grep cpu
@@ -67,39 +67,83 @@ cd multi-cluster-app-dispatcher/deployment
6767
```
6868
### 1.3 Install via helm using the following command - change the image.tag as necessary if you want something specific...
6969
```
70-
helm install mcad-controller --namespace kube-system --generate-name --set image.repository=quay.io/project-codeflare/mcad-controller --set image.tag=main-v1.29.58
70+
helm install mcad-controller --namespace kube-system --generate-name --set image.repository=quay.io/project-codeflare/mcad-controller --set image.tag=stable
7171
```
7272
### 1.4 Check that mcad is running:
7373
```
7474
kubectl get pods -n kube-system |grep mcad
7575
```
7676

77-
## Step 2. Creating simulated KWOK node(s)
78-
### 2.1 cd to where the MCAD performance scripts are located
77+
## Step 2. Install KWOK
78+
### 2.1 Install jq if you don't already have it on your laptop
79+
```
80+
brew install jq
81+
```
82+
83+
### 2.2 Install the latest version of Kustomize
84+
```
85+
brew install kustomize
86+
```
87+
88+
### Step 2.3. Install KWOK in your KIND Cluster:
89+
### 2.3.1 Variable Prep:
90+
```
91+
export KWOK_WORK_DIR=$(mktemp -d)
92+
export KWOK_REPO=kubernetes-sigs/kwok
93+
export KWOK_LATEST_RELEASE=$(curl "https://api.github.com/repos/${KWOK_REPO}/releases/latest" | jq -r '.tag_name')
94+
```
95+
### 2.3.2 Render kustomization yaml
96+
```
97+
cat <<EOF > "${KWOK_WORK_DIR}/kustomization.yaml"
98+
apiVersion: kustomize.config.k8s.io/v1beta1
99+
kind: Kustomization
100+
images:
101+
- name: registry.k8s.io/kwok/kwok
102+
newTag: "${KWOK_LATEST_RELEASE}"
103+
resources:
104+
- "https://github.com/${KWOK_REPO}/kustomize/kwok?ref=${KWOK_LATEST_RELEASE}"
105+
EOF
106+
```
107+
### 2.3.3 Render it with the prepared variables.
108+
```
109+
kubectl kustomize "${KWOK_WORK_DIR}" > "${KWOK_WORK_DIR}/kwok.yaml"
110+
```
111+
### Step 2.4 Install the KWOK Controller in kube-system namespace:
112+
### 2.4.1 Apply your rendered yaml file from step 1.3 above:
113+
```
114+
kubectl apply -f "${KWOK_WORK_DIR}/kwok.yaml"
115+
```
116+
### 2.4.2 Check to make sure the kwok controller started:
117+
```
118+
kubectl get pods -n kube-system |grep kwok-controller
119+
```
120+
121+
## Step 3. Creating simulated KWOK node(s)
122+
### 3.1 cd to where the MCAD performance scripts are located
79123
```
80124
cd ../test/perf-test
81125
```
82126

83-
### 2.2 Run the script ./nodes.sh
127+
### 3.2 Run the script ./nodes.sh
84128
```
85129
./nodes.sh
86130
```
87-
### 2.3 Check that the requested number of nodes started:
131+
### 3.3 Check that the requested number of nodes started:
88132
```
89133
kubectl get nodes --selector type=kwok
90134
```
91135

92-
## Step 3. Create some AppWrapper jobs which create simulated pods on the simulated KWOK nodes
93-
### 3.1 Run the script kwokmcadperf.sh
136+
## Step 4. Create some AppWrapper jobs which create simulated pods on the simulated KWOK nodes
137+
### 4.1 Run the script kwokmcadperf.sh
94138
```
95139
./kwokmcadperf.sh
96140
```
97-
## Step 4. Cleaning up
98-
### 4.1 Clean up all the simulated AppWrapper jobs with the cleanup-mcad-kwok.sh script:
141+
## Step 5. Cleaning up
142+
### 5.1 Clean up all the simulated AppWrapper jobs with the cleanup-mcad-kwok.sh script:
99143
```
100144
./cleanup-mcad-kwok.sh
101145
```
102-
### 4.2 Clean up all the simulated nodes with the following command:
146+
### 5.2 Clean up all the simulated nodes with the following command:
103147
```
104148
kubectl get nodes --selector type=kwok -o name | xargs kubectl delete
105149
```

0 commit comments

Comments
 (0)