Before you begin, ensure you have the following installed:
- Docker
- Kubernetes (via kubeadm, kind, or minikube)
- Helm
-
Clone this repository:
git clone https://github.com/raghuramgrr/cloud-native-kubernetes-docker.git cd cloud-native-kubernetes-docker
-
Navigate to the Dockerfiles directory and build the Docker image
cd dockerfiles
docker build -t myapp .
- Set up your Kubernetes cluster using the provided script:
cd k8s-cluster-setup
bash setup-cluster.sh
4.Apply the Kubernetes manifests:
kubectl apply -f ../microservices/k8s-manifests/deployments/myapp-deployment.yaml
kubectl apply -f ../microservices/k8s-manifests/services/myapp-service.yaml
5.(Optional) Install the Helm chart:
cd ../helm-charts/myapp
helm install myapp .
Usage Once deployed, you can access your application through the service created in Kubernetes. For example, if you're using ClusterIP, you'll need to port-forward to access it locally:
kubectl port-forward service/myapp-service 8080:80
Now, you can access your application at http://localhost:8080.