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 start -
Create a Deployment YAML file:
Create a YAML file for your application deployment. For example, create a file namedapp-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: 80 -
Apply the Deployment:
Use thekubectl applycommand to deploy the application:kubectl apply -f app-deployment.yaml -
Expose the Deployment:
To access your application, expose it using a service:kubectl expose deployment my-app --type=NodePort --port=80 -
Access the Application:
Get the URL to access your application:minikube service my-app --url -
Verify the Deployment:
Check the status of your deployment:kubectl get deployments
By following these steps, you can successfully deploy an application on Minikube.
