「K8S 生态周报」内容主要包含我所接触到的 K8S 生态相关的每周值得推荐的一些信息。欢迎订阅知乎专栏「k8s生态」。git
从去年 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 包含了一些:工具
其余变动,请参考其 ReleaseNotepost
Aqua Security 开源的 trivy 是一款镜像漏洞安全扫描程序,对 CI 友好。visual-studio
可能有些小伙伴不太了解 Aqua Security 这家公司,但大多数人都或多或少用过或者了解过它的一些开源项目:
近期,trivy 的受权协议从 AGPL v3
修改为了 Apache-2.0
,这个事情的意义在于,更多的厂商或者公司能够不用担忧 trivy 自身的受权协议,能够在本身的产品或者环境中集成使用 trivy 了!
目前包括 Harbor,Docker 及 Mirantis Docker Enterprise 等正在或者将使用 trivy 做为其默认镜像安全扫描工具。
但须要注意的是,trivy 使用的数据源有些是仍是禁止商用来着。
推荐阅读:全面易用的镜像漏洞检测工具:Trivy
Reloader 是一个 Kubernetes controller ,它会 watch ConfigMap
或 Secrets
,而后对使用这些资源的 Pod 执行滚动升级。
注意它只兼容 Kubernetes v1.9 及以上。若是有相关需求的小伙伴能够进行尝试。
欢迎订阅个人文章公众号【MoeLove】