kubernetes - 无法通过 Tekton 的入门。TaskRun 并没有真正运行
问题描述
我在使用 minikube 的 Linux 机器上完成了本教程:https ://tekton.dev/docs/getting-started/ 。但是出了点问题,我没有得到预期的echo
结果。
为了跟踪 TaskRun 进度运行:
➜ TWOC tkn task start hello && sleep 5 && kubectl get pods && tkn taskrun list
TaskRun started: hello-run-rjd2l
In order to track the TaskRun progress run:
tkn taskrun logs hello-run-rjd2l -f -n default
NAME READY STATUS RESTARTS AGE
twoc-backend-local-deployment-55b494d4cb-fjz6v 3/3 Running 12 7d22h
twoc-backend-local-deployment-55b494d4cb-vdtv5 3/3 Running 12 7d22h
NAME STARTED DURATION STATUS
hello-run-5f4qc --- --- ---
hello-run-5zck9 --- --- ---
hello-run-8sdmx --- --- ---
hello-run-bvhdg --- --- ---
hello-run-cdhz8 --- --- ---
hello-run-frbwf --- --- ---
hello-run-pzvbz --- --- ---
hello-run-q57p9 --- --- ---
hello-run-rjd2l --- --- ---
hello-run-tpnt7 --- --- ---
➜ TWOC kubectl describe taskrun hello-run-5zck9
Name: hello-run-5zck9
Namespace: default
Labels: <none>
Annotations: <none>
API Version: tekton.dev/v1beta1
Kind: TaskRun
Metadata:
Creation Timestamp: 2021-01-06T17:34:43Z
Generate Name: hello-run-
Generation: 1
Managed Fields:
API Version: tekton.dev/v1beta1
Fields Type: FieldsV1
fieldsV1:
f:metadata:
f:generateName:
f:spec:
.:
f:resources:
f:serviceAccountName:
f:taskRef:
.:
f:name:
f:status:
.:
f:podName:
Manager: kubectl-create
Operation: Update
Time: 2021-01-06T17:34:43Z
Resource Version: 180093
Self Link: /apis/tekton.dev/v1beta1/namespaces/default/taskruns/hello-run-5zck9
UID: a9353809-44c0-4864-b131-f1ab52ac080d
Spec:
Resources:
Service Account Name:
Task Ref:
Name: hello
Events: <none>
➜ TWOC tkn taskrun logs --last -f
Error: task hello create has not started yet or pod for task not yet available
➜ TWOC kubectl describe task hello
Name: hello
Namespace: default
Labels: <none>
Annotations: <none>
API Version: tekton.dev/v1beta1
Kind: Task
Metadata:
Creation Timestamp: 2021-01-06T16:28:46Z
Generation: 1
Managed Fields:
API Version: tekton.dev/v1beta1
Fields Type: FieldsV1
fieldsV1:
f:spec:
.:
f:steps:
Manager: kubectl-create
Operation: Update
Time: 2021-01-06T16:28:46Z
API Version: tekton.dev/v1beta1
Fields Type: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.:
f:kubectl.kubernetes.io/last-applied-configuration:
Manager: kubectl-client-side-apply
Operation: Update
Time: 2021-01-06T17:34:07Z
Resource Version: 180053
Self Link: /apis/tekton.dev/v1beta1/namespaces/default/tasks/hello
UID: 4dc3e52e-4407-4921-8365-7e8845eb8c6b
Spec:
Steps:
Args:
Hello World!
Command:
echo
Image: ubuntu
Name: hello
Events: <none>
➜ TWOC git:(master) ✗ kubectl get pods --namespace tekton-pipelines
NAME READY STATUS RESTARTS AGE
tekton-dashboard-6884b7b896-qtx4t 1/1 Running 3 8d
tekton-pipelines-controller-7c5494d584-d6gkn 1/1 Running 5 8d
tekton-pipelines-webhook-59c94c5c6d-nh8wc 1/1 Running 3 8d
➜ TWOC git:(master) ✗ kubectl get pods
NAME READY STATUS RESTARTS AGE
twoc-backend-local-deployment-55b494d4cb-fjz6v 3/3 Running 9 7d20h
twoc-backend-local-deployment-55b494d4cb-vdtv5 3/3 Running 9 7d20h
解决方案
TaskRuns 列表:
NAME STARTED DURATION STATUS
hello-run-5f4qc --- --- ---
hello-run-5zck9 --- --- ---
hello-run-8sdmx --- --- ---
并且没有对应创建的 Pod 表明你的 Pipeline Controller 不能正常工作。检查控制器的日志以查看是否存在任何相关问题,例如kubectl logs tekton-pipelines-controller-7c5494d584-d6gkn
.
日志中的此错误:
种类=任务失败:发布“https://tekton-pipelines-webhook.tekton-pipelines.svc:443/?timeout=30s”:拨号 tcp 10.101.106.201:443:连接:连接被拒绝
表示存在一些连接问题。
当我在我的机器上按照指南使用 Minikube 时,它可以正常工作。
推荐阅读
- java - Java 中的 NamedTuple 替代方案是什么?
- c++ - 使用 API 而不是全局配置文件设置 OSM 配置选项
- bash - 如何让 docker-compose exec 返回命令的返回值?
- html - 在 HTML 文件中用 sed 注释掉整个超链接块
- destructuring - 如何在javascript中解决这个问题?
- azure - Azure Front Door 产生大量带宽
- html - 加载效果重复。不重定向到主页
- java - 使用 Jackson2ObjectMapperBuilderCustomizer 的 Maven 依赖项是什么?对于一个spring mvc项目
- java - 无法连接到 Apache Karaf 中的 xmlrpc
- php - 在不使用数组的情况下获取两个字符串之间的差异