Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm chart for pcm-sensor-server #727

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix with proper names and add NFD/metal case
  • Loading branch information
ppalucki committed Jun 13, 2024
commit cb36269e8cb15865a4395e6471b9ff763376b24c
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -35,7 +35,5 @@ build
src/simdjson
/deployment/pcm/smarter-device-manager/
/deployment/pcm/nri/
/deployment/pcm/kind-with-registry.sh
/deployment/pcm/autoscaler
/deployment/pcm/pcm-dashboard.json
/deployment/pcm/kind*
/deployment/pcm/_kind*
84 changes: 51 additions & 33 deletions deployment/pcm/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.PHONY=kind-cluster-clean

# https://stackoverflow.com/questions/649246/is-it-possible-to-create-a-multi-line-string-variable-in-a-makefile
define KIND_EXTRA_MOUNTS
nodes:
@@ -13,71 +11,91 @@ chart-lint-report.txt: values.yaml templates
docker run -ti --rm -w /pcm -v `realpath $(PWD)/../..`:/pcm quay.io/helmpack/chart-testing ct lint --charts deployment/pcm --validate-maintainers=false | tee chart-lint-report.txt

export KIND_EXTRA_MOUNTS
kind-with-registry.sh:
curl -sl https://kind.sigs.k8s.io/examples/kind-with-registry.sh -o kind-with-registry.sh.tmp
echo "$$KIND_EXTRA_MOUNTS" >kind_extra_mounts.txt
sed '/apiVersion: kind.x-k8s.io\/v1alpha4/r kind_extra_mounts.txt' kind-with-registry.sh.tmp >kind-with-registry.sh
chmod +x kind-with-registry.sh

kind-cluster: kind-with-registry.sh
./kind-with-registry.sh
_kind_with_registry.sh:
curl -sl https://kind.sigs.k8s.io/examples/kind-with-registry.sh -o _kind_with_registry.sh.tmp
echo "$$KIND_EXTRA_MOUNTS" >_kind_extra_mounts.txt
sed '/apiVersion: kind.x-k8s.io\/v1alpha4/r _kind_extra_mounts.txt' _kind_with_registry.sh.tmp >_kind_with_registry.sh
chmod +x _kind_with_registry.sh

_kind_deploy_cluster: _kind_with_registry.sh
./_kind_with_registry.sh
kind export kubeconfig
touch kind-cluster
touch _kind_deploy_cluster


clean:
kind delete cluster
docker rm -f kind-registry
rm -fv kind_extra_mounts.txt
rm -fv kind-with-registry.sh
rm -fv kind-with-registry.sh.tmp
rm -fv kind-deploy-prometheus
rm -fv _kind_with_registry.sh
rm -fv _kind_extra_mounts.txt
rm -fv _kind_with_registry.sh.tmp
rm -fv _kind_deploy_cluster
rm -fv _kind_deploy_prometheus
rm -fv _kind_deploy_pcm


#
# minimal
# e2e-small: minimal E2e pcm pod only test
#
kind-deploy-pcm:
_kind_deploy_pcm:
helm install pcm .
touch _kind_deploy_pcm

kind-pcm-test:
kind_pcm_test:
helm test pcm

e2e-small: kind-cluster kind-deploy-pcm kind-pcm-test
e2e-small: _kind_deploy_cluster _kind_deploy_pcm kind_pcm_test

#
# e2e-small-metal-nfd: minimal E2e pcm pod only test but with direct approach
#
_kind_deploy_pcm_metal:
helm upgrade --install pcm . -f values-metal.yaml
touch _kind_deploy_pcm_metal

_kind_deploy_nfd:
helm upgrade --install pcm . -f values-metal.yaml
touch _kind_deploy_pcm_metal

kind_pcm_test:
helm test pcm

e2e-small-metal: _kind_deploy_cluster _kind_deploy_pcm_metal kind_pcm_test

#
# prometheus (pod monitor test)
# e2e-prometheus: E2E test for podMonitor (pod monitor test)
#
kind-deploy-prometheus:
_kind_deploy_prometheus:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm upgrade --install prometheus prometheus-community/kube-prometheus-stack --set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false
kubectl wait sts prometheus-prometheus-kube-prometheus-prometheus --for=jsonpath='{.status.replicas}'=1
touch kind-deploy-prometheus
touch _kind_deploy_prometheus

kind-pcm-upgrade-prometheus:
_kind_deploy_pcm-with-prometheus:
helm upgrade --install pcm . --set podMonitor=true

kind-pcm-prometheus-test:
kind_pcm_prometheus_test:
kubectl proxy & sleep 5 && curl -sL http://127.0.0.1:8001/api/v1/namespaces/default/services/prometheus-kube-prometheus-prometheus:http-web/proxy/api/v1/query?query=Measurement_Interval_in_us | grep Measurement_Interval_in_us && kill %1

e2e-prometheus: kind-cluster kind-deploy-prometheus kind-pcm-upgrade-prometheus kind-pcm-test kind-pcm-prometheus-test
e2e-prometheus: _kind_deploy_cluster _kind_deploy_prometheus _kind_deploy_pcm-with-prometheus kind_pcm_test kind_pcm_prometheus_test

#
# VPA
# e2e-vpa: VPA E2E tests
#
autoscaler:
git clone --depth 1 --single-branch https://github.com/kubernetes/autoscaler
_kind_autoscaler:
git clone --depth 1 --single-branch https://github.com/kubernetes/autoscaler _kind_autoscaler

kind-deploy-metrics-server:
_kind_deploy_metrics_server:
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/
helm repo update
helm upgrade --install --set args={--kubelet-insecure-tls} metrics-server metrics-server/metrics-server --namespace kube-system
touch _kind_deploy_metrics_server

kind-deploy-vpa: autoscaler
./autoscaler/vertical-pod-autoscaler/hack/vpa-up.sh
_kind_deploy_vpa: autoscaler
./_kind_autoscaler/vertical-pod-autoscaler/hack/vpa-up.sh
touch _kind_deploy_vpa

kind-pcm-vpa:
_kind_deploy_pcm_with_vpa:
helm upgrade --install pcm . --set verticalPodAutoscaler.enabled=true

e2e-vpa: kind-cluster kind-deploy-prometheus kind-deploy-vpa kind-pcm-test
e2e-vpa: _kind_deploy_cluster _kind_deploy_vpa _kind_deploy_pcm_with_vpa kind_pcm_test