Deploys a single replica of your React.js application inside a pod. The pod uses the Docker image built and pushed by your GitHub Actions CI/CD workflow
(refer to [Automate your builds with GitHub Actions](configure-github-actions.md)).
The container listens on port `8080`, which is typically used by [Nginx](https://nginx.org/en/docs/) to serve your production React app.
- Service (NodePort)
Exposes the deployed pod to your local machine.
It forwards traffic from port `30001` on your host to port `8080` inside the container.
This lets you access the application in your browser at [http://localhost:30001](http://localhost:30001).
> [!NOTE]
> To learn more about Kubernetes objects, see the [Kubernetes documentation](https://kubernetes.io/docs/home/).
---
## Deploy and check your application
Follow these steps to deploy your containerized React.js app into a local Kubernetes cluster and verify that it’s running correctly.
### Step 1. Apply the Kubernetes configuration
In your terminal, navigate to the directory where your `reactjs-sample-kubernetes.yaml` file is located, then deploy the resources using:
```console
$ kubectl apply -f reactjs-sample-kubernetes.yaml
```
If everything is configured properly, you’ll see confirmation that both the Deployment and the Service were created:
```shell
deployment.apps/reactjs-sample created
service/reactjs-sample-service created
```
This output means that both the Deployment and the Service were successfully created and are now running inside your local cluster.
### Step 2. Check the Deployment status
Run the following command to check the status of your deployment:
```console
$ kubectl get deployments
```
You should see an output similar to:
```shell
NAME READY UP-TO-DATE AVAILABLE AGE
reactjs-sample 1/1 1 1 14s
```
This confirms that your pod is up and running with one replica available.
### Step 3. Verify the Service exposure
Check if the NodePort service is exposing your app to your local machine:
```console
$ kubectl get services
```
You should see something like:
```shell
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
reactjs-sample-service NodePort 10.100.244.65 <none> 8080:30001/TCP 1m