To deploy an app on Minikube, follow these steps:
Start Minikube: First, ensure that Minikube is installed and start it with the following command:
minikube startCreate a Deployment YAML file: Create a YAML file for your application deployment. For example, create a file named
app-deployment.yaml:apiVersion: apps/v1 kind: Deployment metadata: name: my-app spec: replicas: 1 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: my-app image: nginx:latest ports: - containerPort: 80Apply the Deployment: Use the
kubectl applycommand to deploy the application:kubectl apply -f app-deployment.yamlExpose the Deployment: To access your application, expose it using a service:
kubectl expose deployment my-app --type=NodePort --port=80Access the Application: Get the URL to access your application:
minikube service my-app --urlVerify the Deployment: Check the status of your deployment:
kubectl get deployments
By following these steps, you can successfully deploy an application on Minikube.
