Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Latest commit

 

History

History
84 lines (69 loc) · 3.19 KB

README.md

File metadata and controls

84 lines (69 loc) · 3.19 KB

Use these steps to trigger a Tekton pipeline build of your collections repository. The pipeline will build the stacks and deploy a kabanero-index container into your cluster. The kabanero-index container hosts the stacks index file and related assets.

  1. Deploy build task and pipeline

    oc -n kabanero apply -f stacks-build-task.yaml -f stacks-build-pipeline.yaml
    
  2. Configure security constraints for service account

    oc -n kabanero adm policy add-scc-to-user privileged -z kabanero-index
    
  3. Create stacks-build-git-resource.yaml file with the following contents. Modify revision and url properties as needed.

    apiVersion: tekton.dev/v1alpha1
    kind: PipelineResource
    metadata:
      name: stacks-build-git-resource
    spec:
      params:
      - name: revision
        value: master
      - name: url
        value: https://github.com/kabanero-io/collections.git
      type: git
    
  4. Deploy the stacks-build-git-resource.yaml file via oc -n kabanero apply -f stacks-build-git-resource.yaml

  5. If you are using GitHub Enterprise, create a secret and associate it with the kabanero-index service account. For example:

    oc -n kabanero secrets link kabanero-index basic-user-pass
    
  6. Create stacks-build-pipeline-run.yaml file with the following contents.

    apiVersion: tekton.dev/v1alpha1
    kind: PipelineRun
    metadata:
      name: stacks-build-pipeline-run
      namespace: kabanero
    spec:
      pipelineRef:
        name: stacks-build-pipeline
      resources:
      - name: git-source
        resourceRef:
          name: stacks-build-git-resource
      params:
        - name: stacks
          value: all
      serviceAccountName: kabanero-index
      timeout: 60m
    
  7. If you are deploying the stack images into a private container registry, create a Docker registry's secret and associate it with the kabanero-index service account.

    oc -n kabanero secrets link kabanero-index my-registry --for=pull,mount
    
  8. Trigger build

    oc -n kabanero delete --ignore-not-found -f stacks-build-pipeline-run.yaml
    sleep 5
    oc -n kabanero apply -f stacks-build-pipeline-run.yaml
    

    You can track the pipeline execution in the Tekton dashboard or via CLI:

    oc -n kabanero logs $(oc -n kabanero get pod -o name -l tekton.dev/task=stacks-build-task) --all-containers -f 
    

    After the build completes successfully, a kabanero-index container is deployed into your cluster.

  9. Get the route for the kabanero-index pod and use it to generate a stacks index URL:

    STACKS_INDEX_URL=$(oc -n kabanero get route kabanero-index --no-headers -o=jsonpath='http://{.status.ingress[0].host}/kabanero-index.yaml')
    echo $STACKS_INDEX_URL
    
  10. Follow the configuring a Kabanero CR instance documentation to configure or deploy a Kabanero instance with the STACKS_URL obtained in the previous step.