生成tekton dashboard

我们在之前的(安装和构建ci)实践中,用到都是tekton cli,查看ci执行情况都是通过logs,不是很友好。 tekton dashboard提供了很多的ui界面。这里我们来安装并使用。

  1. 创建dashboard.yaml

    apiVersion: v1
    kind: Namespace
    metadata:
    labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-dashboard
    name: tekton-dashboard

    apiVersion: apiextensions.k8s.io/v1
    kind: CustomResourceDefinition
    metadata:
    labels:
    app.kubernetes.io/component: dashboard
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-dashboard
    name: extensions.dashboard.tekton.dev
    spec:
    group: dashboard.tekton.dev
    names:
    categories:
    - tekton
    - tekton-dashboard
    kind: Extension
    plural: extensions
    shortNames:
    - ext
    - exts
    preserveUnknownFields: false
    scope: Namespaced
    versions:
    - additionalPrinterColumns:
    - jsonPath: .spec.apiVersion
    name: API version
    type: string
    - jsonPath: .spec.name
    name: Kind
    type: string
    - jsonPath: .spec.displayname
    name: Display name
    type: string
    - jsonPath: .metadata.creationTimestamp
    name: Age
    type: date
    name: v1alpha1
    schema:
    openAPIV3Schema:
    type: object
    x-kubernetes-preserve-unknown-fields: true
    served: true
    storage: true
    subresources:
    status: {}

    apiVersion: v1
    kind: ServiceAccount
    metadata:
    labels:
    app.kubernetes.io/component: dashboard
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-dashboard
    name: tekton-dashboard
    namespace: tekton-pipelines

    apiVersion: rbac.authorization.k8s.io/v1
    kind: Role
    metadata:
    labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-dashboard
    name: tekton-dashboard-info
    namespace: tekton-pipelines
    rules:

    • apiGroups:
      • ""
        resourceNames:
      • dashboard-info
        resources:
      • configmaps
        verbs:
      • get

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
    labels:
    app.kubernetes.io/component: dashboard
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-dashboard
    name: tekton-dashboard-backend
    rules:

    • apiGroups:
    • apiGroups:
    • apiGroups:
      • tekton.dev
        resources:
      • clustertasks
        verbs:
      • get
      • list
      • watch
    • apiGroups:
      • triggers.tekton.dev
        resources:
      • clusterinterceptors
      • clustertriggerbindings
        verbs:
      • get
      • list
      • watch
    • apiGroups:
      • ""
        resources:
      • serviceaccounts
        verbs:
      • get
      • list
      • watch
    • apiGroups:
      • dashboard.tekton.dev
        resources:
      • extensions
        verbs:
      • create
      • update
      • delete
      • patch
    • apiGroups:
      • tekton.dev
        resources:
      • clustertasks
        verbs:
      • create
      • update
      • delete
      • patch
    • apiGroups:
      • triggers.tekton.dev
        resources:
      • clusterinterceptors
      • clustertriggerbindings
        verbs:
      • create
      • update
      • delete
      • patch

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
    labels:
    app.kubernetes.io/component: dashboard
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-dashboard
    name: tekton-dashboard-tenant
    rules:

    • apiGroups:
      • dashboard.tekton.dev
        resources:
      • extensions
        verbs:
      • get
      • list
      • watch
    • apiGroups:
      • ""
        resources:
      • events
      • namespaces
      • pods
      • pods/log
        verbs:
      • get
      • list
      • watch
    • apiGroups:
      • tekton.dev
        resources:
      • tasks
      • taskruns
      • pipelines
      • pipelineruns
      • customruns
        verbs:
      • get
      • list
      • watch
    • apiGroups:
      • triggers.tekton.dev
        resources:
      • eventlisteners
      • interceptors
      • triggerbindings
      • triggers
      • triggertemplates
        verbs:
      • get
      • list
      • watch
    • apiGroups:
      • tekton.dev
        resources:
      • tasks
      • taskruns
      • pipelines
      • pipelineruns
      • customruns
        verbs:
      • create
      • update
      • delete
      • patch
    • apiGroups:
      • triggers.tekton.dev
        resources:
      • eventlisteners
      • interceptors
      • triggerbindings
      • triggers
      • triggertemplates
        verbs:
      • create
      • update
      • delete
      • patch

    apiVersion: rbac.authorization.k8s.io/v1
    kind: RoleBinding
    metadata:
    labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-dashboard
    name: tekton-dashboard-info
    namespace: tekton-pipelines
    roleRef:
    apiGroup: rbac.authorization.k8s.io
    kind: Role
    name: tekton-dashboard-info
    subjects:


    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
    labels:
    app.kubernetes.io/component: dashboard
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-dashboard
    rbac.dashboard.tekton.dev/subject: tekton-dashboard
    name: tekton-dashboard-backend
    roleRef:
    apiGroup: rbac.authorization.k8s.io
    kind: ClusterRole
    name: tekton-dashboard-backend
    subjects:

    • kind: ServiceAccount
      name: tekton-dashboard
      namespace: tekton-pipelines

    apiVersion: v1
    data:
    version: v0.42.0
    kind: ConfigMap
    metadata:
    labels:
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-dashboard
    name: dashboard-info
    namespace: tekton-pipelines

    apiVersion: v1
    kind: Service
    metadata:
    labels:
    app: tekton-dashboard
    app.kubernetes.io/component: dashboard
    app.kubernetes.io/instance: default
    app.kubernetes.io/name: dashboard
    app.kubernetes.io/part-of: tekton-dashboard
    app.kubernetes.io/version: v0.42.0
    dashboard.tekton.dev/release: v0.42.0
    version: v0.42.0
    name: tekton-dashboard
    namespace: tekton-pipelines
    spec:
    ports:
    - name: http
    port: 9097
    protocol: TCP
    targetPort: 9097
    selector:
    app.kubernetes.io/component: dashboard
    app.kubernetes.io/instance: default
    app.kubernetes.io/name: dashboard
    app.kubernetes.io/part-of: tekton-dashboard
    type: LoadBalancer

    apiVersion: apps/v1
    kind: Deployment
    metadata:
    labels:
    app: tekton-dashboard
    app.kubernetes.io/component: dashboard
    app.kubernetes.io/instance: default
    app.kubernetes.io/name: dashboard
    app.kubernetes.io/part-of: tekton-dashboard
    app.kubernetes.io/version: v0.42.0
    dashboard.tekton.dev/release: v0.42.0
    version: v0.42.0
    name: tekton-dashboard
    namespace: tekton-pipelines
    spec:
    replicas: 1
    selector:
    matchLabels:
    app.kubernetes.io/component: dashboard
    app.kubernetes.io/instance: default
    app.kubernetes.io/name: dashboard
    app.kubernetes.io/part-of: tekton-dashboard
    template:
    metadata:
    labels:
    app: tekton-dashboard
    app.kubernetes.io/component: dashboard
    app.kubernetes.io/instance: default
    app.kubernetes.io/name: dashboard
    app.kubernetes.io/part-of: tekton-dashboard
    app.kubernetes.io/version: v0.42.0
    name: tekton-dashboard
    spec:
    containers:
    - args:
    - --port=9097
    - --logout-url=
    - --pipelines-namespace=tekton-pipelines
    - --triggers-namespace=tekton-pipelines
    - --read-only=false
    - --log-level=info
    - --log-format=json
    - --namespace=
    - --namespaces=
    - --stream-logs=true
    - --external-logs=
    env:
    - name: INSTALLED_NAMESPACE
    valueFrom:
    fieldRef:
    fieldPath: metadata.namespace
    image: registry.cn-hangzhou.aliyuncs.com/acs-demo-ns/tekton-dashboard:v0.42.0
    livenessProbe:
    httpGet:
    path: /health
    port: 9097
    name: tekton-dashboard
    ports:
    - containerPort: 9097
    readinessProbe:
    httpGet:
    path: /readiness
    port: 9097
    securityContext:
    allowPrivilegeEscalation: false
    capabilities:
    drop:
    - ALL
    runAsGroup: 65532
    runAsNonRoot: true
    runAsUser: 65532
    seccompProfile:
    type: RuntimeDefault
    serviceAccountName: tekton-dashboard
    volumes: []



    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
    labels:
    app.kubernetes.io/component: dashboard
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-dashboard
    rbac.dashboard.tekton.dev/subject: tekton-dashboard
    name: tekton-dashboard-tenant
    roleRef:
    apiGroup: rbac.authorization.k8s.io
    kind: ClusterRole
    name: tekton-dashboard-tenant
    subjects:

    • kind: ServiceAccount
      name: tekton-dashboard
      namespace: tekton-pipelines
  2. 安装dashboard

    kubectl apply -f dashboard.yaml

  3. 查看dashboard

    kubectl get deploy -n tekton-pipelines | grep dashboard
    kubectl get svc -n tekton-pipelines | grep dashboard

