KevsRobots Learning Platform
70% Percent Complete
By Kevin McAleer, 2 Minutes
Page last updated May 24, 2025

Running apps manually is fine for testing, but to manage real applications, you need CI/CD — Continuous Integration and Continuous Deployment.
In this lesson, you’ll learn how to automate deployment to your K3s cluster using tools like GitHub Actions, kubectl, and GitOps platforms such as ArgoCD or Flux.
A typical CI/CD pipeline for K3s:
kubectl applyTo allow GitHub Actions to deploy, save your ~/.kube/config from your master node, base64-encode it:
cat ~/.kube/config | base64 -w 0
Add it as a GitHub Secret (e.g., KUBECONFIG_B64).
name: Deploy to K3s
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up kubectl
run: |
echo "$" | base64 -d > kubeconfig
export KUBECONFIG=$PWD/kubeconfig
kubectl version --client
- name: Apply manifests
run: |
kubectl apply -f k8s/
Your repo should have a k8s/ folder with Kubernetes manifests.
GitOps tools automatically sync your cluster with a Git repository.
kubectl create namespace argocd
kubectl apply -n argocd \
-f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Access ArgoCD UI:
kubectl port-forward svc/argocd-server -n argocd 8080:443
Default login:
adminkubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath="{.data.password}" | base64 -d
Connect your Git repo and ArgoCD will deploy automatically on changes.
You now know how to:
Next up: Advanced Networking & CNI
You can use the arrows ← → on your keyboard to navigate between lessons.
Comments