{"id":17318,"date":"2023-06-19T21:58:43","date_gmt":"2023-06-19T18:58:43","guid":{"rendered":"https:\/\/kifarunix.com\/?p=17318"},"modified":"2024-03-10T09:46:27","modified_gmt":"2024-03-10T06:46:27","slug":"step-by-step-tutorial-install-minikube-on-debian-12","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/step-by-step-tutorial-install-minikube-on-debian-12\/","title":{"rendered":"Step-by-Step Tutorial: Install Minikube on Debian 12"},"content":{"rendered":"\n<p>I want to run a single node Kubernetes cluster on my local machine. But how? Well, this step-by-step guide will take you through all the steps required to install <a href=\"https:\/\/kubernetes.io\/docs\/tasks\/tools\/#minikube\" target=\"_blank\" rel=\"noreferrer noopener\">Minikube<\/a> on Debian 12 so that you can start to learn and experiment Kubernetes on your local development system.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#installing-minikube-on-debian-12\">Installing Minikube on Debian 12<\/a><ul><li><a href=\"#prerequisites\">Prerequisites<\/a><ul><li><a href=\"#kubernetes-concepts\">Kubernetes Concepts;<\/a><\/li><li><a href=\"#system-resources\">System Resources<\/a><\/li><li><a href=\"#minikube-drivers\">Minikube Drivers<\/a><\/li><li><a href=\"#internet-access\">Internet Access<\/a><\/li><li><a href=\"#install-kubectl\">Install Kubectl<\/a><\/li><\/ul><\/li><li><a href=\"#installing-minikube-on-debian-12-1\">Installing Minikube on Debian 12<\/a><\/li><li><a href=\"#starting-minikube\">Starting Minikube<\/a><ul><li><a href=\"#minikube-help-page\">Minikube Help Page<\/a><\/li><li><a href=\"#start-local-kubernetes-cluster\">Start Local Kubernetes cluster<\/a><\/li><li><a href=\"#check-minikube-status\">Check Minikube Status<\/a><\/li><\/ul><\/li><li><a href=\"#administering-kubernetes-on-minikube\">Administering Kubernetes on Minikube<\/a><ul><li><a href=\"#minikube-ssh-login\">Minikube SSH Login<\/a><\/li><li><a href=\"#get-kubernetes-cluster-resource-information\">Get Kubernetes Cluster Resource Information<\/a><\/li><li><a href=\"#deploy-simple-kubernets-application\">Deploy Simple Kubernets Application<\/a><\/li><\/ul><\/li><li><a href=\"#enable-minikube-addons\">Enable Minikube Addons<\/a><\/li><li><a href=\"#stop-and-delete-minikube-profile\">Stop and Delete Minikube Profile<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"installing-minikube-on-debian-12\">Installing Minikube on Debian 12<\/h2>\n\n\n\n<p>So, what are the steps to install Minikube?<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h3>\n\n\n\n<p>Before you can use Minikube, there are a number of requirements that you need to consider;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"kubernetes-concepts\">Kubernetes Concepts;<\/h4>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/what-are-the-core-concepts-in-kubernetes\/\" target=\"_blank\" rel=\"noreferrer noopener\">What are the core concepts in Kubernetes?<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"system-resources\">System Resources<\/h4>\n\n\n\n<p>Ensure your system has;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>At least 2 CPUs<\/li>\n\n\n\n<li>At least 2GB of free RAM<\/li>\n\n\n\n<li>At least 20GB of free Disk space<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"minikube-drivers\">Minikube Drivers<\/h4>\n\n\n\n<p>Drivers are components that Minikube uses to interact with various virtualization technologies used to run Kubernetes cluster. They can be a container or virtual machine manager, such as:&nbsp;Docker,&nbsp;QEMU,&nbsp;Hyperkit,&nbsp;Hyper-V,&nbsp;KVM,&nbsp;Parallels,&nbsp;Podman,&nbsp;VirtualBox, or&nbsp;VMware Fusion\/Workstation.<\/p>\n\n\n\n<p>You can check how to install Docker, VirtualBox or KVM on Debian 12 by following the links below;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-install-docker-ce-on-debian-12\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install Docker CE on Debian 12<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-virtualbox-7-on-debian-12\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install VirtualBox 7 on Debian 12<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-kvm-on-debian-12\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install KVM on Debian 12<\/a><\/p>\n\n\n\n<p>We will be using Docker in this guide to run Minikube.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"internet-access\">Internet Access<\/h4>\n\n\n\n<p>Ensure the system has Internet connection. This is required to download various Minikube components.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"install-kubectl\">Install Kubectl<\/h4>\n\n\n\n<p>Install Kuberenetes command line tool, <strong>kubectl<\/strong>;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -LO \"https:\/\/dl.k8s.io\/release\/$(curl -L -s https:\/\/dl.k8s.io\/release\/stable.txt)\/bin\/linux\/amd64\/kubectl\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo install -o root -g root -m 0755 kubectl \/usr\/local\/bin\/kubectl<\/code><\/pre>\n\n\n\n<p>Verify the kubectl version;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl version --client --output=yaml<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nclientVersion:\n  buildDate: \"2023-06-14T09:53:42Z\"\n  compiler: gc\n  gitCommit: 25b4e43193bcda6c7328a6d147b1fb73a33f1598\n  gitTreeState: clean\n  gitVersion: v1.27.3\n  goVersion: go1.20.5\n  major: \"1\"\n  minor: \"27\"\n  platform: linux\/amd64\nkustomizeVersion: v5.0.1\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installing-minikube-on-debian-12-1\">Installing Minikube on Debian 12<\/h3>\n\n\n\n<p>Installing Minikube on Debian is as easy as executing the commands below;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -LO https:\/\/storage.googleapis.com\/minikube\/releases\/latest\/minikube_latest_amd64.deb<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install .\/minikube_latest_amd64.deb<\/code><\/pre>\n\n\n\n<p>Once the installation is done, you should be able to proceed with using Minikube.<\/p>\n\n\n\n<p>Let&#8217;s check the version;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube version<\/code><\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube version: v1.30.1\ncommit: 08896fd1dc362c097c925146c4a0d0dac715ace0<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"starting-minikube\">Starting Minikube<\/h3>\n\n\n\n<p>We are running the next commands with a non root user;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>su - kifarunix<\/code><\/pre>\n\n\n\n<p>Add your user to Docker group;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo usermod -aG docker $USER<\/code><\/pre>\n\n\n\n<p>Log out and login as user again<\/p>\n\n\n\n<p>Ensure you are part of the Docker group;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>id<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>uid=1000(kifarunix) gid=1000(kifarunix) groups=1000(kifarunix),100(users),992(docker),995(vboxsf)<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"minikube-help-page\">Minikube Help Page<\/h4>\n\n\n\n<p>Run the command below to check Minikube help information;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube --help<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nminikube provisions and manages local Kubernetes clusters optimized for development workflows.\n\nBasic Commands:\n  start            Starts a local Kubernetes cluster\n  status           Gets the status of a local Kubernetes cluster\n  stop             Stops a running local Kubernetes cluster\n  delete           Deletes a local Kubernetes cluster\n  dashboard        Access the Kubernetes dashboard running within the minikube cluster\n  pause            pause Kubernetes\n  unpause          unpause Kubernetes\n\nImages Commands:\n  docker-env       Provides instructions to point your terminal's docker-cli to the Docker Engine inside minikube.\n(Useful for building docker images directly inside minikube)\n  podman-env       Configure environment to use minikube's Podman service\n  cache            Manage cache for images\n  image            Manage images\n\nConfiguration and Management Commands:\n  addons           Enable or disable a minikube addon\n  config           Modify persistent configuration values\n  profile          Get or list the current profiles (clusters)\n  update-context   Update kubeconfig in case of an IP or port change\n\nNetworking and Connectivity Commands:\n  service          Returns a URL to connect to a service\n  tunnel           Connect to LoadBalancer services\n\nAdvanced Commands:\n  mount            Mounts the specified directory into minikube\n  ssh              Log into the minikube environment (for debugging)\n  kubectl          Run a kubectl binary matching the cluster version\n  node             Add, remove, or list additional nodes\n  cp               Copy the specified file into minikube\n\nTroubleshooting Commands:\n  ssh-key          Retrieve the ssh identity key path of the specified node\n  ssh-host         Retrieve the ssh host key of the specified node\n  ip               Retrieves the IP address of the specified node\n  logs             Returns logs to debug a local Kubernetes cluster\n  update-check     Print current and latest version number\n  version          Print the version of minikube\n  options          Show a list of global command-line options (applies to all commands).\n\nOther Commands:\n  completion       Generate command completion for a shell\n  license          Outputs the licenses of dependencies to a directory\n\nUse \"minikube <command> --help\" for more information about a given command.\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"start-local-kubernetes-cluster\">Start Local Kubernetes cluster<\/h4>\n\n\n\n<p>You can show start Minikube local kubernetes cluster by running;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube start --driver=docker<\/code><\/pre>\n\n\n\n<p>So what does this command do?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It starts control plane node minikube in cluster.<\/li>\n\n\n\n<li>Pulls the base image required to create Kubernetes cluster<\/li>\n\n\n\n<li>Next, it downloads preconfigured set of Kubernetes binaries to bootstrap the cluster.<\/li>\n\n\n\n<li>Setup Kubernetes on Docker<\/li>\n\n\n\n<li>Configures container networking interface<\/li>\n\n\n\n<li>Enable some Minikube add-ons such as for storage.<\/li>\n<\/ul>\n\n\n\n<p>See sample output;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\n\ud83d\ude04  minikube v1.30.1 on Debian 12.0\n\u2728  Using the docker driver based on user configuration\n\ud83d\udccc  Using Docker driver with root privileges\n\ud83d\udc4d  Starting control plane node minikube in cluster minikube\n\ud83d\ude9c  Pulling base image ...\n\ud83d\udcbe  Downloading Kubernetes v1.26.3 preload ...\n    > preloaded-images-k8s-v18-v1...:  397.02 MiB \/ 397.02 MiB  100.00% 1.25 Mi\n    > gcr.io\/k8s-minikube\/kicbase...:  373.53 MiB \/ 373.53 MiB  100.00% 1.04 Mi\n\ud83d\udd25  Creating docker container (CPUs=2, Memory=2200MB) ...\n\ud83d\udc33  Preparing Kubernetes v1.26.3 on Docker 23.0.2 ...\n    \u25aa Generating certificates and keys ...\n    \u25aa Booting up control plane ...\n    \u25aa Configuring RBAC rules ...\n\ud83d\udd17  Configuring bridge CNI (Container Networking Interface) ...\n    \u25aa Using image gcr.io\/k8s-minikube\/storage-provisioner:v5\n\ud83d\udd0e  Verifying Kubernetes components...\n\ud83c\udf1f  Enabled addons: storage-provisioner, default-storageclass\n\ud83c\udfc4  Done! kubectl is now configured to use \"minikube\" cluster and \"default\" namespace by default\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"check-minikube-status\">Check Minikube Status<\/h4>\n\n\n\n<p>You can check Minikube status using the command below;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube status<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nminikube\ntype: Control Plane\nhost: Running\nkubelet: Running\napiserver: Running\nkubeconfig: Configured\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"administering-kubernetes-on-minikube\">Administering Kubernetes on Minikube<\/h3>\n\n\n\n<p>You should now be able to administer Kubernetes on Minikube.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"minikube-ssh-login\">Minikube SSH Login<\/h4>\n\n\n\n<p>You can SSH into minikube using the command below;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube ssh<\/code><\/pre>\n\n\n\n<p>You land into the the minikube docker shell.<\/p>\n\n\n\n<p>Run docker commands inside;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker ps<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nCONTAINER ID   IMAGE                       COMMAND                  CREATED         STATUS         PORTS     NAMES\n0d92ee88b84f   6e38f40d628d                \"\/storage-provisioner\"   4 minutes ago   Up 4 minutes             k8s_storage-provisioner_storage-provisioner_kube-system_6afa8ea3-36d7-41ad-938f-843f25aa6d4a_1\nbe75fdc607c6   5185b96f0bec                \"\/coredns -conf \/etc\u2026\"   4 minutes ago   Up 4 minutes             k8s_coredns_coredns-787d4945fb-49k2m_kube-system_e37b1967-be5d-4554-a46f-05a2997de74e_0\nfe9b2a99b6ec   registry.k8s.io\/pause:3.9   \"\/pause\"                 4 minutes ago   Up 4 minutes             k8s_POD_coredns-787d4945fb-49k2m_kube-system_e37b1967-be5d-4554-a46f-05a2997de74e_0\n9a9a928c9cf7   92ed2bec97a6                \"\/usr\/local\/bin\/kube\u2026\"   4 minutes ago   Up 4 minutes             k8s_kube-proxy_kube-proxy-q8thm_kube-system_9f6fae56-0458-49d6-8ba5-82ec9c2189b1_0\n7dc47e863ff0   registry.k8s.io\/pause:3.9   \"\/pause\"                 4 minutes ago   Up 4 minutes             k8s_POD_kube-proxy-q8thm_kube-system_9f6fae56-0458-49d6-8ba5-82ec9c2189b1_0\nc1fcaf7f7d56   registry.k8s.io\/pause:3.9   \"\/pause\"                 4 minutes ago   Up 4 minutes             k8s_POD_storage-provisioner_kube-system_6afa8ea3-36d7-41ad-938f-843f25aa6d4a_0\n04d74488c2bf   1d9b3cbae03c                \"kube-apiserver --ad\u2026\"   5 minutes ago   Up 5 minutes             k8s_kube-apiserver_kube-apiserver-minikube_kube-system_cdcbce216c62c4407ac9a51ac013e7d7_0\nc6561bab22ad   ce8c2293ef09                \"kube-controller-man\u2026\"   5 minutes ago   Up 5 minutes             k8s_kube-controller-manager_kube-controller-manager-minikube_kube-system_466b9e73e627277a8c24637c2fa6442d_0\n37040d7add6b   5a7904736932                \"kube-scheduler --au\u2026\"   5 minutes ago   Up 5 minutes             k8s_kube-scheduler_kube-scheduler-minikube_kube-system_0818f4b1a57de9c3f9c82667e7fcc870_0\n698ab8856b5e   fce326961ae2                \"etcd --advertise-cl\u2026\"   5 minutes ago   Up 5 minutes             k8s_etcd_etcd-minikube_kube-system_a121e106627e5c6efa9ba48006cc43bf_0\n38cb851be00c   registry.k8s.io\/pause:3.9   \"\/pause\"                 5 minutes ago   Up 5 minutes             k8s_POD_kube-scheduler-minikube_kube-system_0818f4b1a57de9c3f9c82667e7fcc870_0\n80d9696d3a3f   registry.k8s.io\/pause:3.9   \"\/pause\"                 5 minutes ago   Up 5 minutes             k8s_POD_kube-controller-manager-minikube_kube-system_466b9e73e627277a8c24637c2fa6442d_0\n9fb63368a575   registry.k8s.io\/pause:3.9   \"\/pause\"                 5 minutes ago   Up 5 minutes             k8s_POD_kube-apiserver-minikube_kube-system_cdcbce216c62c4407ac9a51ac013e7d7_0\ncea349f8a641   registry.k8s.io\/pause:3.9   \"\/pause\"                 5 minutes ago   Up 5 minutes             k8s_POD_etcd-minikube_kube-system_a121e106627e5c6efa9ba48006cc43bf_0\n<\/code><\/pre>\n\n\n\n<p>Check docker images;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker images<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nREPOSITORY                                TAG       IMAGE ID       CREATED         SIZE\nregistry.k8s.io\/kube-apiserver            v1.26.3   1d9b3cbae03c   3 months ago    134MB\nregistry.k8s.io\/kube-controller-manager   v1.26.3   ce8c2293ef09   3 months ago    123MB\nregistry.k8s.io\/kube-scheduler            v1.26.3   5a7904736932   3 months ago    56.4MB\nregistry.k8s.io\/kube-proxy                v1.26.3   92ed2bec97a6   3 months ago    65.6MB\nregistry.k8s.io\/etcd                      3.5.6-0   fce326961ae2   6 months ago    299MB\nregistry.k8s.io\/pause                     3.9       e6f181688397   8 months ago    744kB\nregistry.k8s.io\/coredns\/coredns           v1.9.3    5185b96f0bec   12 months ago   48.8MB\ngcr.io\/k8s-minikube\/storage-provisioner   v5        6e38f40d628d   2 years ago     31.5MB\n\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>docker system df<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nTYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE\nImages          8         8         751.9MB   3.967MB (0%)\nContainers      15        14        162B      0B (0%)\nLocal Volumes   0         0         0B        0B\nBuild Cache     0         0         0B        0B\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"get-kubernetes-cluster-resource-information\">Get Kubernetes Cluster Resource Information<\/h4>\n\n\n\n<p>Let&#8217;s run a few Kubernetes commands;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Get Kubernetes cluster information;<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl cluster-info<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>\nKubernetes control plane is running at https:\/\/192.168.49.2:8443\nCoreDNS is running at https:\/\/192.168.49.2:8443\/api\/v1\/namespaces\/kube-system\/services\/kube-dns:dns\/proxy\n\nTo further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Lists all the nodes in the current namespace.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get nodes<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>\nNAME       STATUS   ROLES           AGE     VERSION\nminikube   Ready    control-plane   7h52m   v1.26.3\n<\/code><\/pre>\n\n\n\n<p>List all services in the current namespace;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get services<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>\nNAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE\nkubernetes   ClusterIP   10.96.0.1    <none>        443\/TCP   7h53m\n<\/code><\/pre>\n\n\n\n<p>You can basically manage your Kubernetes cluster just as would on any prod environment.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"deploy-simple-kubernets-application\">Deploy Simple Kubernets Application<\/h4>\n\n\n\n<p>Let&#8217;s create a simple Nginx manifest file to define the desired state;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim nginx-deployment.yaml<\/code><\/pre>\n\n\n\n<p>Paste the following content;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\napiVersion: apps\/v1\nkind: Deployment\nmetadata:\n  name: nginx-deployment\nspec:\n  replicas: 2\n  selector:\n    matchLabels:\n      app: nginx\n  template:\n    metadata:\n      labels:\n        app: nginx\n    spec:\n      containers:\n      - name: nginx\n        image: nginx:latest\n        ports:\n        - containerPort: 80\n<\/code><\/pre>\n\n\n\n<p>Deploy Nginx;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f nginx-deployment.yaml<\/code><\/pre>\n\n\n\n<p>List deployments;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get deployments<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>\nNAME               READY   UP-TO-DATE   AVAILABLE   AGE\nnginx-deployment   0\/2     2            0           13s\n\n<\/code><\/pre>\n\n\n\n<p>Check the pods. You should see two of them due to replica of 2;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get pods<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>\nNAME                                READY   STATUS    RESTARTS   AGE\nnginx-deployment-6b7f675859-ljsh8   1\/1     Running   0          7s\nnginx-deployment-6b7f675859-qvnpn   1\/1     Running   0          7s\n\n<\/code><\/pre>\n\n\n\n<p>Next, you need to expose this service for external access;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim nginx-service.yaml<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\napiVersion: v1\nkind: Service\nmetadata:\n  name: nginx-service\nspec:\n  type: NodePort\n  selector:\n    app: nginx\n  ports:\n    - name: http\n      port: 80\n      targetPort: 80\n      nodePort: 30000  # Choose an available port number\n<\/code><\/pre>\n\n\n\n<p>Ensure no other service is being exposed via port 31500\/tcp defined above.<\/p>\n\n\n\n<p>Apply the service;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f nginx-service.yaml<\/code><\/pre>\n\n\n\n<p>Check the services to find out an external port to access it;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get services<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>\nNAME            TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE\nkubernetes      ClusterIP   10.96.0.1       <none>        443\/TCP        60m\nnginx-service   NodePort    10.107.130.31   <none>        80:30000\/TCP   3s\n<\/code><\/pre>\n\n\n\n<p>get more details;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl describe service nginx-service<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nName:                     nginx-service\nNamespace:                default\nLabels:                   <none>\nAnnotations:              <none>\nSelector:                 app=nginx\nType:                     NodePort\nIP Family Policy:         SingleStack\nIP Families:              IPv4\nIP:                       10.107.130.31\nIPs:                      10.107.130.31\nPort:                     http  80\/TCP\nTargetPort:               80\/TCP\nNodePort:                 http  30000\/TCP\nEndpoints:                10.244.0.8:80,10.244.0.9:80\nSession Affinity:         None\nExternal Traffic Policy:  Cluster\nEvents:                   <none>\n\n<\/code><\/pre>\n\n\n\n<p>Accessing the Service. You can print the url or open service on the default browser;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube service nginx-service<\/code><\/pre>\n\n\n\n<p>Sample browser;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1522\" height=\"1019\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/accessing-the-service.png\" alt=\"Install Minikube on Debian 12\" class=\"wp-image-17370\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/accessing-the-service.png?v=1687197921 1522w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/accessing-the-service-768x514.png?v=1687197921 768w\" sizes=\"(max-width: 1522px) 100vw, 1522px\" \/><\/figure>\n\n\n\n<p>and command line output;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\n|-----------|---------------|-------------|---------------------------|\n| NAMESPACE |     NAME      | TARGET PORT |            URL            |\n|-----------|---------------|-------------|---------------------------|\n| default   | nginx-service | http\/80     | http:\/\/192.168.49.2:30000 |\n|-----------|---------------|-------------|---------------------------|\n\ud83c\udf89  Opening service default\/nginx-service in default browser...\n<\/code><\/pre>\n\n\n\n<p>Unfortunately, our service is exposed via docker bridge interface IP and hence, makes it hard to access externally.<\/p>\n\n\n\n<p>You can do port forwarding of Nginx target port to some other unused ports as follows;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl port-forward service\/nginx-service --address=0.0.0.0 8080:80<\/code><\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Forwarding from 0.0.0.0:8080 -&gt; 80\nHandling connection for 8080\nHandling connection for 8080<\/code><\/pre>\n\n\n\n<p>Press CTRL+C to cancel.<\/p>\n\n\n\n<p>You should now be able to access your App outside Minikube cluster, <strong><code>http:\/\/&lt;server-IP&gt;:8080<\/code><\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1164\" height=\"428\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/access-minikube-app-outside-cluster.png\" alt=\"Install Minikube on Debian 12\" class=\"wp-image-17371\" style=\"width:880px;height:323px\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/access-minikube-app-outside-cluster.png?v=1687198851 1164w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/access-minikube-app-outside-cluster-768x282.png?v=1687198851 768w\" sizes=\"(max-width: 1164px) 100vw, 1164px\" \/><\/figure>\n\n\n\n<p>You can now proceed to explore Kubernetes!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"enable-minikube-addons\">Enable Minikube Addons<\/h3>\n\n\n\n<p>Addons are components that can be used to extend the functionality of Minikube;<\/p>\n\n\n\n<p>There is quite a number of addons;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube addons list<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\n|-----------------------------|----------|--------------|--------------------------------|\n|         ADDON NAME          | PROFILE  |    STATUS    |           MAINTAINER           |\n|-----------------------------|----------|--------------|--------------------------------|\n| ambassador                  | minikube | disabled     | 3rd party (Ambassador)         |\n| auto-pause                  | minikube | disabled     | Google                         |\n| cloud-spanner               | minikube | disabled     | Google                         |\n| csi-hostpath-driver         | minikube | disabled     | Kubernetes                     |\n| dashboard                   | minikube | disabled     | Kubernetes                     |\n| default-storageclass        | minikube | enabled \u2705   | Kubernetes                     |\n| efk                         | minikube | disabled     | 3rd party (Elastic)            |\n| freshpod                    | minikube | disabled     | Google                         |\n| gcp-auth                    | minikube | disabled     | Google                         |\n| gvisor                      | minikube | disabled     | Google                         |\n| headlamp                    | minikube | disabled     | 3rd party (kinvolk.io)         |\n| helm-tiller                 | minikube | disabled     | 3rd party (Helm)               |\n| inaccel                     | minikube | disabled     | 3rd party (InAccel             |\n|                             |          |              | [info@inaccel.com])            |\n| ingress                     | minikube | disabled     | Kubernetes                     |\n| ingress-dns                 | minikube | disabled     | Google                         |\n| istio                       | minikube | disabled     | 3rd party (Istio)              |\n| istio-provisioner           | minikube | disabled     | 3rd party (Istio)              |\n| kong                        | minikube | disabled     | 3rd party (Kong HQ)            |\n| kubevirt                    | minikube | disabled     | 3rd party (KubeVirt)           |\n| logviewer                   | minikube | disabled     | 3rd party (unknown)            |\n| metallb                     | minikube | disabled     | 3rd party (MetalLB)            |\n| metrics-server              | minikube | disabled     | Kubernetes                     |\n| nvidia-driver-installer     | minikube | disabled     | Google                         |\n| nvidia-gpu-device-plugin    | minikube | disabled     | 3rd party (Nvidia)             |\n| olm                         | minikube | disabled     | 3rd party (Operator Framework) |\n| pod-security-policy         | minikube | disabled     | 3rd party (unknown)            |\n| portainer                   | minikube | disabled     | 3rd party (Portainer.io)       |\n| registry                    | minikube | disabled     | Google                         |\n| registry-aliases            | minikube | disabled     | 3rd party (unknown)            |\n| registry-creds              | minikube | disabled     | 3rd party (UPMC Enterprises)   |\n| storage-provisioner         | minikube | enabled \u2705   | Google                         |\n| storage-provisioner-gluster | minikube | disabled     | 3rd party (Gluster)            |\n| volumesnapshots             | minikube | disabled     | Kubernetes                     |\n|-----------------------------|----------|--------------|--------------------------------|\n<\/code><\/pre>\n\n\n\n<p>You can enable an addon using the command;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube addons enable &lt;name&gt;<\/code><\/pre>\n\n\n\n<p>For example, enable Minikube dashboard;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube addons enable dashboard<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\n\ud83d\udca1  dashboard is an addon maintained by Kubernetes. For any concerns contact minikube on GitHub.\nYou can view the list of minikube maintainers at: https:\/\/github.com\/kubernetes\/minikube\/blob\/master\/OWNERS\n    \u25aa Using image docker.io\/kubernetesui\/dashboard:v2.7.0\n    \u25aa Using image docker.io\/kubernetesui\/metrics-scraper:v1.0.8\n\ud83d\udca1  Some dashboard features require the metrics-server addon. To enable all features please run:\n\n\tminikube addons enable metrics-server\t\n\n\n\ud83c\udf1f  The 'dashboard' addon is enabled\n\n<\/code><\/pre>\n\n\n\n<p>Also enable Metrics server;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube addons enable metrics-server<\/code><\/pre>\n\n\n\n<p>You can check the services for these addons on the kube-system namespace;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl get services --all-namespaces<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nNAMESPACE              NAME                        TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                  AGE\ndefault                kubernetes                  ClusterIP   10.96.0.1        <none>        443\/TCP                  18m\ndefault                nginx-service               NodePort    10.104.193.40    <none>        80:30000\/TCP             6m15s\nkube-system            kube-dns                    ClusterIP   10.96.0.10       <none>        53\/UDP,53\/TCP,9153\/TCP   18m\nkube-system            metrics-server              ClusterIP   10.106.159.6     <none>        443\/TCP                  6m46s\nkubernetes-dashboard   dashboard-metrics-scraper   ClusterIP   10.96.233.122    <none>        8000\/TCP                 7m21s\nkubernetes-dashboard   kubernetes-dashboard        ClusterIP   10.106.205.225   <none>        80\/TCP                   7m21s\n<\/code><\/pre>\n\n\n\n<p>To access the dashboard externally;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>kubectl port-forward service\/kubernetes-dashboard -n kubernetes-dashboard --address=0.0.0.0 8888:80<\/code><\/pre>\n\n\n\n<p>You dashboard is now availanle on <strong>http:\/\/minikube-server-IP:8888<\/strong>;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1885\" height=\"923\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/minikube-dashboard.png\" alt=\"Install Minikube on Debian 12\" class=\"wp-image-17376\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/minikube-dashboard.png?v=1687200932 1885w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/minikube-dashboard-768x376.png?v=1687200932 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/minikube-dashboard-1536x752.png?v=1687200932 1536w\" sizes=\"(max-width: 1885px) 100vw, 1885px\" \/><\/figure>\n\n\n\n<p>Explore the dashboard further.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"stop-and-delete-minikube-profile\">Stop and Delete Minikube Profile<\/h3>\n\n\n\n<p>You can always stop and delete Minikube profile;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube profile list<\/code><\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\n|----------|-----------|---------|--------------|------|---------|---------|-------|--------|\n| Profile  | VM Driver | Runtime |      IP      | Port | Version | Status  | Nodes | Active |\n|----------|-----------|---------|--------------|------|---------|---------|-------|--------|\n| minikube | docker    | docker  | 192.168.49.2 | 8443 | v1.26.3 | Running |     1 | *      |\n|----------|-----------|---------|--------------|------|---------|---------|-------|--------|\n<\/code><\/pre>\n\n\n\n<p>Or get current profile;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube profile<\/code><\/pre>\n\n\n\n<p>Stop Minikube;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube stop<\/code><\/pre>\n\n\n\n<p>Delete current profile;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube delete<\/code><\/pre>\n\n\n\n<p>or specific profile;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube delete --profile &lt;profile name&gt;<\/code><\/pre>\n\n\n\n<p>See example;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube delete --profile minikube<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\n\ud83d\udd25  Deleting \"minikube\" in docker ...\n\ud83d\udd25  Deleting container \"minikube\" ...\n\ud83d\udd25  Removing \/home\/kifarunix\/.minikube\/machines\/minikube ...\n\ud83d\udc80  Removed all traces of the \"minikube\" cluster.\n<\/code><\/pre>\n\n\n\n<p>And that concludes our guide on how to install Minikube on Debian 12.<\/p>\n\n\n\n<p>Other Tutorials;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/monitor-docker-swarm-and-container-metrics-using-metricbeat\/\" target=\"_blank\" rel=\"noreferrer noopener\">Monitor Docker Swarm and Container metrics using Metricbeat<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I want to run a single node Kubernetes cluster on my local machine. But how? Well, this step-by-step guide will take you through all the<\/p>\n","protected":false},"author":10,"featured_media":17376,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[1076,1077,121,1668],"tags":[6859,6922,6926,6924,6925,6927,6923,6928],"class_list":["post-17318","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-containers","category-docker","category-howtos","category-kubernetes","tag-debian-12","tag-install-minikube","tag-install-minikube-on-debian-12","tag-minikube-addons","tag-minikube-dashboard","tag-minikube-docker-driver","tag-minikube-ssh","tag-start-minikube-debian","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/17318"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=17318"}],"version-history":[{"count":20,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/17318\/revisions"}],"predecessor-version":[{"id":20768,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/17318\/revisions\/20768"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/17376"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=17318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=17318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=17318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}