前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >K8S 生态周报| 首个 Docker 官方 Action 发布

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

作者头像
Jintao Zhang
发布2020-03-26 17:15:57
4090
发布2020-03-26 17:15:57
举报
文章被收录于专栏:MoeLoveMoeLove

「K8S 生态周报」内容主要包含我所接触到的 K8S 生态相关的每周值得推荐的一些信息。欢迎订阅知乎专栏「k8s 生态」 ( https://zhuanlan.zhihu.com/container )。

1

首个 Docker 官方 GitHub Action 发布了

从去年 Docker 将企业服务相关的业务出售给 Mirantis 之后,Docker 将重心放在助力开发者体验上,并为此做了一系列的努力。包括 1 月份发布了 Docker Desktop v2.2 ( https://www.docker.com/blog/docker-desktop-release-2-2-is-here/ ) ,提供了 WSL2 的新架构,以及新的交互式 Desktop Dashboard 等特性。

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

这其实也是从另一个角度来推进 DockerHub 的普及(比预期的晚了一些)。DockerHub 上一直都有构建 Docker 镜像的功能,但我个人感觉体验并不够好,从一般意义上来说,它不够灵活;另外我感觉它的调度略慢了一点(虽然现在在优化中了)。

但本次发布的 Docker GitHub Action 可以让用户可以更灵活的通过 GitHub Action 来定义自己的 workflow,并将镜像推送至镜像仓库。这里的镜像仓库并没有和 DockerHub 强制绑定,用户可以自定义镜像仓库的地址。

使用示例如下,完整的项目可参考 docker-github-action ( https://github.com/tao12345666333/docker-github-action ) 。需要额外注意的是, 如果你的仓库是公开的,请注意将自己的用户名密码等设置为 secrets ,可参考下方示例,以防泄漏。

代码语言:javascript
复制
- 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 ( https://devblogs.microsoft.com/visualstudio/visual-studio-code-docker-extension-1-0-better-than-ever/ ) 也在本周发布了!据说比之前版本的都好用,使用 vsc 的小伙伴可以尝试下。

2

etcd v3.4.5 发布

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

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

其他变更,请参考其 ReleaseNote ( https://github.com/etcd-io/etcd/blob/master/CHANGELOG-3.4.md#v345-2020-03-18 )

3

镜像漏洞安全扫描程序

Aqua Security 开源的 trivy ( https://github.com/aquasecurity/trivy ) 是一款镜像漏洞安全扫描程序,对 CI 友好。

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

  • kubectl-who-can ( https://github.com/aquasecurity/kubectl-who-can )
  • kube-bench ( https://github.com/aquasecurity/kube-bench )
  • kube-hunter ( https://github.com/aquasecurity/kube-hunter )

近期,trivy 的授权协议从 ( https://github.com/aquasecurity/trivy/pull/434 ),这个事情的意义在于,更多的厂商或者公司可以不用担心 trivy 自身的授权协议,可以在自己的产品或者环境中集成使用 trivy 了!

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

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

推荐阅读:全面易用的镜像漏洞检测工具:Trivy ( https://blog.fleeto.us/post/introducing-trivy/ )

4

上游进展

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

5

项目推荐

Reloader ( https://github.com/stakater/Reloader ) 是一个 Kubernetes controller 会 watch ConfigMap/Secrets,然后对应的支持滚动升级。

注意它只兼容 Kubernetes v1.9 及以上。如果有相关需求的小伙伴可以进行尝试。

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2020-03-23,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 MoeLove 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
容器镜像服务
容器镜像服务(Tencent Container Registry,TCR)为您提供安全独享、高性能的容器镜像托管分发服务。您可同时在全球多个地域创建独享实例,以实现容器镜像的就近拉取,降低拉取时间,节约带宽成本。TCR 提供细颗粒度的权限管理及访问控制,保障您的数据安全。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档