Skip to content

Commit 2375435

Browse files
committed
possible fix for issue with resctrl
1 parent a20bb58 commit 2375435

File tree

3 files changed

+49
-9
lines changed

3 files changed

+49
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ build
3535
src/simdjson
3636
/deployment/pcm/smarter-device-manager/
3737
/deployment/pcm/nri/
38+
/deployment/pcm/kind-with-registry.sh

deployment/pcm/README.md

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@ helm install ... --set nfd=true --set podMonitor=true
4545

4646
** NOTE: DEBUGGING: TODO to be remove before merging **
4747

48-
Build local image for tests/development + fix /pcm/resctrl mounting:
4948
```
50-
# Local image "indirect"
51-
helm install pcm . --set debugPcm=true -f values-local-image.yaml
52-
53-
BUIDLING IMAGE
49+
# Build local image for tests/development + fix /pcm/resctrl mounting (assuming project was configured with cmake previously):
5450
(cd ../.. ; (cd build ; make -j pcm pcm-sensor-server) ; docker build . -t localhost:5001/pcm-local && docker push localhost:5001/pcm-local; docker run -ti --rm --name pcmtest --entrypoint bash localhost:5001/pcm-local -c "pcm 2>&1 | head -5" )
5551
56-
helm upgrade --install pcm . --set privileged=false --set nfd=true --set podMonitor=true -f values-metal.yaml -f values-indirect.yaml -f values-local-image.yaml --set debugPcm=1
52+
# Local image "indirect"
53+
helm upgrade --install pcm . --set debugPcm=true
54+
55+
# exec or check logs
56+
kubectl exec -ti ds/pcm -- bash
57+
kubectl logs ds/pcm
5758
```
5859

5960
### Requirements
@@ -124,12 +125,48 @@ mount -t resctrl resctrl /sys/fs/resctrl
124125
```
125126

126127
#### 2) Create kind based Kubernetes cluster
128+
129+
127130
```
128131
kind create cluster
129-
kind export kubeconfig
130132
```
131133

134+
**Note** to be able to collect and test resctrl RDT metrics, kind cluster have to be created with additional mounts:
135+
136+
```
137+
nodes:
138+
- role: control-plane
139+
extraMounts:
140+
- hostPath: /sys/fs/resctrl
141+
containerPath: /sys/fs/resctrl
142+
```
132143
or (optionally), create kind cluster with local registry with [this script](https://kind.sigs.k8s.io/docs/user/local-registry/).
144+
and apply the patch using sed:
145+
146+
```
147+
wget https://kind.sigs.k8s.io/examples/kind-with-registry.sh
148+
149+
sed -i '/apiVersion: kind.x-k8s.io\/v1alpha4/a \
150+
nodes:\
151+
- role: control-plane\
152+
extraMounts:\
153+
- hostPath: /sys/fs/resctrl\
154+
containerPath: /sys/fs/resctrl\
155+
' kind-with-registry.sh
156+
157+
bash kind-with-registry.sh
158+
```
159+
160+
Check that resctrl is available inside kind node:
161+
```
162+
docker exec kind-control-plane ls /sys/fs/resctrl/info
163+
```
164+
165+
Export kind kubeconfig as default for furhter kubectl commands:
166+
```
167+
kind export kubeconfig
168+
```
169+
133170

134171
#### 3) (Optionally) Deploy Node feature discovery
135172

deployment/pcm/templates/daemonset.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ spec:
139139
readOnly: true # RW?
140140
{{- end }}
141141
{{- if .Values.resctrlHostMount }}
142-
#- mountPath: /sys/fs/resctrl # HACK because issues with sys mounting!
143-
- mountPath: /pcm/resctrl
142+
#- mountPath: /sys/fs/resctrl # HACK because issues with sys mounting! ?!?!?! really?
143+
# - mountPath: /pcm/resctrl
144+
# name: sysfs-resctrl
145+
- mountPath: /sys/fs/resctrl
144146
name: sysfs-resctrl
145147
{{- end }}
146148
{{- if .Values.mcfgMount }}

0 commit comments

Comments
 (0)