This repository contains Kubernetes deployment configurations and the necessary steps to set up the infrastructure for the DevQuest platform.
Ensure you have the following tools installed:
.
├── kubernetes.yaml # Deployment and Service configurations
├── config-map.yaml # Configuration map for environment variables
├── README.md # Project setup and instructions
Apply the Kubernetes deployments and services:
kubectl apply -f config-map.yaml
kubectl apply -f kubernetes.yamlVerify the deployments and services:
kubectl get all -n defaultEnsure you have an NGINX ingress controller installed:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/cloud/deploy.yamlApply the ingress resource:
kubectl apply -f kubernetes.yamlVerify the ingress:
kubectl get ingress -n defaultFollow these steps to add Prometheus and Grafana monitoring to your cluster.
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo updatehelm install prometheus prometheus-community/kube-prometheus-stack -n monitoring --create-namespaceCheck the running pods in the monitoring namespace:
kubectl get pods -n monitoring-
Prometheus: Forward the Prometheus port to localhost:
kubectl port-forward -n monitoring svc/prometheus-kube-prometheus-prometheus 9090:9090
Access it at http://localhost:9090.
-
Grafana: Forward the Grafana port to localhost:
kubectl port-forward -n monitoring svc/prometheus-grafana 3000:3000
Access it at http://localhost:3000. Use the default credentials:
- Username:
admin - Password:
prom-operator
- Username:
- Replace sensitive values like
MONGODB_URIandDB_NAMEinconfig-map.yamlwith your actual configurations. - Ensure your domain or external IP is configured properly to access the services exposed through Ingress.
- Customize resource requests and limits in
kubernetes.yamlfor production environments.
- Check pod logs:
kubectl logs <pod-name>
- Verify service connectivity:
kubectl exec -it <pod-name> -- curl <service-name>
- Inspect ingress rules:
kubectl describe ingress devquest-ingress