diff --git a/MINIKUBE_SETUP.md b/MINIKUBE_SETUP.md new file mode 100644 index 0000000..c2981f4 --- /dev/null +++ b/MINIKUBE_SETUP.md @@ -0,0 +1,69 @@ +To set up a local Kubernetes cluster using Minikube with Calico for network policy and MetalLB for load balancing, follow these steps. This setup will help you deploy and test the demo application locally. + +### Step-by-Step Guide + +### Prerequisites + +- Install Minikube: Follow the [Minikube installation guide](https://minikube.sigs.k8s.io/docs/start/) +- Install kubectl: Follow the [kubectl installation guide](https://kubernetes.io/docs/tasks/tools/install-kubectl/) + +### Setup Minikube with Calico and MetalLB + +#### 1. Start Minikube with Calico + +Start Minikube with the Calico CNI plugin: + +```bash +minikube start --network-plugin=cni --cni=calico +``` + +Verify that Calico is running: + +```bash +kubectl get pods -n kube-system | grep calico +``` + +#### 2. Set Up MetalLB + +1. **Install MetalLB** + + Apply the MetalLB manifests: + + ```bash + kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.12.1/manifests/namespace.yaml + kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.12.1/manifests/metallb.yaml + ``` + +2. **Configure MetalLB** + + Determine the IP address range that your Minikube cluster is using: + + ```bash + minikube ip + ``` + + Let's assume your Minikube IP is `192.168.49.2`. Use an IP range in the same subnet for MetalLB (e.g., `192.168.49.30-192.168.49.40`). + + Create a MetalLB configuration file: + + ```yaml + # metallb-config.yaml + apiVersion: v1 + kind: ConfigMap + metadata: + namespace: metallb-system + name: config + data: + config: | + address-pools: + - name: default + protocol: layer2 + addresses: + - 192.168.49.30-192.168.49.40 + ``` + + Apply the configuration: + + ```bash + kubectl apply -f metallb-config.yaml + ``` diff --git a/manifests/app-namespace.yml b/deployment/app-namespace.yml similarity index 100% rename from manifests/app-namespace.yml rename to deployment/app-namespace.yml diff --git a/manifests/backend-deployment.yml b/deployment/backend-deployment.yml similarity index 100% rename from manifests/backend-deployment.yml rename to deployment/backend-deployment.yml diff --git a/manifests/backend-service.yml b/deployment/backend-service.yml similarity index 100% rename from manifests/backend-service.yml rename to deployment/backend-service.yml diff --git a/manifests/demo-namespace.yml b/deployment/demo-namespace.yml similarity index 100% rename from manifests/demo-namespace.yml rename to deployment/demo-namespace.yml diff --git a/manifests/demo-pod.yml b/deployment/demo-pod.yml similarity index 100% rename from manifests/demo-pod.yml rename to deployment/demo-pod.yml diff --git a/manifests/frontend-deployment.yml b/deployment/frontend-deployment.yml similarity index 100% rename from manifests/frontend-deployment.yml rename to deployment/frontend-deployment.yml diff --git a/manifests/frontend-service.yml b/deployment/frontend-service.yml similarity index 100% rename from manifests/frontend-service.yml rename to deployment/frontend-service.yml diff --git a/deployment/metallb-config-minikube.yml b/deployment/metallb-config-minikube.yml new file mode 100644 index 0000000..2ef0aca --- /dev/null +++ b/deployment/metallb-config-minikube.yml @@ -0,0 +1,13 @@ +# metallb-config.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + namespace: metallb-system + name: config +data: + config: | + address-pools: + - name: default + protocol: layer2 + addresses: + - 192.168.49.30-192.168.49.40 \ No newline at end of file diff --git a/manifests/network-policy.yml b/deployment/network-policy.yml similarity index 100% rename from manifests/network-policy.yml rename to deployment/network-policy.yml