sample-cluster: create single simple node cluster #9
Workflow file for this run
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
name: Single Node test | |
on: | |
pull_request: | |
defaults: | |
run: | |
# reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell | |
shell: bash --noprofile --norc -eo pipefail -x {0} | |
# cancel the in-progress workflow when PR is refreshed. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
create-cluster: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: setup golang | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.19 | |
- name: setup minikube | |
uses: manusa/actions-setup-minikube@v2.4.2 | |
with: | |
minikube version: "v1.23.2" | |
kubernetes version: "v1.22.2" | |
start args: --memory 6g --cpus=2 | |
github token: ${{ secrets.GITHUB_TOKEN }} | |
- name: build the binary and run unit tests | |
run: | | |
make build | |
sudo cp bin/kubectl-rook-ceph /usr/local/bin/kubectl-rook_ceph | |
make test | |
- name: single node cluster | |
env: | |
CREATE_SINGLE_NODE_CEPH_CLUSTER: true | |
run: | | |
set -ex | |
kubectl rook-ceph create sample-cluster | |
# Wait for the operator pod to be ready | |
kubectl wait --for=condition=ready pod -l app=rook-ceph-operator -n rook-ceph --timeout=200s | |
kubectl wait --for=condition=ready pod -l app=rook-ceph-osd-prepare -n rook-ceph --timeout=200s | |
# Get the current count of pods in the rook-ceph namespace | |
currentCount=$(kubectl get pods -n rook-ceph --no-headers | wc -l) | |
# Check if the current count is equal to the desired count | |
if [ "$currentCount" -eq 8 ]; then | |
echo "Pod count in namespace rook-ceph is $currentCount, which is the desired count." | |
else | |
echo "Error: Pod count in namespace rook-ceph is $currentCount, but the desired count is 8." | |
exit 1 | |
fi | |
- name: collect common logs | |
if: always() | |
uses: ./.github/workflows/collect-logs | |
with: | |
name: go-test | |
- name: consider debugging | |
if: failure() | |
uses: mxschmitt/action-tmate@v3 |