MacOS can build a k8s cluster with below after Homebrew is installed.
brew install ko kind
kind create clusterThen build and push image to kind cluster, then rollout pods.
echo "make sure main.go is under hello/"
mkdir hello
mv main.go hello/
echo "specify linux/arm64 platform on Mac M1 machines"
env KO_DOCKER_REPO=kind.local ko build --platform linux/arm64 -B ./hello/
kubectl apply -f hello.yaml
kubectl get pods
kubectl wait --for=condition=Available deployments/helloAfter update the code, rebuild and push image to kind cluster, then rollout pods.
env KO_DOCKER_REPO=kind.local ko build --platform linux/arm64 -B ./hello/
kubectl rollout restart deployment/hello
kubectl wait --for=condition=Available deployments/helloAfter pods are ready, forward port to the service.
kubectl port-forward service/hello 8080:8080Then in other terminal window run curl localhost:8080 to test, use kubectl logs -l app=hello to check logs.