Bookandmusic DevOps and Linux Documentation

website·Indexed 31 days ago

https://bookandmusic.cn

A comprehensive technical guide covering DevOps tools and Linux system administration. Includes detailed tutorials on Kubernetes (kubeadm, Minikube, Pods, Services, and Dashboard), Docker (buildx, Compose, Portainer, and image management), Ansible (automation, variables, and modules), Nginx, Git, and Linux system resource management including LVM, RAID, and quota.

Tokens
91.4K
Snippets
464
Records
616
Agent score
50%

What's inside Bookandmusic

  1. Overview of Kubernetes Service and kube-proxy

    A Kubernetes Service provides a stable virtual IP address (Cluster IP) and a unified entry point to aggregate and access multiple Pods that provide the same service. Because Pod IPs are dynamic and unstable, Services ensure consistent connectivity. The actual traffic routing is implemented by the kube-proxy process running on every node, which monitors the API server for Service changes and converts them into network routing rules on the host.
  2. Overview of Portainer Docker Management Tool

    Portainer is a lightweight management tool that provides a graphical web interface for Docker environments. Key capabilities include:

    • Container Management: Create, start, stop, restart, and delete containers; view logs and access the console.
    • Image Management: View local images, pull from Docker Hub or other registries, and manage image tags.
    • Network & Volume Management: Configure Docker networks and storage volumes.
    • Orchestration Support: Supports Docker, Docker Swarm, and Kubernetes (via CE and BE versions).
    • Docker Compose: Deploy and manage applications using Compose files.
    • Security: User authentication and fine-grained role-based access control (RBAC).
    • Data Protection: Backup and recovery for container and environment data.
  3. Overview of Multipass VM Manager

    Multipass is an open-source lightweight virtual machine manager by Canonical that allows users to quickly launch and manage Ubuntu Linux instances. It uses different virtualization technologies based on the host OS: KVM on Linux, Hyper-V on Windows, and HyperKit on macOS.
  4. Overview of RAID Levels and Characteristics

    RAID (Redundant Array of Independent Disks) combines multiple physical disks into a single logical unit to improve performance and/or data reliability. Different RAID levels offer different trade-offs between capacity, read/write speed, and fault tolerance.
  5. Overview of Kubernetes Pod Controllers

    Kubernetes Pods are categorized into two types based on how they are created:

    1. Standalone Pods: Created directly; they are not recreated if deleted.
    2. Controller-managed Pods: Created via a controller; they are automatically recreated if deleted to maintain the desired state.

    Common Pod controllers include:

    • ReplicaSet: Maintains a stable set of replica Pods and supports scaling and image updates.
    • Deployment: Manages ReplicaSets to provide rolling updates and version rollbacks.
    • Horizontal Pod Autoscaler (HPA): Automatically adjusts Pod counts based on cluster load.
    • DaemonSet: Ensures a copy of a Pod runs on all (or specified) Nodes.
    • Job: Executes a one-time task and exits upon completion.
    • CronJob: Manages periodic tasks.
    • StatefulSet: Manages stateful applications.
  6. Overview of docker manifest for multi-platform images

    docker manifest is a Docker command used to manage images across different operating systems and hardware architectures. It allows users to create a 'manifest list'—a virtual Docker image that acts as a wrapper for multiple actual images, each corresponding to a specific architecture. When a user runs docker pull or docker run on a manifest list, Docker automatically selects the image that matches the host's architecture.
  7. Overview of Linux Disk Quotas

    Disk quotas are used in multi-user Linux environments to prevent a small number of users from consuming all available disk space, which would hinder other users' ability to work.

    Key Constraints:

    • Quotas are applied to an entire filesystem.
    • The Linux kernel must support quotas.
    • Quotas typically only affect regular users (not the root user).
  8. Overview of Linux cgroups Resource Control

    cgroups (control groups) is a Linux kernel mechanism used to limit, account for, and isolate the resource usage (CPU, memory, disk I/O, etc.) of individual processes or groups of processes. It is a foundational technology for lightweight containers like Docker. Developers can use cgroups to ensure critical services have guaranteed resources by restricting non-critical processes.
  9. Inspect CPU information

    CPU details can be retrieved via dedicated commands or by reading the system's virtual filesystem.

    • lscpu: Displays a comprehensive summary of CPU architecture, model, cores, and threads.
    • /proc/cpuinfo: A virtual file containing detailed per-processor information. Use grep to filter for specific attributes like the model name.
    # Summary view
    lscpu
    
    # Detailed view
    cat /proc/cpuinfo
    
    # Filter for model name
    grep "model name" /proc/cpuinfo
  10. Build platform-specific Docker images

    Use the --platform flag with docker build to specify the target architecture. For example, to build an image for amd64 or arm64, specify linux/amd64 or linux/arm64. After building, the image must be pushed to a registry (like Docker Hub) before it can be added to a manifest list.
    # Build for AMD64
    docker build --no-cache --platform=linux/amd64 -t <username>/<image-name>:<tag> .
    
    # Build for ARM64
    docker build --no-cache --platform=linux/arm64 -t <username>/<image-name>:<tag> .
    
    # Push to registry
    docker push <username>/<image-name>:<tag>
  11. Understand the Docker image build lifecycle

    The Docker ecosystem consists of three stages:

    1. Dockerfile: The 'raw material' script defining the environment, dependencies, and commands.
    2. Docker Image: The 'delivery product' created via docker build based on the Dockerfile.
    3. Docker Container: The 'runtime state' or instance of an image providing the actual service.

    Build Execution Flow:

    • Docker starts a container from a base image.
    • It executes a Dockerfile instruction to modify the container.
    • It commits the change as a new image layer.
    • It starts a new container based on that new layer and repeats until all instructions are processed.
  12. Understand Token-based Authentication vs Session Authentication

    Traditional session authentication is stateful; the server stores user session data (usually in memory) and sends a cookie to the client. This creates challenges with scalability (sticky sessions required for load balancers), memory overhead, and vulnerability to CSRF attacks.

    Token-based authentication is stateless. The server does not store session information. Instead, it issues a token to the client after successful authentication. The client sends this token in the request header for every subsequent request. This allows for easier horizontal scaling and better support for distributed systems.