cluster-api-provider-bke:基于 Cluster API 的基础设施 Provider 项目

基于Cluster API管理k8s的provider,同时具有额外的K8s⽣态组件部署功能

分支36Tags8
文件最后提交记录最后更新时间
9 天前
4 个月前
9 天前
22 天前
1 个月前
5 天前
1 个月前
1 年前
21 天前
5 天前
1 个月前
22 天前
1 个月前
22 天前
3 个月前
13 天前
1 年前
4 个月前
28 天前
6 个月前
4 个月前
1 个月前
6 个月前
1 个月前
1 个月前
23 天前
23 天前

cluster-api-provider-bke

  • bke部署核心组件,作为基础设施provider。
  • bkeagent组件是运行在各个节点的二进制文件,由systemd托管,负责监听kube-apiserver的crd资源,进而对宿主机进行操作。

bkeagent二进制文件存放于cluster-api-provider-bke镜像中,路径为/bkeagent_linux_${ARCH}。cluster-api-provider-bke镜像包含双架构的bkeagent。

镜像构建

构建参数

  • GOPRIVATE:配置Go语言私有仓库,等同于GOPRIVATE环境变量。
  • COMMIT:当前git commit的哈希值。
  • VERSION:组件版本。
  • SOURCE_DATE_EPOCH:镜像rootfs的时间戳。

构建命令

  • 构建并推送到指定OCI仓库。

    使用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)
    
    使用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)
    

    其中,<path/to/dockerfile>为Dockerfile路径,<oci/repository>为镜像地址,<tag>为镜像tag。

  • 构建并导出OCI Layout到本地tarball。

    使用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)
    
    使用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)
    

    其中,<path/to/dockerfile>为Dockerfile路径,<oci/repository>为镜像地址,<tag>为镜像tag,path/to/oci-layout.tar为tar包路径。

  • 构建并导出镜像rootfs到本地目录。

    使用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
    
    使用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
    

    其中,<path/to/dockerfile>为Dockerfile路径,path/to/output为本地目录路径。

部署

参考:https://docs.openfuyao.cn/zh

项目介绍

基于Cluster API管理k8s的provider,同时具有额外的K8s⽣态组件部署功能

定制我的领域