InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Mac tutorials

  • Brew
  • Chrome enable webgl on old macbooks
  • How to change computer display name on Mac
  • How to change default system voice for text-to-speech on Mac
  • How to install drupal on Mac usin MAMP
  • How to remove hard drive icon from mac desktop
  • How to use rrdtool plot traffic from network interface
  • How to view your WiFi password on Mac
  • Mac - change desktop icons size
  • Mac - how to take timed screenshot
  • Mac - how to always show scroll bar
  • Mac - how to change default location for screenshots
  • Mac - how to open apps not from App Store
  • Mac - how to take screenshots
  • Mac - how to use kubernetes with Lima-VM
  • Mac - kubernetes minikube - create deployment
  • Mac - make spotlight search faster
  • Mac - show volume icon on menu bar
  • Mac Command Line
  • Mac Finder
  • Mac Preview
  • Mac m1 - How to Install Kubernetes with kind
  • Mac m1 - How to Install Kubernetes with minikube
  • Mac m1 - minikube - create multi node kubernetes cluster
  • Mac podman quick start guide
  • NestJS Quick start tutorial on Mac
  • NextJS Quick start tutorial on Mac
  • Vagarant quick start guide on Mac
  • Windows on Mac
  • minikube kubernetes - create deployment with multiple replica and load balancer
  • minikube kubernetes - how to access service IP endpoint using curl
  • minikube kubernetes - how to access specific pod IP endpoint using curl
 
  • Home
  • > Tutorials
  • > Mac

minikube kubernetes – create deployment with multiple replica and load balancer

on Dec 13, 2022

This tutorial assumers that minikube kubernetes is already installed. Steps to create a deployment with 3 replicas and load balancer:

  1. Start a cluster with 2 nodes (1 node also ok):
    minikube start --nodes 2
  2. create minikube tunnel to support external access
    minikube tunnel
  3. create deployment with 3 replicas
    kubectl create deployment hello-minikube --image=kicbase/echo-server:1.0 --replicas=3
  4. Expose deployment (type loadBalancer)
    kubectl expose deployment hello-minikube --type=LoadBalancer --port=8080
  5. View the service detail
    kubectl get services hello-minikube
  6. Get yaml file of deployment
    kubectl get deploy hello-minikube -o yaml
  7. Print the external service url and port
    kubectl get svc
    NAME             TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
    hello-minikube   LoadBalancer   10.106.211.74   127.0.0.1     8080:31806/TCP   6m36s
    kubernetes       ClusterIP      10.96.0.1       <none>        443/TCP          9m50s
  8. access the service
    curl http://127.0.0.1:8080/
    Request served by hello-minikube-7ddcbc9b8b-b94pq
    
    HTTP/1.1 GET /
    
    Host: 127.0.0.1:8080
    Accept: */*
    User-Agent: curl/7.84.0

    You can run above multiple time and you should get different pods in response.
  9. One alternative to using tunnel above it exposing service url using service command
    minikube service hello-minikube --url
    😿  service default/kubernetes has no node port
    http://127.0.0.1:61762
    ❗  Because you are using a Docker driver on darwin, the terminal needs to be open to run it.

    You can run curl on above url multiple time and you should get different pods in response.

Suggested posts:

  1. Mac m1 – How to Install Kubernetes with minikube
  2. Linux – find top directories by used disk size (excluding size of subdirectories)
  3. minikube kubernetes – how to access specific pod IP endpoint using curl
  4. Mac – kubernetes minikube – create deployment
  5. Mac m1 – How to Install Kubernetes with kind
  6. Mac docker – create getting-started image and run container using it
  7. Mac – docker sample – single container dev env – quick start
  8. Mac podman quick start guide
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Kubernetes, Mac
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress