MicroShift Documentation

repository·main·Indexed 21 days ago

https://github.com/openshift/microshift

MicroShift is an optimized OpenShift Kubernetes distribution designed for edge computing and resource-constrained environments, featuring a lightweight, single-binary control plane and worker node. This documentation covers installation and benchmarking via Ansible, including configurations for clean RHEL hosts, development environments, and RHEL for Edge. It also details the nvidia-gpu-setup role for automating NVIDIA driver installation, CUDA toolkit setup, and the NVIDIA Device Plugin for Kubernetes on RHEL 9.x.

Tokens
246.5K
Snippets
676
Records
1.1K
Agent score
74%

What's inside MicroShift

  1. Overview of the endpointslice library

    main

    The endpointslice package provides a library for implementing the EndpointSlice reconciler. It is designed to support the EndpointSlices feature in Kubernetes.

    Note that this library is specifically designed for complex reconciliation logic; it is not currently used by the EndpointSlice Mirroring controller, which uses a simpler 1:1 mapping implementation between Services/Endpoints and EndpointSlices.

  2. What is included in client-go

    main

    The client-go library provides several packages for interacting with Kubernetes:

    • kubernetes: Contains the clientset used to access the standard Kubernetes API.
    • discovery: Used to discover which APIs are supported by a specific Kubernetes API server.
    • dynamic: Provides a dynamic client capable of performing generic operations on arbitrary Kubernetes API objects (useful when you don't want to depend on specific typed clients).
    • plugin/pkg/client/auth: Contains optional authentication plugins for obtaining credentials from external sources.
    • transport: Used to configure authentication and establish connections.
    • tools/cache: A utility package useful when writing Kubernetes controllers.
  3. Overview of k8s.io/streaming transport primitives

    main

    The k8s.io/streaming module provides Kubernetes HTTP streaming transport primitives. These utilities are shared across core Kubernetes components including CRI streaming, client-go, apiserver, and kubectl.

    Key capabilities include:

    • Generic stream upgrade negotiation
    • SPDY stream connections and round-tripping
    • WebSocket channel streaming helpers
  4. What is MicroShift

    main
    MicroShift is an optimized version of OpenShift Kubernetes designed specifically for small form factor and edge computing. It aims to provide a consistent OpenShift experience while catering to the unique constraints of edge environments, such as limited CPU, memory, network, and storage, and the need for seamless, secure updates without workload disruption.
  5. Overview of Pod Security Admission

    main

    Pod Security Admission provides the implementation for enforcing Pod Security Standards, which are a set of best-practice profiles for running pods securely.

    This project includes:

    • Codified profile definitions.
    • The PodSecurity admission controller (both as a library and a webhook) to enforce these standards.
    • Testing resources to validate that the standards are being enforced correctly.

    For detailed design information, refer to the Kubernetes enhancement proposal: KEP-2579.

  6. Use cli-runtime to create kubectl commands and plugins

    main
    The cli-runtime library provides a set of helpers designed for developers building Kubernetes clients that need to maintain compatibility with kubectl behavior. It is primarily used to implement kubectl commands and kubectl plugins by providing the necessary infrastructure to interact with Kubernetes API components in a way that mimics the standard CLI experience.
  7. Use the mount-utils interface for filesystem operations

    main

    The mount-utils package provides a standardized interface for mounting and unmounting filesystems, designed for use by Kubernetes and out-of-tree CSI (Container Storage Interface) components.

    Key capabilities include:

    • Mounting: Use the Mount function to mount a source to a target using a specific fstype and provided options.
    • Unmounting: Use the Unmount function to detach a filesystem from a target.
    • Listing: Use the List function to retrieve all currently mounted filesystems.
    • Path Discovery: Use GetMountRefs to find all mount references associated with a specific path.
  8. Use the GCE Load-Balancer Controller (GLBC) Cluster Addon

    main
    The GCE Load-Balancer Controller (GLBC) cluster addon provides a default 404 backend service and deployment. When running on Google Compute Engine (GCE), this addon is intended to be used with the Ingress-GCE controller to handle requests that do not match any existing Ingress rules, returning a 404 error via the provided service.
  9. Use csi-translation-lib to migrate PV sources

    main

    The csi-translation-lib provides utility functions for Kubernetes and out-of-tree CSI components (such as the external provisioner) to facilitate the migration of code from Kubernetes In-tree plugin code to CSI plugin repositories.

    Developers can use this library to translate Persistent Volume (PV) sources between formats using functions such as TranslateToCSI and TranslateToInTree.

  10. Use code-generator to implement Kubernetes-style API types

    main

    The code-generator library provides Golang tools to implement Kubernetes-style API types. It is primarily used for two purposes:

    1. CustomResourceDefinitions (CRDs): To build native, versioned clients, informers, and other helper utilities.
    2. User-provider API Servers: To build conversions between internal and versioned types, defaulters, protobuf codecs, and internal/versioned clients and informers.

    Recommended Usage: The current recommended way to use these generators is via the kube_codegen.sh script.

    # The recommended script to use for code generation
    ./kube_codegen.sh
  11. Enforce package import restrictions with import-boss

    main

    Purpose

    import-boss is a tool used to enforce optional import restrictions between packages. It is designed to manage dependency graphs in large repositories by preventing unauthorized or undesirable imports.

    How it works

    When a package is verified, import-boss searches for a .import-restrictions file in the package's directory and all parent directories (up to the module root defined by go.mod).

    1. Evaluation Order: Evaluation starts with the .import-restrictions file closest to the package.
    2. Rule Matching: If a rule in the closest file makes a determination (allow or forbid), evaluation stops.
    3. Fallback: If no rule matches, the tool consults the next-closest rules file in the parent directory.
    4. Default Behavior: If all rules files are exhausted without a determination, the import is flagged as an error.
    import-boss ./...