Tekton Pipelines:使用已发布的管道 yaml 启用 alpha 功能,无需存储(和维护)功能标志 ConfigMap

Tekton Pipelines: Enable alpha features using released pipelines yaml without the need to store (& maintain) feature-flags ConfigMap

我们想通过 kubectl apply 使用 Tekton experimental features such as the Pipelines In Pipelines feature. We already installed the feature as described in the README 但最终出现如下错误:

Pipeline default/buildpacks-test-pipeline can't be Run; it contains Tasks that don't exist: Couldn't retrieve Task "generic-gitlab-set-status": tasks.tekton.dev "generic-gitlab-set-status" not found

this issue it is stated, that we need to enable Tekton alpha features in our deployment. In the Tekton docs at Customizing the Pipelines Controller behavior all feature flags are described - including the Alpha Features。如果我们想使用这些功能,文档说明我们应该将 enable-api-fields: 字段从 stable 更改为 alpha

installing Tekton Pipelines 的推荐方法是使用 kubectl apply 利用远程服务的 yaml 文件:

kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml

在里面我们看到 ConfigMap feature-flags(缩写):

apiVersion: v1
kind: ConfigMap
metadata:
  name: feature-flags
  namespace: tekton-pipelines
  labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-pipelines
data:
  ...
  # Setting this flag will determine which gated features are enabled.
  # Acceptable values are "stable" or "alpha".
  enable-api-fields: "stable"
  ...

有没有办法以某种方式即时将 enable-api-fields 字段更改为 alpha 而无需存储 (并且在很长一段时间内运行维护)官方Tekton管道yaml文件?

curl 的简单组合,它下载文件并将其通过管道传输到 sed,它将 stable 替换为 alpha 就像一个魅力 - 特别是因为这个flag 是唯一包含 stable 的行(上面的注释行除外)。 sed 的常用工具。

您可以试驾它,在末尾添加一个 grep 以查看更改的行:

curl https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml | sed "s#stable#alpha#g" | grep enable-api-fields

现在将命令与最终的 kubectl apply -f -(而不是 grep)结合起来将执行要求的操作:

curl https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml | sed "s#stable#alpha#g" | kubectl apply -f -

现在,正式发布的 Tekton pipelines yaml 配置为即时使用 alpha 功能 - 例如,无需在自定义 git 存储库中存储和维护 ConfigMap