{"id":22010,"date":"2024-03-30T17:09:09","date_gmt":"2024-03-30T14:09:09","guid":{"rendered":"https:\/\/kifarunix.com\/?p=22010"},"modified":"2024-03-30T17:33:32","modified_gmt":"2024-03-30T14:33:32","slug":"installing-minikube-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/installing-minikube-on-ubuntu-24-04\/","title":{"rendered":"Installing Minikube on Ubuntu 24.04"},"content":{"rendered":"\n<p>If you are planning on getting started with Kubernetes, then installing Minikube on Ubuntu 24.04 might be the first step you want to take. <a href=\"https:\/\/minikube.sigs.k8s.io\/docs\/\" target=\"_blank\" rel=\"noreferrer noopener\">Minikube<\/a> is a lightweight tool used to implement a simple Kubernetes cluster 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=\"#kubernetes-concepts\">Kubernetes Concepts<\/a><\/li><li><a href=\"#install-minikube-on-ubuntu-24-04\">Install Minikube on Ubuntu 24.04<\/a><ul><li><a href=\"#prerequisites\">Prerequisites<\/a><ul><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=\"#install-minikube\">Install Minikube<\/a><\/li><li><a href=\"#start-minikube\">Start 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><li><a href=\"#further-reading\">Further Reading<\/a><\/li><li><a href=\"#other-tutorials\">Other Tutorials;<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"kubernetes-concepts\">Kubernetes Concepts<\/h2>\n\n\n\n<p>If you are getting started with Kubernetes, you can have a look at the core Kubernetes concepts by following the link below.<\/p>\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<h2 class=\"wp-block-heading\" id=\"install-minikube-on-ubuntu-24-04\">Install Minikube on Ubuntu 24.04<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h3>\n\n\n\n<p>Below is a list of some of the hardware and software requirements for running Minikube on Ubuntu.<\/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\u00a0Docker,\u00a0QEMU,\u00a0Hyperkit,\u00a0Hyper-V,\u00a0KVM,\u00a0Parallels,\u00a0Podman,\u00a0VirtualBox, or\u00a0VMware Fusion\/Workstation.<\/p>\n\n\n\n<p>You can check how to install Docker, VirtualBox or KVM on Ubuntu 24.04 by following the links below;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-install-docker-on-ubuntu-24-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install Docker CE on Ubuntu 24.04<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-virtualbox-7-on-ubuntu-24-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install VirtualBox 7 on Ubuntu 24.04<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-install-kvm-on-ubuntu-24-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install KVM on Ubuntu 24.04<\/a><\/p>\n\n\n\n<p>In this tutorial, we will use Docker driver with 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>Minikube ships with <strong>kubectl<\/strong> integrated already (<strong>minikube kubectl &#8212; &lt;kubectl command line options><\/strong>).<\/p>\n\n\n\n<p>While this is not entirely necessary, you can just install it by running the commands below.<\/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>clientVersion:\n  buildDate: \"2023-10-18T11:42:52Z\"\n  compiler: gc\n  gitCommit: a8a1abc25cad87333840cd7d54be2efaf31a3177\n  gitTreeState: clean\n  gitVersion: v1.28.3\n  goVersion: go1.20.10\n  major: \"1\"\n  minor: \"28\"\n  platform: linux\/amd64\nkustomizeVersion: v5.0.4-0.20230601165947-6ce0bf390ce3\n<\/code><\/pre>\n\n\n\n<p>As already mentioned, you can use the kubectl that ships with Minikube<\/p>\n\n\n\n<p>(<strong>Run the command after installing Minikube<\/strong>)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube kubectl -- version --client -o yaml<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-minikube\">Install Minikube<\/h3>\n\n\n\n<p>You can easily install Minikube by running the command;<\/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>Confirm the installation by checking the version of installed Minikube;<\/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.32.0\ncommit: 8220a6eb95f0a4d75f7f2d7b14cef975f050512d<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"start-minikube\">Start 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 minikube control plane node in cluster.<\/li>\n\n\n\n<li>Pulls the base images required to create a simple 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 (VirtualBox is used as the default Minikube driver)<\/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>itnixpro@noble-numbat:~$ minikube start --driver=docker\n\ud83d\ude04  minikube v1.32.0 on Ubuntu 24.04\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.28.3 preload ...\n    > preloaded-images-k8s-v18-v1...:  403.35 MiB \/ 403.35 MiB  100.00% 34.57 M\n    > gcr.io\/k8s-minikube\/kicbase...:  453.90 MiB \/ 453.90 MiB  100.00% 38.19 M\n\ud83d\udd25  Creating docker container (CPUs=2, Memory=2200MB) ...\n\ud83d\udc33  Preparing Kubernetes v1.28.3 on Docker 24.0.7 ...\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: default-storageclass, storage-provisioner\n\ud83d\udca1  kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'\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>minikube\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>The Minikube simple kubernetes cluster is now up!<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"minikube-ssh-login\">Minikube SSH Login<\/h4>\n\n\n\n<p>Just like how you would login to a docker container with <strong>docker exec -it<\/strong>, command, you can SSH into <strong>Minikube<\/strong> container 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>CONTAINER ID   IMAGE                       COMMAND                  CREATED          STATUS          PORTS     NAMES\n887b10137478   6e38f40d628d                \"\/storage-provisioner\"   13 minutes ago   Up 13 minutes             k8s_storage-provisioner_storage-provisioner_kube-system_229d2576-be37-45f4-8e2b-914b97e6a531_1\n12cbc1a0d610   ead0a4a53df8                \"\/coredns -conf \/etc\u2026\"   13 minutes ago   Up 13 minutes             k8s_coredns_coredns-5dd5756b68-nb75b_kube-system_449d5ef3-ff4e-4376-912b-8bb3d5694b34_0\n0a3f880da164   bfc896cf80fb                \"\/usr\/local\/bin\/kube\u2026\"   13 minutes ago   Up 13 minutes             k8s_kube-proxy_kube-proxy-fj4hh_kube-system_b508788b-d5e7-470a-a1e1-607bfc68bd13_0\n676bca7c2953   registry.k8s.io\/pause:3.9   \"\/pause\"                 13 minutes ago   Up 13 minutes             k8s_POD_coredns-5dd5756b68-nb75b_kube-system_449d5ef3-ff4e-4376-912b-8bb3d5694b34_0\n38783b3dc7dc   registry.k8s.io\/pause:3.9   \"\/pause\"                 13 minutes ago   Up 13 minutes             k8s_POD_kube-proxy-fj4hh_kube-system_b508788b-d5e7-470a-a1e1-607bfc68bd13_0\neb9c9724e81a   registry.k8s.io\/pause:3.9   \"\/pause\"                 13 minutes ago   Up 13 minutes             k8s_POD_storage-provisioner_kube-system_229d2576-be37-45f4-8e2b-914b97e6a531_0\nd95f881c9586   537434729123                \"kube-apiserver --ad\u2026\"   14 minutes ago   Up 14 minutes             k8s_kube-apiserver_kube-apiserver-minikube_kube-system_55b4bbe24dac3803a7379f9ae169d6ba_0\n3b283c57d7e7   10baa1ca1706                \"kube-controller-man\u2026\"   14 minutes ago   Up 14 minutes             k8s_kube-controller-manager_kube-controller-manager-minikube_kube-system_7da72fc2e2cfb27aacf6cffd1c72da00_0\n40f7c0407d98   73deb9a3f702                \"etcd --advertise-cl\u2026\"   14 minutes ago   Up 14 minutes             k8s_etcd_etcd-minikube_kube-system_9aac5b5c8815def09a2ef9e37b89da55_0\nc5046b7d378d   6d1b4fd1b182                \"kube-scheduler --au\u2026\"   14 minutes ago   Up 14 minutes             k8s_kube-scheduler_kube-scheduler-minikube_kube-system_75ac196d3709dde303d8a81c035c2c28_0\n55bae56fd1cf   registry.k8s.io\/pause:3.9   \"\/pause\"                 14 minutes ago   Up 14 minutes             k8s_POD_kube-controller-manager-minikube_kube-system_7da72fc2e2cfb27aacf6cffd1c72da00_0\n5f8a2f23d88e   registry.k8s.io\/pause:3.9   \"\/pause\"                 14 minutes ago   Up 14 minutes             k8s_POD_kube-apiserver-minikube_kube-system_55b4bbe24dac3803a7379f9ae169d6ba_0\nb8b3522d0385   registry.k8s.io\/pause:3.9   \"\/pause\"                 14 minutes ago   Up 14 minutes             k8s_POD_etcd-minikube_kube-system_9aac5b5c8815def09a2ef9e37b89da55_0\nbb8d527c26a5   registry.k8s.io\/pause:3.9   \"\/pause\"                 14 minutes ago   Up 14 minutes             k8s_POD_kube-scheduler-minikube_kube-system_75ac196d3709dde303d8a81c035c2c28_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>REPOSITORY                                TAG       IMAGE ID       CREATED         SIZE\nregistry.k8s.io\/kube-apiserver            v1.28.3   537434729123   5 months ago    126MB\nregistry.k8s.io\/kube-controller-manager   v1.28.3   10baa1ca1706   5 months ago    122MB\nregistry.k8s.io\/kube-scheduler            v1.28.3   6d1b4fd1b182   5 months ago    60.1MB\nregistry.k8s.io\/kube-proxy                v1.28.3   bfc896cf80fb   5 months ago    73.1MB\nregistry.k8s.io\/etcd                      3.5.9-0   73deb9a3f702   10 months ago   294MB\nregistry.k8s.io\/coredns\/coredns           v1.10.1   ead0a4a53df8   13 months ago   53.6MB\nregistry.k8s.io\/pause                     3.9       e6f181688397   17 months ago   744kB\ngcr.io\/k8s-minikube\/storage-provisioner   v5        6e38f40d628d   3 years ago     31.5MB\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>TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE\nImages          8         8         752.4MB   4.057MB (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<p>Exit when done;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>exit<\/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<p>Get Kubernetes cluster information;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube kubectl -- cluster-info<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>    > kubectl.sha256:  64 B \/ 64 B [-------------------------] 100.00% ? p\/s 0s\n    > kubectl:  47.56 MiB \/ 47.56 MiB [----------] 100.00% 197.12 MiB p\/s 400ms\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<p>Lists all the nodes in the current namespace.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube kubectl -- get nodes<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>NAME       STATUS   ROLES           AGE   VERSION\nminikube   Ready    control-plane   17m   v1.28.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>minikube kubectl -- get services<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE\nkubernetes   ClusterIP   10.96.0.1    <none>        443\/TCP   18m\n<\/code><\/pre>\n\n\n\n<p>You can run other commands as you wish.<\/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>minikube 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>minikube 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<\/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>minikube 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>minikube 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>minikube 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>minikube 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 kubectl -- 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 Ubuntu 24.04\" 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>minikube 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 Ubuntu 24.04\" 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>minikube kubectl -- get services --all-namespaces<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>NAMESPACE              NAME                        TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                  AGE\ndefault                kubernetes                  ClusterIP   10.96.0.1        <none>        443\/TCP                  27m\nkube-system            kube-dns                    ClusterIP   10.96.0.10       <none>        53\/UDP,53\/TCP,9153\/TCP   27m\nkube-system            metrics-server              ClusterIP   10.109.17.235    <none>        443\/TCP                  4m9s\nkubernetes-dashboard   dashboard-metrics-scraper   ClusterIP   10.109.191.202   <none>        8000\/TCP                 3m56s\nkubernetes-dashboard   kubernetes-dashboard        ClusterIP   10.110.150.153   <none>        80\/TCP                   3m56s\n<\/code><\/pre>\n\n\n\n<p>To access the dashboard externally;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube 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 data-wp-context=\"{&quot;uploadedSrc&quot;:&quot;https:\\\/\\\/kifarunix.com\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/minikube-dashboard.png&quot;,&quot;figureClassNames&quot;:&quot;wp-block-image size-full&quot;,&quot;figureStyles&quot;:null,&quot;imgClassNames&quot;:&quot;wp-image-17376&quot;,&quot;imgStyles&quot;:null,&quot;targetWidth&quot;:1885,&quot;targetHeight&quot;:923,&quot;scaleAttr&quot;:false,&quot;ariaLabel&quot;:&quot;Enlarge image: Install Minikube on Ubuntu 24.04&quot;,&quot;alt&quot;:&quot;Install Minikube on Ubuntu 24.04&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1885\" height=\"923\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/minikube-dashboard.png\" alt=\"Install Minikube on Ubuntu 24.04\" 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\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge image: Install Minikube on Ubuntu 24.04\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"context.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"context.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/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>Or;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>minikube delete --all --purge<\/code><\/pre>\n\n\n\n<p>And that concludes our guide on how to install Minikube on Ubuntu 24.04.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"further-reading\">Further Reading<\/h3>\n\n\n\n<p>Read more on getting started with <a href=\"https:\/\/minikube.sigs.k8s.io\/docs\/start\/\" target=\"_blank\" rel=\"noreferrer noopener\">Minikube<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"other-tutorials\">Other Tutorials;<\/h3>\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>If you are planning on getting started with Kubernetes, then installing Minikube on Ubuntu 24.04 might be the first step you want to take. Minikube<\/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":[7431,7432],"class_list":["post-22010","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-containers","category-docker","category-howtos","category-kubernetes","tag-install-minikube-on-ubuntu-24-04","tag-minibute-install-ubuntu","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\/22010"}],"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=22010"}],"version-history":[{"count":3,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/22010\/revisions"}],"predecessor-version":[{"id":22013,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/22010\/revisions\/22013"}],"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=22010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=22010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=22010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}