K8S 生态周报| 首个 Docker 官方 Action 发布

「K8S 生态周报」内容主要包含我所接触到的 K8S 生态相关的每周值得推荐的一些信息。欢迎订阅知乎专栏「k8s生态」git

首个 Docker 官方 GitHub Action 发布了

从去年 Docker 将企业服务相关的业务出售给 Mirantis 以后,Docker 将重心放在助力开发者体验上,并为此作了一系列的努力。 包括 1 月份发布了 Docker Desktop v2.2 ,提供了 WSL2 的新架构,以及新的交互式 Desktop Dashboard 等特性。github

本周又发布了首个 Docker GitHub Action,简化了 CI/CD 的流程。docker

这其实也是从另外一个角度来推动 DockerHub 的普及(比预期的晚了一些)。DockerHub 上一直都有构建 Docker 镜像的功能,但我我的感受体验并不够好,从通常意义上来讲,它不够灵活;另外我感受它的调度略慢了一点(虽然如今在优化中了)。visual-studio-code

但本次发布的 Docker GitHub Action 可让用户能够更灵活的经过 GitHub Action 来定义本身的 workflow,并将镜像推送至镜像仓库。这里的镜像仓库并无和 DockerHub 强制绑定,用户能够自定义镜像仓库的地址。安全

使用示例以下,完整的项目可参考 docker-github-action 。 须要额外注意的是, 若是你的仓库是公开的,请注意将本身的用户名密码等设置为 secrets ,可参考下方示例,以防泄漏bash

- name: Build and push Docker images
  uses: docker/build-push-action@v1.0
  with:
    # Username used to log in to a Docker registry. If not set then no login will occur
    username: ${{ secrets.DOCKER_USERNAME }}  
    # Password or personal access token used to log in to a Docker registry. If not set then no login will occur
    password: ${{ secrets.DOCKER_TOKEN }}
    # Docker repository to tag the image with
    repository: ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_PROJECT }}
    # Automatically tags the built image with the git reference as per the readme
    tag_with_ref: true
    # Automatically tags the built image with the git short SHA as per the readme
    tag_with_sha: true
    # Path to run docker build from
    path: .
    # Name of the Dockerfile (Default is 'path/Dockerfile')
    dockerfile: Dockerfile
    # Always attempt to pull a newer version of the image
    always_pull: true
    # Adds labels with git repository information to the built image
    add_git_labels: true
    # Whether to push the image
    push: true
复制代码

此外 Visual Studio Code Docker extension 1.0 也在本周发布了!听说比以前版本的都好用,使用 vsc 的小伙伴能够尝试下。架构

etcd v3.4.5 发布

etcd 本周发布的 v3.4.5 包含了一些:工具

  • #11704 在 server 端的日志中记录了 /health 的检查结果,主要是为了便于在 etcd 挂掉时分析根因;
  • #11694 修复了一个在处理 metrics 可能引发的异常;

其余变动,请参考其 ReleaseNotepost

Trivy 受权协议变动为 Apache-2.0

Aqua Security 开源的 trivy 是一款镜像漏洞安全扫描程序,对 CI 友好。visual-studio

可能有些小伙伴不太了解 Aqua Security 这家公司,但大多数人都或多或少用过或者了解过它的一些开源项目:

近期,trivy 的受权协议AGPL v3 修改为了 Apache-2.0,这个事情的意义在于,更多的厂商或者公司能够不用担忧 trivy 自身的受权协议,能够在本身的产品或者环境中集成使用 trivy 了!

目前包括 Harbor,Docker 及 Mirantis Docker Enterprise 等正在或者将使用 trivy 做为其默认镜像安全扫描工具。

但须要注意的是,trivy 使用的数据源有些是仍是禁止商用来着。

推荐阅读:全面易用的镜像漏洞检测工具:Trivy

上游进展

  • 这是一个对 Kubernetes v1.16 的修复,将一系列主线中的修复都合并到了 v1.16 。这里专门提到它,是由于若是你集群中有不少节点变 NotReady 时,可能会致使 control plane 超载,出现不可用的状况。主要的修正都在 NodeLifecycleController 上,建议想要使用或者正在 v1.16 版本的用户关注下此问题(若是集群规模不大,那受此问题影响的可能性比较小),详情请查看 #88959

项目推荐

Reloader 是一个 Kubernetes controller ,它会 watch ConfigMapSecrets,而后对使用这些资源的 Pod 执行滚动升级。

注意它只兼容 Kubernetes v1.9 及以上。若是有相关需求的小伙伴能够进行尝试。


欢迎订阅个人文章公众号【MoeLove】

TheMoeLove
相关文章
相关标签/搜索