Logging Extension Component

Feature Introduction

  • Efficient log collection and management capabilities

    Supports users to perform real-time log data collection and query for various services and containers according to custom filtering conditions. Custom filtering conditions include but are not limited to namespace, service name, container name, keywords, filtering time, log collection path file name, and log type level. Users can combine multiple conditions by themselves to achieve precise query capabilities.

  • Precise log positioning capabilities

    Supports users to precisely locate all logs within a fine-grained time span after selecting a specific log source (such as a specific container, specific log path, etc.). Provides context log query function through custom time, enabling users to query context logs according to their own needs after locating a key log.

  • Diverse log collection capabilities

    Supports users to set log collection paths to achieve collection of logs generated by user-defined applications. Add log collection sources without changing default configuration. Users can customize log collection work, allowing log collection components to collect logs at user-specified paths, and perceive the application's logs through the specific "path + file name" method in the query interface.

  • Sensitive log alerting capabilities

    Supports users to create log alert rules when installing the log component, and provides log alert rule templates and preset log alert rules. After the logs collected by the system trigger the alert rule, the alert will be sent to the alert component, achieving a one-stop fault detection system of log monitoring + alerting + positioning.

  • Log export/download capabilities

    Supports users to export log content they want to save in the log component. The current version supports users to export filtered result logs after performing a series of filtering operations, and supports users to obtain detailed logs of a single container through time filtering in the log details interface.

Implementation Principles

The log component, as an ecological extension component of openFuyao, consists of three parts: log backend layer, log UI layer, and open source software layer.

  • Log Backend Layer

    The logging-operator backend is deployed in the cluster as a microservice. The backend component provides log query and filtering interfaces, log collection group source query interfaces, log alert rule query interfaces, log collection work CRUD interfaces, log details context query interfaces, etc., providing core capabilities for the log extension component.

    The backend processing logic of logging-operator is to receive the foreground call request, create the query statement LogQL used by the Loki component according to the specific request content, and splice this LogQL into a query request calling the Loki http interface, thereby obtaining the query and filtering results in Loki. Then perform operations such as splicing according to the specific return logic, and finally return to the original call interface. The configuration function of the collection source is achieved by calling the k8s client go interface to perform CRUD operations on k8s cluster resources.

  • Log UI Layer

    The log frontend UI component is deployed independently in the openFuyao platform as an extensible pluggable component. After the UI interface is installed and deployed in the openFuyao platform, the log part of the interface will be automatically integrated in the sidebar tool navigation bar of fuyao-website. Users can directly select the use of the log component through the left tree menu navigation bar of the platform management interface. When the openFuyao platform is not installed in the cluster, the log UI can also be deployed as an independent log application integrated with the log backend and log open source software. In this case, the log UI layer is an independent interface.

  • Log Open Source Software Layer

    The log open source software mainly provides underlying support capabilities for the log system, mainly composed of log collection component (promtail) and log storage component (Loki). The log collection component is deployed on each node in the form of daemonset, and sends logs in the collection source to the log storage component according to collection rules. The log storage component Loki receives the http interface, executes the query statement in the log database and gives the query results.

Security Capability Statement

openFuyao v26.06 and earlier versions only offer foundational security. Users and integration partners must manually adapt and harden security measures—such as inter-service mTLS and component-level RBAC—to their deployment environments (e.g., by integrating cert-manager, unifying certificates, deploying auth middleware, or restricting traffic via NetworkPolicy). As current development prioritizes core functionality delivery, users are responsible for enhancing their own security defenses. Advanced security capabilities will be incrementally planned and rolled out in future releases.

Installation

Reference: https://docs.openfuyao.cn/docs

Local Build

Image Build

Build Parameters

  • GOPRIVATE: Configure Go language private repository, equivalent to the GOPRIVATE environment variable.
  • COMMIT: Hash value of the current git commit.
  • VERSION: Component version.
  • SOURCE_DATE_EPOCH: Timestamp of the image rootfs.

