Kubernetes Test #331
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: Kubernetes Test | |
# Trigger the workflow on schedule (nightly at 12:00) and manually on the main branch | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Runs every day at 12:00 AM (UTC) | |
workflow_dispatch: # Allows manual trigger | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
setup-kind: | |
runs-on: ubuntu-latest | |
services: | |
docker: | |
image: docker:27.5.1 | |
options: --privileged | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install necessary packages (curl, kubectl, kind) | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y curl bash | |
# Download and install kind | |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64 | |
chmod +x ./kind | |
sudo mv ./kind /usr/local/bin/kind | |
# Install kubectl | |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | |
chmod +x kubectl | |
sudo mv kubectl /usr/local/bin/kubectl | |
- name: Create Kind Cluster | |
run: kind create cluster --wait 5m | |
- name: Setup kubeconfig | |
run: | | |
kind get kubeconfig > $GITHUB_WORKSPACE/kubeconfig | |
env: | |
KUBECONFIG: $GITHUB_WORKSPACE/kubeconfig | |
- name: Verify Kubernetes Cluster | |
run: | | |
kubectl cluster-info | |
kubectl get nodes | |
- name: Apply Kubernetes Manifests | |
run: | | |
kubectl apply -f ./home-automation/clean_install/ | |
sleep 5 | |
#POD_NAME=$(kubectl get pods -n ha-test -l app=ha-test -o jsonpath='{.items[0].metadata.name}') | |
for i in {1..18}; do | |
kubectl get pods -n ha-test -o wide | |
sleep 10; | |
done |