🛡️
CTHFM: Kubernetes
  • Welcome
  • Kubernetes Fundamentals
    • Kubernetes Components
      • Kubernetes Master Node
      • Worker Nodes
      • Pods
      • Service
      • ConfigMaps and Secrets
      • Namespaces
      • Deployments
      • ReplicaSets
      • Jobs and CronJobs
      • Horizontal Pod Autoscaler (HPA)
      • Kubernetes Ports and Protocols
    • Kubectl
      • Installation and Setup
      • Basic Kubectl
      • Working With Pods
      • Deployments and ReplicaSets
      • Services and Networking
      • ConfigMaps and Secrets
      • YAML Manifest Management
      • Debugging and Troubleshooting
      • Kubectl Scripting: Security
      • Customizing Kubectl
      • Security Best Practices
      • Common Issues
      • Reading YAML Files
    • MiniKube
      • Intro
      • Prerequisites
      • Installation MiniKube
      • Starting MiniKube
      • Deploy a Sample Application
      • Managing Kubernetes Resources
      • Configuring MiniKube
      • Persistent Storage in Minikube
      • Using Minikube for Local Development
      • Common Pitfalls
      • Best Practices
  • Kubernetes Logging
    • Kubernetes Logging Overview
    • Audit Logs
    • Node Logs
    • Pod Logs
    • Application Logs
    • Importance of Logging
    • Types of Logs
    • Collecting and Aggregating Logs
    • Monitoring and Alerting
    • Log Parsing and Enrichment
    • Security Considerations in Logging
    • Best Practices
    • Kubernetes Logging Architecture
  • Threat Hunting
    • Threat Hunting Introduction
    • What Makes Kubernetes Threat Hunting Unique
    • Threat Hunting Process
      • Hypothesis Generation
      • Investigation
      • Identification
      • Resolution & Follow Up
    • Pyramid of Pain
    • Threat Frameworks
      • MITRE Containers Matrix
        • MITRE Att&ck Concepts
        • MITRE Att&ck Data Sources
        • MITRE ATT&CK Mitigations
        • MITRE Att&ck Containers Matrix
      • Microsoft Threat for Kubernetes
    • Kubernetes Behavioral Analysis and Anomaly Detection
    • Threat Hunting Ideas
    • Threat Hunting Labs
  • Security Tools
    • Falco
      • Falco Overview
      • Falco's Architecture
      • Runtime Security Explained
      • Installation and Setup
      • Falco Rules
      • Tuning Falco Rules
      • Integrating Falco with Kubernetes
      • Detecting Common Threats with Falco
      • Integrating Falco with Other Security Tools
      • Automating Incident Response with Falco
      • Managing Falco Performance and Scalability
      • Updating and Maintaining Falco
      • Real-World Case Studies and Lessons Learned
      • Labs
        • Deploying Falco on a Kubernetes Cluster
        • Writing and Testing Custom Falco Rules
        • Integrating Falco with a SIEM System
        • Automating Responses to Falco Alerts
    • Open Policy Agent (OPA)
      • Introduction to Open Policy Agent (OPA)
      • Getting Started with OPA
      • Rego
      • Advanced Rego Concepts
      • Integrating OPA with Kubernetes
      • OPA Gatekeeper
      • Policy Enforcement in Microservices
      • OPA API Gateways
      • Introduction to CI/CD Pipelines and Policy Enforcement
      • External Data in OPA
      • Introduction to Decision Logging
      • OPA Performance Monitoring
      • OPA Implementation Best Practices
      • OPA Case Studies
      • OPA Ecosystem
    • Kube-Bench
    • Kube-Hunter
    • Trivy
    • Security Best Practices and Documentation
      • RBAC Good Practices
      • Official CVE Feed
      • Kubernetes Security Checklist
      • Securing a Cluster
      • OWASP
  • Open Source Tools
    • Cloud Native Computing Foundation (CNCF)
      • Security Projects
  • Infrastructure as Code
    • Kubernetes and Terraform
      • Key Focus Areas for Threat Hunters
      • Infastructure As Code: Kubernetes
      • Infrastructure as Code (IaC) Basics
      • Infastructure As Code Essential Commands
      • Terraform for Container Orchestration
      • Network and Load Balancing
      • Secrets Management
      • State Management
      • CI/CD
      • Security Considerations
      • Monitoring and Logging
      • Scaling and High Availability
      • Backup and Disaster Recovery
    • Helm
      • What is Helm?
      • Helm Architecture
      • Write Helm Charts
      • Using Helm Charts
      • Customizing Helm Charts
      • Customizing Helm Charts
      • Building Your Own Helm Chart
      • Advanced Helm Chart Customization
      • Helm Repositories
      • Helm Best Practices
      • Helmfile and Continuous Integration
      • Managing Secrets with Helm and Helm Secrets
      • Troubleshooting and Debugging Helm
      • Production Deployments
      • Helm Case Studies
