Loading video player...
GitHub Actions - A simple CICD pipeline to perform single node cluster in kind - Day 21 Repository structure (example) . ├── .github/ │ └── workflows/ │ └── kind-ci.yml ├── k8s/ │ └── deployment.yaml GitHub Actions workflow (.github/workflows/kind-ci.yml) name: Kind Single-Node CI on: push: branches: [ "main" ] pull_request: jobs: kind-ci: runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v4 - name: Set up Docker uses: docker/setup-buildx-action@v3 - name: Install kubectl run: | 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/ - name: Install kind run: | curl -Lo kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-amd64 chmod +x kind sudo mv kind /usr/local/bin/ - name: Create kind cluster (single node) run: | kind create cluster --name ci-cluster - name: Verify cluster run: | kubectl cluster-info kubectl get nodes - name: Deploy application run: | kubectl apply -f k8s/ - name: Wait for pods run: | kubectl wait --for=condition=available deployment --all --timeout=120s - name: Get cluster resources run: | kubectl get pods -A kubectl get svc -A - name: Delete cluster if: always() run: | kind delete cluster --name ci-cluster Example Kubernetes deployment (k8s/deployment.yaml) apiVersion: apps/v1 kind: Deployment metadata: name: hello-nginx spec: replicas: 1 selector: matchLabels: app: hello-nginx template: metadata: labels: app: hello-nginx spec: containers: - name: nginx image: nginx:alpine ports: - containerPort: 80 Github Repository 👉 https://github.com/chandresh1339-max/KindCI 🔔 Subscribe to my channel for more content 👉https://www.youtube.com/@learningcurve_tutorials #gitops #k8s #kubectl #devopssoftware #kind #cicd #gitops #yaml #cicdpipeline #kubernetesforbeginners