1

我在使用 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
4

2 回答 2

1

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 时,它​​可以正常工作。

于 2021-01-14T13:37:29.067 回答
0

最后,Jonas 告诉我,我的 minikube 的内部网络存在一个我们无法解决的错误,我决定创建一个 GKE 集群,让我能够成功通过教程

于 2021-01-15T20:12:30.083 回答