Skip to content

Commit

Permalink
update docs with helm test info
Browse files Browse the repository at this point in the history
  • Loading branch information
pravarag committed Apr 15, 2021
1 parent 92cb1b2 commit 8b5c4e8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions charts/descheduler/templates/tests/test-descheduler-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
drop:
- All
privileged: false
runAsNonRoot: false
runAsNonRoot: false
command: ["/bin/ash"]
args:
- -c
Expand All @@ -26,4 +26,4 @@ spec:
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl &&
chmod +x ./kubectl &&
mv ./kubectl /usr/local/bin/kubectl &&
/usr/local/bin/kubectl get pods --namespace kube-system --token "$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" | grep "Completed"
/usr/local/bin/kubectl get pods --namespace kube-system --token "$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" | grep "descheduler" | grep "Completed"
13 changes: 13 additions & 0 deletions docs/contributor-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,18 @@ make test-unit
make test-e2e
```

## Run Helm Tests
Run the helm test for a particular descheduler release by setting below variables,
```
HELM_IMAGE_REPO="descheduler"
HELM_IMAGE_TAG="helm-test"
HELM_CHART_LOCATION="./charts/descheduler"
```
The helm tests runs as part of descheduler CI. But, to run it manually from the descheduler root,

```
make test-helm
```

### Miscellaneous
See the [hack directory](https://github.com/kubernetes-sigs/descheduler/tree/master/hack) for additional tools and scripts used for developing the descheduler.
8 changes: 4 additions & 4 deletions test/run-helm-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ set -o nounset
set -o pipefail

K8S_VERSION=${KUBERNETES_VERSION:-v1.20.2}
HELM_IMAGE_REPO="descheduler"
HELM_IMAGE_TAG="helm-test"
CHARTS_PATH="./charts/descheduler"
IMAGE_REPO=${HELM_IMAGE_REPO:-descheduler}
IMAGE_TAG=${HELM_IMAGE_TAG:-helm-test}
CHART_LOCATION=${HELM_CHART_LOCATION:-./charts/descheduler}
VERSION=helm-test make image
wget https://github.com/kubernetes-sigs/kind/releases/download/v0.10.0/kind-linux-amd64
chmod +x kind-linux-amd64
mv kind-linux-amd64 kind
export PATH=$PATH:$PWD
kind create cluster --image kindest/node:"${K8S_VERSION}" --config=./hack/kind_config.yaml
kind load docker-image descheduler:helm-test
helm install descheduler-ci --set image.repository="${HELM_IMAGE_REPO}",image.tag="${HELM_IMAGE_TAG}" --namespace kube-system "${CHARTS_PATH}"
helm install descheduler-ci --set image.repository="${IMAGE_REPO}",image.tag="${IMAGE_TAG}" --namespace kube-system "${CHART_LOCATION}"
sleep 20s
helm test descheduler-ci --namespace kube-system

Expand Down

0 comments on commit 8b5c4e8

Please sign in to comment.