Build Commands

  • Build and push to specified OCI repository.

    Using docker
    docker buildx build . -f <path/to/dockerfile> \
        -o type=image,name=<oci/repository>:<tag>,oci-mediatypes=true,rewrite-timestamp=true,push=true \
        --platform=linux/amd64,linux/arm64 \
        --provenance=false \
        --build-arg=GOPRIVATE=gopkg.openfuyao.cn \
        --build-arg=COMMIT=$(git rev-parse HEAD) \
        --build-arg=VERSION=0.0.0-latest \
        --build-arg=SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
    
    Using nerdctl
    nerdctl build . -f <path/to/dockerfile> \
        -o type=image,name=<oci/repository>:<tag>,oci-mediatypes=true,rewrite-timestamp=true,push=true \
        --platform=linux/amd64,linux/arm64 \
        --provenance=false \
        --build-arg=GOPRIVATE=gopkg.openfuyao.cn \
        --build-arg=COMMIT=$(git rev-parse HEAD) \
        --build-arg=VERSION=0.0.0-latest \
        --build-arg=SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
    

    Where <path/to/dockerfile> is the Dockerfile path, <oci/repository> is the image address, and <tag> is the image tag.

  • Build and export OCI Layout to local tarball.

    Using docker
    docker buildx build . -f <path/to/dockerfile> \
        -o type=oci,name=<oci/repository>:<tag>,dest=<path/to/oci-layout.tar>,rewrite-timestamp=true \
        --platform=linux/amd64,linux/arm64 \
        --provenance=false \
        --build-arg=GOPRIVATE=gopkg.openfuyao.cn \
        --build-arg=COMMIT=$(git rev-parse HEAD) \
        --build-arg=VERSION=0.0.0-latest \
        --build-arg=SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
    
    Using nerdctl
    nerdctl build . -f <path/to/dockerfile> \
        -o type=oci,name=<oci/repository>:<tag>,dest=<path/to/oci-layout.tar>,rewrite-timestamp=true \
        --platform=linux/amd64,linux/arm64 \
        --provenance=false \
        --build-arg=GOPRIVATE=gopkg.openfuyao.cn \
        --build-arg=COMMIT=$(git rev-parse HEAD) \
        --build-arg=VERSION=0.0.0-latest \
        --build-arg=SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
    

    Where <path/to/dockerfile> is the Dockerfile path, <oci/repository> is the image address, <tag> is the image tag, and path/to/oci-layout.tar is the tar package path.

  • Build and export image rootfs to local directory.

    Using docker
    docker buildx build . -f <path/to/dockerfile> \
        -o type=local,dest=<path/to/output>,platform-split=true \
        --platform=linux/amd64,linux/arm64 \
        --provenance=false \
        --build-arg=GOPRIVATE=gopkg.openfuyao.cn \
        --build-arg=COMMIT=$(git rev-parse HEAD) \
        --build-arg=VERSION=0.0.0-latest
    
    Using nerdctl
    nerdctl build . -f <path/to/dockerfile> \
        -o type=local,dest=<path/to/output>,platform-split=true \
        --platform=linux/amd64,linux/arm64 \
        --provenance=false \
        --build-arg=GOPRIVATE=gopkg.openfuyao.cn \
        --build-arg=COMMIT=$(git rev-parse HEAD) \
        --build-arg=VERSION=0.0.0-latest
    

    Where <path/to/dockerfile> is the Dockerfile path and path/to/output is the local directory path.

Helm Chart Build

  • Package Helm Chart.

    helm package <path/to/chart> -u \
        --version=0.0.0-latest \
        --app-version=openFuyao-v25.09
    

    Where <path/to/chart> is the Chart folder path.

  • Push Chart package to specified OCI repository.

    helm push <path/to/chart.tgz> oci://<oci/repository>:<tag>
    

    Where <path/to/chart.tgz> is the Chart package path, <oci/repository> is the Chart package push address, and <tag> is the Chart package tag.