This project demonstrates deploying a simple Express.js application to a Minikube cluster.
It uses Kubernetes ConfigMap for non-sensitive settings and Secret for sensitive data.
- Prereqs
- Project Structure
- Quickstart
- Endpoints
- Cheatsheet
- Note on Secret
- Docker Hub Image
- Get the Code
- License
- Author
- Docker Desktop (or Docker Engine)
- Minikube
- kubectl
- Node.js (for local testing)
- Docker Hub account
.
├── app.js
├── package.json
├── Dockerfile
├── k8s/
│ ├── configmap.yaml
│ ├── secret.yaml
│ ├── deployment.yaml
│ └── service.yaml
└── README.md
└── K8S-CHEATSHEET.md
minikube start
✅ Check node is ready:
kubectl get nodes
eval $(minikube docker-env)
docker build -t express-k8s-app:latest .
If using Docker Hub image (recommended for portability), ensure your deployment.yaml
uses:
image: ilouckov/express-k8s-app:latest
kubectl apply -f k8s/configmap.yaml
kubectl apply -f k8s/secret.yaml
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
✅ Check resources:
kubectl get all
minikube service express-service --url
Open the URL in your browser or use curl
:
curl http://<minikube-ip>:<nodePort>/
curl http://<minikube-ip>:<nodePort>/check-api
curl http://<minikube-ip>:<nodePort>/healthz
curl http://<minikube-ip>:<nodePort>/ready
Endpoint | Description |
---|---|
/ |
Returns app name & environment from ConfigMap |
/check-api |
Shows if API key is configured from Secret |
/healthz |
Health check endpoint (200 OK ) |
/ready |
Readiness probe endpoint (200 OK ) |
See K8S-CHEATSHEET.md for quick reference commands and testing.
Your k8s/secret.yaml
contains the API_KEY
value encoded in base64.
To create your own secret value:
echo -n 'YourSecretValueHere' | base64
Replace the value in secret.yaml
.
The Docker image for this app is publicly available at:
You can pull it directly using:
docker pull ilouckov/express-k8s-app:latest
If you want to clone the repo:
git clone https://github.com/ILXNAH/minikube-express-configmap-secret
Then follow the Quickstart steps above!
This project is licensed under the MIT License.
Built by ILXNAH as part of a hands-on DevOps assessment.