npm i
npm run start
docker build -t k3d-react-app .
docker run -it -p 8080:80 k3d-react-app
brew install k3d
Create a cluster
Without opening a port during the creation of the k3d cluster, a nodeport service will not expose your app
k3d cluster create k3d-react-app -p "80:30080@agent[0]" --agents 2
Run the following command to verify you've two agents
kubectl get node -o wide
Export kubeconfig
export KUBECONFIG="$(k3d kubeconfig write k3d-react-app)"
Create a secret for pulling images from a private ECR repository
kubectl create secret docker-registry aws-ecr-credential \
--docker-server=<aws-account-id>.dkr.ecr.<aws-region>.amazonaws.com \
--docker-username=AWS \
--docker-password=$(aws ecr get-login-password)
Apply Deployment
kubectl apply -f deployment.yml
Apply Service
kubectl apply -f service.yml
Go to http://localhost/
kubectl delete service,deployment k3d-react-app