🦉
Programming Notes
  • My Programming Notes
  • CKA Exam Preparation
    • Certified Kubernetes Administrator
    • Setup Minikube
    • Network Design Principles
    • Role-Based Access Control (RBAC)
    • Namespace
    • Resource Quota
    • Pod
    • Deployment
    • Deployment: Rollout
    • ConfigMap
    • Service
    • Service: kubectl expose
    • Pod: Resources Management
    • Pod & Container: Quality of Service Class
    • Pod & Container: Probes
    • Limit Range
    • Scaling: Manual
    • Scaling: Horizontal Pod Autoscaler
    • Persistent Volume & Claim
    • Secret
    • Ingress: Routing
    • Ingress: TLS
    • Ingress: Rate Limit
    • Ingress: Basic Auth
    • Ingress: CRD (Custom Resource Definition)
    • Job
    • CronJob
    • Mutli-Node Cluster
  • Golang
    • Generics
    • Context
    • Goroutines and Channels in Go
    • Goroutine: Concurrency vs Parallelism
    • Goroutine: Performance & Tradeoffs
    • JSON: omitzero
  • Rust
    • Arrays & Slices
    • Closures
    • Generics & Traits
    • Iterators
    • Run Code Simultaneously
    • String vs &str
    • Tests
    • Rustlings Exercises
      • Variables
      • Functions
      • If
      • Primitive Types
      • Vectors
      • Move Semantics
      • Structs
      • Enums and Matching Pattern
      • Strings
      • Modules
      • Hashmaps
      • Options
      • Error Handling
      • Generics
      • Traits
      • Lifetimes
      • Tests
      • Iterators
      • Smart Pointers
      • Threads
      • Macros
      • Quiz 1
      • Quiz 2
      • Quiz 3
  • Software Engineering
    • CAP Theorem
    • Circuit Breaker
    • Decoupling
    • GraphQL: Query Caching
    • HMAC Signature
    • Idempotency
    • Monolith VS Microservice
    • OWASP Top 10 2021
    • PCI DSS
    • PostgreSQL: Partitioning
    • PostgreSQL: Replication
    • Protobuf & gRPC
    • Redis: Streams
    • Resource Scaling
    • Signed URL
    • SOLID
    • Stack VS Heap
    • Stateful VS Stateless
  • Site Reliability Engineering
    • Chaos Engineering
    • Distributed Tracing
    • Kubernetes (k8s)
    • SLA, SLO, and SLI Metrics
    • Site Reliability Engineer
  • Others
    • FFMPEG Cheat sheet
Powered by GitBook
On this page
  • Start and Configure a Kubernetes Cluster
  • Start Minkube
  • View Cluster Configuration
  • Add/Remove Nodes
  • References
  1. CKA Exam Preparation

Setup Minikube

PreviousCertified Kubernetes AdministratorNextNetwork Design Principles

Last updated 3 months ago

We will use minikube in to run kubernetes cluster in your local machine. You can download and install minikube from their official website: .

Start and Configure a Kubernetes Cluster

Start Minkube

minikube start --kubernetes-version=v1.31.0 --cpus=2 --memory=4096
  • This starts a cluster with 2 CPUs and 4GB of memory, running Kubernetes version 1.31.0.

  • You can check the cluster status: kubectl cluster-info

  • Which should return below information:

Kubernetes control plane is running at https://127.0.0.1:57821
CoreDNS is running at https://127.0.0.1:57821/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

View Cluster Configuration

Check Node information.

kubectl get nodes
kubectl describe node minikube

List system components of kubernetes such as API Server, Scheduler, Controller Manager, CoreDNS, etc.

kubectl get pods -n kube-system

Above command should return you list like below.

NAME                               READY   STATUS    RESTARTS      AGE
coredns-6f6b679f8f-88xz9           1/1     Running   0             24m
etcd-minikube                      1/1     Running   0             24m
kube-apiserver-minikube            1/1     Running   0             24m
kube-controller-manager-minikube   1/1     Running   0             24m
kube-proxy-zxlvw                   1/1     Running   0             24m
kube-scheduler-minikube            1/1     Running   0             24m
storage-provisioner                1/1     Running   1 (24m ago)   24m

Add/Remove Nodes

Although Minikube is single-node by default, simulate multi-node behavior using Minikube profiles. Here's how to add a new Node in minikube.

minikube node add

Get list of nodes again using kubectl get nodes and it should return newly added nodes.

NAME           STATUS   ROLES           AGE   VERSION
minikube       Ready    control-plane   32m   v1.31.0
minikube-m02   Ready    <none>          17s   v1.31.0

Removing a Node.

minikube node delete minikube-m02

References

https://minikube.sigs.k8s.io/docs/
https://minikube.sigs.k8s.io/docs/tutorials/multi_node/