@@ -7,8 +7,8 @@ The Steps below show two ways to simulated a large number of KWOK kubernetes nod
7
7
- The second way is running KWOK inside an existing Kubernetes cluster
8
8
9
9
# 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:
12
12
```
13
13
brew update
14
14
brew upgrade
@@ -54,7 +54,7 @@ chmod +x install.sh
54
54
```
55
55
kubectl get pods -A
56
56
```
57
- ## Step 1. Deploy NCAD on your cluster
57
+ ## Step 1. Deploy MCAD on your cluster
58
58
### 1.1 Make sure you have room: # You'll at least 2 free cpu and at least 2GB memory free
59
59
```
60
60
kubectl describe node |grep cpu
@@ -67,39 +67,83 @@ cd multi-cluster-app-dispatcher/deployment
67
67
```
68
68
### 1.3 Install via helm using the following command - change the image.tag as necessary if you want something specific...
69
69
```
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
71
71
```
72
72
### 1.4 Check that mcad is running:
73
73
```
74
74
kubectl get pods -n kube-system |grep mcad
75
75
```
76
76
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
79
123
```
80
124
cd ../test/perf-test
81
125
```
82
126
83
- ### 2 .2 Run the script ./nodes.sh
127
+ ### 3 .2 Run the script ./nodes.sh
84
128
```
85
129
./nodes.sh
86
130
```
87
- ### 2 .3 Check that the requested number of nodes started:
131
+ ### 3 .3 Check that the requested number of nodes started:
88
132
```
89
133
kubectl get nodes --selector type=kwok
90
134
```
91
135
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
94
138
```
95
139
./kwokmcadperf.sh
96
140
```
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:
99
143
```
100
144
./cleanup-mcad-kwok.sh
101
145
```
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:
103
147
```
104
148
kubectl get nodes --selector type=kwok -o name | xargs kubectl delete
105
149
```
0 commit comments