-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Helm chart for pcm - initial version
- Loading branch information
Showing
24 changed files
with
1,047 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,6 @@ latex/ | |
.vs/ | ||
.idea/ | ||
build | ||
src/simdjson | ||
src/simdjson | ||
/deployment/pcm/smarter-device-manager/ | ||
/deployment/pcm/nri/ |
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,92 @@ | ||
##### Create kind based development cluster | ||
|
||
```sh | ||
kind create cluster | ||
kind export kubeconfig | ||
``` | ||
|
||
##### 1) Install Prometheus operator required for PodMonitor CRD | ||
|
||
E.g. use prometheus operator helm chart from here: https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack | ||
|
||
https://prometheus-operator.dev/docs/operator/design/#podmonitor | ||
|
||
```sh | ||
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | ||
|
||
helm repo update | ||
helm repo list | ||
|
||
# check prometheus source if needed | ||
helm pull prometheus-community/kube-prometheus-stack | ||
tar -xzvf kube-prometheus-stack-56.6.2.tgz | ||
|
||
# show/customize values e.g. pod monitor namespace selector | ||
helm show values prometheus-community/kube-prometheus-stack | ||
helm show values prometheus-community/kube-prometheus-stack | vim - +'set ft=yaml' | ||
helm template prometheus-community/kube-prometheus-stack --set-json prometheus.prometheusSpec.podMonitorNamespaceSelector='{"matchLabels": {"kubernetes.io/metadata.name": "intel-pcm"}}' | vim - +'set ft=yaml' | ||
|
||
# Install | ||
helm install prometheus prometheus-community/kube-prometheus-stack --set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false | ||
|
||
helm list | ||
|
||
kubectl --namespace default get pods -l "release=prometheus" | ||
``` | ||
|
||
To remove: | ||
```sh | ||
helm uninstall prometheus | ||
helm repo remove prometheus-community | ||
``` | ||
|
||
##### 2) Deploy PCM daemonset | ||
|
||
```sh | ||
kubectl apply -f pcm-kubernetes.yaml | ||
|
||
# and verify ... | ||
kubectl -n intel-pcm get daemonset | ||
kubectl -n intel-pcm get pods | ||
podname=`kubectl -n intel-pcm get pods -ojsonpath='{.items[0].metadata.name}'` | ||
``` | ||
|
||
##### 3) Verirfy PCM metrics are collected by Prometheus | ||
|
||
```sh | ||
kubectl proxy & | ||
``` | ||
|
||
Access PCM metrics directly: | ||
```sh | ||
curl -Ls http://127.0.0.1:8001/api/v1/namespaces/intel-pcm/pods/$podname/proxy/metrics | ||
curl -Ls http://127.0.0.1:8001/api/v1/namespaces/intel-pcm/pods/$podname/proxy/metrics | grep DRAM_Writes | ||
``` | ||
|
||
or through Prometheus UI: | ||
``` | ||
http://127.0.0.1:8001/api/v1/namespaces/default/services/prometheus-kube-prometheus-prometheus:http-web/proxy/graph | ||
promtool query range --step 1m http://127.0.0.1:8001/api/v1/namespaces/default/services/prometheus-kube-prometheus-prometheus:http-web/proxy 'rate(DRAM_Writes{aggregate="system"}[5m])/1e9' | ||
promtool query instant http://127.0.0.1:8001/api/v1/namespaces/default/services/prometheus-kube-prometheus-prometheus:http-web/proxy 'avg by(__name__) ({job="pcm"})' | ||
``` | ||
|
||
query metrics via promtool | ||
```sh | ||
promtool query range --step 1m http://127.0.0.1:8001/api/v1/namespaces/default/services/prometheus-kube-prometheus-prometheus:http-web/proxy 'rate(DRAM_Writes{aggregate="system"}[5m])/1e9' | ||
promtool query instant http://127.0.0.1:8001/api/v1/namespaces/default/services/prometheus-kube-prometheus-prometheus:http-web/proxy 'avg by(__name__) ({job="pcm"})' | ||
``` | ||
|
||
run some workloads: | ||
```sh | ||
kubectl run -ti stress --image=alexeiled/stress-ng --restart=Never --rm -- --stream 8 | ||
``` | ||
|
||
|
||
##### Uninstall PCM | ||
|
||
```sh | ||
kubectl delete -f pcm-kubernetes.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
smarter-device-manager/ | ||
nri/ |
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,9 @@ | ||
apiVersion: v2 | ||
name: pcm | ||
version: 0.1.0 | ||
appVersion: "202403" | ||
description: A PCM Helm chart for Kubernetes | ||
home: https://github.com/intel/pcm | ||
maintainers: | ||
- name: Pawel Palucki | ||
email: pawel.palucki@intel.com |
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,30 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2009-2023, Intel Corporation | ||
Copyright (c) 2016-2020, opcm | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Oops, something went wrong.