Codebase for the blog post #HOWTO: Deploy a React application to Kuberntes
Steps to run this project:
- Clone this Git repository
- Navigate to the folder
react-app-kubernetes - Make sure your Docker engine with Kubernetes support is enabled
- Build the React app with
npm run-script build - Dockerize the application with
docker build -t my-react-app . - (Optional if you don't deploy to a local cluster) Create a local Docker registry with
docker run -d -p 5000:5000 --restart=always --name registry registry:2 - Tag the Docker image with
docker tag my-react-app localhost:5000/my-react-app - Push the Docker image with
docker push localhost:5000/my-react-app - Create the Kubernetes service and deployment with
kubectl apply -f deployment.yaml - Visit http://localhost:31000 to see your React application