Powered by GitBook
On this page
  • Starting Minikube
  • 1. Initializing Your First Minikube Cluster
  • Step 1: Open Your Terminal or Command Prompt
  • Step 2: Start Minikube
  • Step 3: Monitor the Start Process
  • Step 4: Verify the Cluster is Running
  • 2. Exploring the Minikube Dashboard
  • Step 1: Launch the Dashboard
  • Step 2: Navigating the Dashboard
  • Step 3: Using the Dashboard to Manage Resources
  • 3. Basic Minikube Commands
  • 1. Status:
  • 2. SSH into Minikube:
  • 3. Managing Kubernetes Versions:
  • 4. Stopping and Pausing Minikube
  • 1. Stop Minikube:
  • 2. Pause Minikube:
  • 3. Resume Minikube:
  • 5. Deleting Minikube
  • 1. Delete Minikube:
  1. Kubernetes Fundamentals
  2. MiniKube

Starting MiniKube

Starting Minikube

In this lesson, we’ll cover how to start Minikube on your machine, explore the basics of interacting with your local Kubernetes cluster, and introduce the Minikube dashboard. By the end of this lesson, you will have a running Minikube cluster and a basic understanding of how to work with it.

1. Initializing Your First Minikube Cluster

Starting Minikube is a straightforward process, but there are a few options you can customize to suit your environment.

Step 1: Open Your Terminal or Command Prompt

  • Depending on your operating system, use your preferred terminal (e.g., PowerShell, Command Prompt, Terminal on macOS/Linux).

Step 2: Start Minikube

  • To start Minikube, simply run the following command:

    minikube start
    • Explanation:

      • This command will create and start a local Kubernetes cluster using the default settings. Minikube will automatically detect and use the best virtualization driver available on your system (e.g., Hyper-V, Docker, VirtualBox).

    • Customizing Your Cluster:

      • If you need to customize the resources allocated to the Minikube VM (like CPU, memory), you can do so with additional flags:

      minikube start --cpus=4 --memory=8192 --disk-size=50g
      • This example allocates 4 CPU cores, 8GB of memory, and 50GB of disk space to the Minikube VM.

Step 3: Monitor the Start Process

  • As Minikube starts, you’ll see output in your terminal that indicates the status of the cluster creation process. This includes downloading Kubernetes components, setting up the VM or container, and configuring the cluster.

Step 4: Verify the Cluster is Running

  • After Minikube has started, verify that your cluster is running correctly by using the following command:

    kubectl get nodes
    • Expected Output:

      • You should see a single node listed as Ready, which indicates that your Minikube cluster is up and running.

2. Exploring the Minikube Dashboard

Minikube comes with a built-in Kubernetes dashboard, which provides a user-friendly interface for managing and monitoring your cluster.

Step 1: Launch the Dashboard

  • To access the dashboard, run:

    minikube dashboard
    • Explanation:

      • This command will open the Kubernetes dashboard in your default web browser. The dashboard allows you to view and manage resources like Pods, Deployments, and Services, giving you a visual overview of your cluster’s health and activity.

Step 2: Navigating the Dashboard

  • Once the dashboard opens, you can explore various sections:

    • Workloads: View and manage your Pods, Deployments, ReplicaSets, Jobs, and more.

    • Services: Manage your Services and Ingress to control how applications are exposed.

    • Config and Storage: Explore ConfigMaps, Secrets, and Persistent Volume Claims.

    • Cluster: Monitor your cluster’s nodes, namespaces, and events.

    • Metrics: View resource usage and performance metrics for different components.

Step 3: Using the Dashboard to Manage Resources

  • You can use the dashboard to deploy applications, scale deployments, and manage the state of your cluster. The dashboard is a powerful tool for those who prefer a graphical interface over the command line.

3. Basic Minikube Commands

Minikube offers several commands that allow you to manage your cluster effectively. Here are a few key commands:

1. Status:

  • Check the status of your Minikube cluster:

    minikube status
    • This command will display information about the cluster, including the status of the Kubernetes components and the underlying VM or container.

2. SSH into Minikube:

  • SSH into the Minikube VM for deeper debugging or exploration:

    minikube ssh
    • This command opens an SSH session directly into the Minikube node, allowing you to interact with the VM’s file system and running processes.

3. Managing Kubernetes Versions:

  • Start Minikube with a specific version of Kubernetes:

    minikube start --kubernetes-version=v1.22.0
    • This command allows you to test your applications against different Kubernetes versions.

4. Stopping and Pausing Minikube

When you’re done working with your cluster, you can stop or pause Minikube to free up system resources.

1. Stop Minikube:

  • To stop the Minikube cluster without deleting it:

    minikube stop
    • This command shuts down the Minikube VM or container but keeps all your configurations and data intact.

2. Pause Minikube:

  • To pause Minikube, effectively putting it into a sleep state:

    minikube pause
    • This is useful if you want to temporarily halt the cluster without fully stopping it.

3. Resume Minikube:

  • To resume a paused Minikube cluster:

    minikube unpause

5. Deleting Minikube

If you need to completely remove the Minikube cluster:

1. Delete Minikube:

  • To delete the entire Minikube cluster:

    minikube delete
    • This command removes the Minikube VM or container, including all your data and configurations.

PreviousInstallation MiniKubeNextDeploy a Sample Application

Last updated 9 months ago