我的输出为:

carawang@ci %kubectl get svc -n tekton-pipelines | grep dashboard
tekton-dashboard                    LoadBalancer   10.103.207.156   <pending>     9097:30755/TCP                       4m52s

因为我用的是minikube,没有endpoint可以供访问,需要forward一下。

  1. forward dashboard

    kubectl port-forward -n tekton-pipelines service/tekton-dashboard 9097:9097

不报错的话,就可以访问http://localhost:9097

  1. 查看pipelineruns等

可以看到界面很友好。

相关推荐
IT-民工211107 天前
Tekton 与其他 CI/CD 工具相比,有什么不同之处
ci/cd·tekton
探索云原生10 天前
ArgoWorkflow教程(八)---基于 LifecycleHook 实现流水线通知提醒
linux·jenkins·devops·cicd·tekton·argoworkflow
探索云原生17 天前
ArgoWorkflow教程(七)---高效的步骤间文件共享策略
linux·jenkins·devops·cicd·tekton·argoworkflow
探索云原生1 个月前
ArgoWorkflow教程(六)---无缝实现步骤间参数传递
jenkins·devops·cicd·tekton·argoworkflow
探索云原生1 个月前
ArgoWorkflow教程(五)---Workflow 的多种触发模式:手动、定时任务与事件触发
jenkins·devops·cicd·tekton·argoworkflow
solinger2 个月前
Tekton简介,安装和构建最简单ci/cd
k8s·tekton·operator
solinger2 个月前
tekton构建标准ci(clone repo, test, build & push img)
ci/cd·tekton
探索云原生2 个月前
ArgoWorkflow教程(三)---使用 Artifacts 实现步骤间文件共享
jenkins·devops·cicd·tekton·argoworkflow
The Straggling Crow3 个月前
GitOps Tekton+ArgoCD
java·argocd·tekton