Quick Start

This guide connects an existing Tekton installation to Artifact Hub Shim and resolves one Task from the built-in catalog.

Prerequisites

  • Artifact Hub Shim is installed and ready.
  • A supported Alauda Container Platform Pipelines release is installed. The current released version is v4.14.0. Support on the 4.10, 4.6, and 4.0 lines becomes available after v4.10.2, v4.6.4, and v4.0.17.
  • The ACP cluster meets the minimum patch versions in Release Notes.
  • You can edit TektonConfig and create a TaskRun in a test namespace.

Process Overview

StepOperationExpected Result
1Verify Artifact Hub ShimThe API reports healthy and ready.
2Configure TektonThe hub resolver uses the in-cluster shim Service.
3Verify the resolverThe generated resolver ConfigMap contains the shim URL.
4Resolve a TaskA TaskRun progresses beyond remote resolution.

Verify Artifact Hub Shim

The following commands use the default namespace and Service name:

kubectl get deployment,service -n artifacthub-shim-system

kubectl get --raw \
  '/api/v1/namespaces/artifacthub-shim-system/services/http:artifacthub-shim-api:80/proxy/readyz'

The readiness response should contain "status":"ready". A ready response means that the API has published a catalog snapshot.

Configure Tekton

Standard ACP installations with Artifact Hub Shim integration may already contain the following settings. If the values are absent or the plugin uses a custom namespace, merge the applicable fields into TektonConfig.spec.pipeline:

apiVersion: operator.tekton.dev/v1alpha1
kind: TektonConfig
metadata:
  name: config
spec:
  pipeline:
    enable-hub-resolver: true
    hub-resolver-config:
      artifact-hub-api: http://artifacthub-shim-api.artifacthub-shim-system.svc.cluster.local
      default-artifact-hub-task-catalog: catalog
      default-artifact-hub-pipeline-catalog: catalog-pipelines
      default-kind: task
      default-tekton-hub-catalog: catalog
      default-type: artifact

Keep existing spec.pipeline fields that are unrelated to the hub resolver. For Pipelines as Code and non-default installations, see Configure Tekton Integration.

Verify the Resolver Configuration

Find the Tekton target namespace and inspect the reconciled ConfigMap:

RESOLVER_NAMESPACE="$(kubectl get tektonconfig config \
  -o jsonpath='{.spec.targetNamespace}')"

kubectl get configmap hubresolver-config \
  -n "${RESOLVER_NAMESPACE}" \
  -o jsonpath='{.data.artifact-hub-api}{"\n"}'

Expected output:

http://artifacthub-shim-api.artifacthub-shim-system.svc.cluster.local

Also verify that the resolver feature is enabled:

kubectl get configmap resolvers-feature-flags \
  -n "${RESOLVER_NAMESPACE}" \
  -o jsonpath='{.data.enable-hub-resolver}{"\n"}'

Expected output:

true

Resolve a Built-in Task

Create a TaskRun that references version 0.1 of the run-script Task. If your packaged catalog offers another version, replace 0.1 with a listed version.

apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  generateName: artifacthub-shim-quick-start-
spec:
  taskRef:
    resolver: hub
    params:
      - name: type
        value: artifact
      - name: catalog
        value: catalog
      - name: kind
        value: task
      - name: name
        value: run-script
      - name: version
        value: "0.1"
  params:
    - name: script
      value: echo artifacthub-shim-ready

Save the manifest as taskrun.yaml, apply it to a test namespace, and inspect the result:

kubectl apply -n <test-namespace> -f taskrun.yaml
kubectl get taskrun -n <test-namespace>

Successful remote resolution causes Tekton to create the TaskRun pod. If the TaskRun remains in a resolution error, see Hub Resolver Cannot Resolve a Resource.

Next Steps

Trademark and Attribution

Tekton™ is a trademark of The Linux Foundation.

Red Hat® and OpenShift® are registered trademarks of Red Hat, Inc. in the United States and other countries.

Alauda is an independent vendor. This product is not affiliated with, endorsed by, or sponsored by The Linux Foundation or Red Hat, Inc. All trademarks are the property of their respective owners and are used here for identification purposes only.