Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for the CI/CD guide #61

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading