Skip to content

Commit

Permalink
Merge pull request #61 from Kuadrant/64-kuadrantctl-tekton-fixes
Browse files Browse the repository at this point in the history
Fixes for the CI/CD guide
  • Loading branch information
jasonmadigan authored Mar 12, 2024
2 parents b9fcddd + 4382faa commit 5069fe3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions doc/kuadrantctl-ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

This guide demonstrates setting up a CI/CD pipeline using Tekton to deploy Kubernetes Gateway API and Kuadrant resources generated by `kuadrantctl`, from an OpenAPI specification. In this example, these resources are applied directly to the cluster where Tekton is running.

Prerequisites:
## Prerequisites

- Kuadrant, and all of its pre-requisites, is installed onto a cluster
- (Tekton Pipelines[https://tekton.dev/]) installed on your Kubernetes or OpenShift cluster.
- (`kubectl`[https://kubernetes.io/docs/reference/kubectl/]) configured to communicate with your cluster (i.e you have a kubectl config available with access to your cluster)
- (Tekton CLI `tkn`[https://tekton.dev/docs/cli/]) (optional) for easier interaction with Tekton resources.
- [Tekton Pipelines](https://tekton.dev/) installed on your Kubernetes or OpenShift cluster.
- [`kubectl`](https://kubernetes.io/docs/reference/kubectl/) configured to communicate with your cluster (i.e you have a kubectl config available with access to your cluster)
- [Tekton CLI `tkn`](https://tekton.dev/docs/cli/) (optional) for easier interaction with Tekton resources.

Setup:
## Setup

First, create a dedicated namespace:

```bash
kubectl create namespace petstore
```

Step 1: Create a Persistent Volume Claim
## Create a Persistent Volume Claim

To store Tekton build artifacts, create a PVC in the petstore namespace:

Expand All @@ -37,7 +37,7 @@ spec:
EOF
```

Step 2: Define the Tekton Task
## Define the Tekton Task

Define the task that outlines steps to clone a repository, generate Kuadrant and Kubernetes resources using `kuadrantctl`, and apply them directly to the cluster:

Expand Down Expand Up @@ -107,13 +107,13 @@ spec:
EOF
```

We're using Tekton here with a kubectl to apply resources to a cluster. We would generally recommend looking at a tool such as (ArgoCD)[https://argo-cd.readthedocs.io/en/stable/] to implement continuous delivery via a GitOps approach. In this scenario, you would:
We're using Tekton here with `kubectl` to apply resources to a cluster. We recommend looking at a tool such as (ArgoCD)[https://argo-cd.readthedocs.io/en/stable/] to implement continuous delivery via a GitOps approach. In this scenario, you would:

- Use `kuadrantctl` to generate Kubernetes/Kuadrant resources as part a Tekton pipeline
- Commit these new resources in to a git respository
- Use ArgoCD to sync these changes via a Git respository to a Kubernetes or OpenShift cluster

Step 3: Create a Kubeconfig Secret
## Create a Kubeconfig Secret

Provide Tekton access to your Kubernetes cluster by creating a secret with your kubeconfig in the `petstore` namespace:

Expand Down Expand Up @@ -149,7 +149,7 @@ roleRef:
EOF
```

Step 4: Trigger the `TaskRun`
## Trigger the `TaskRun`

Execute the task within the `petstore` namespace, referencing the kubeconfig secret for cluster access:

Expand Down

0 comments on commit 5069fe3

Please sign in to comment.