Skip to content

Thanos setup on kind #17

Thanos setup on kind

Thanos setup on kind #17

Workflow file for this run

name: Thanos setup on kind
on:
workflow_dispatch:
env:
kind-image: 'kindest/node:v1.31.0'
kind-version: 'v0.24.0'
jobs:
thanos_test:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
steps:
- name: Start kind cluster
uses: helm/[email protected]
with:
version: ${{ env.kind-version }}
node_image: ${{ env.kind-image }}
wait: 10s
cluster_name: kind
- name: Wait for cluster to bootstrap and setup thanos operator
run: |
kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout=300s
LATEST=$(curl -s https://api.github.com/repos/prometheus-operator/prometheus-operator/releases/latest | jq -cr .tag_name)
curl -sL https://github.com/prometheus-operator/prometheus-operator/releases/download/${LATEST}/bundle.yaml | kubectl create -f -
git clone https://github.com/thanos-community/thanos-operator.git
cd thanos-operator
echo "***********************************"
echo "Install Thanos CRDS"
echo "***********************************"
make install
kubectl get crds -n thanos-operator
echo "***********************************"
echo "Install Thanos operator"
echo "***********************************"
make deploy IMG="quay.io/thanos/thanos-operator:main-2024-12-24-5e131ef"
kubectl get pods -n thanos-operator-system
echo "***********************************"
echo "Install Thanos components"
echo "***********************************"
make install-example
kubectl get pods -n thanos-operator-system
- name: Create tsdb blocks using thanosbench
run: |
echo "***********************************"
echo "Creating TSDB blocks"
echo "***********************************"
git clone -b kruize_profile https://github.com/chandrams/thanosbench.git
cd thanosbench
make build
maxtime=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")
echo "${maxtime}"
echo " ./thanosbench block plan -p kruize-1d-tiny --max-time="${maxtime}" | ./thanosbench block gen --workers=20 --output.dir=${GITHUB_WORKSPACE}/tsdb"
./thanosbench block plan -p kruize-1d-tiny --max-time="${maxtime}" | ./thanosbench block gen --workers=20 --output.dir=${GITHUB_WORKSPACE}/tsdb
ls ${GITHUB_WORKSPACE}/tsdb
- name: Copy the tsdb blocks to minio
run: |
kubectl port-forward -n thanos-operator-system svc/minio 9000:9000 &
ps -ef | grep kubectl
curl https://dl.min.io/client/mc/release/linux-amd64/mc --create-dirs -o ${GITHUB_WORKSPACE}/mc
chmod +x ${GITHUB_WORKSPACE}/mc
export PATH=$PATH:${GITHUB_WORKSPACE}
mc alias set myminio http://localhost:9000 thanos thanos-secret
mc cp -r tsdb/* myminio/thanos
- name: Clone autotune repository
uses: actions/checkout@v3
with:
repository: kruize/autotune
ref: mvp_demo
path: autotune
- name: Deploy kruize with thanos datasource
run: |
echo "Deploying kruize..."