You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will add the instructions in TektonConfig doc how to install and manage
Results component through Tekton Config TektonConfig doc and updates TektonResult doc
Signed-off-by: Shiv Verma
Copy file name to clipboardExpand all lines: docs/TektonConfig.md
+40-2Lines changed: 40 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ Operator provides support for installing and managing following operator compone
18
18
Other than the above components depending on the platform operator also provides support for
19
19
- On both Kubernetes and OpenShift
20
20
-[TektonChain](./TektonChain.md)
21
+
-[TektonResult](./TektonResult.md)
21
22
- On Kubernetes
22
23
-[TektonDashboard](./TektonDashboard.md)
23
24
- On OpenShift
@@ -113,6 +114,10 @@ The TektonConfig CR provides the following features
113
114
configMaps: {}
114
115
deployments: {}
115
116
webhookConfigurationOptions: {}
117
+
result:
118
+
disabled: false
119
+
is_external_db: false
120
+
options: {}
116
121
platforms:
117
122
openshift:
118
123
pipelinesAsCode:
@@ -165,8 +170,8 @@ By default, namespace would be `tekton-pipelines` for Kubernetes and `openshift-
165
170
166
171
This allows user to choose which all components to install on the cluster.
167
172
There are 3 profiles available:
168
-
- `all`: This profile will install all components (TektonPipeline, TektonTrigger and TektonChain)
169
-
- `basic`: This profile will install only TektonPipeline, TektonTrigger and TektonChain component
173
+
- `all`: This profile will install all components (TektonPipeline, TektonTrigger,TektonResult and TektonChain)
174
+
- `basic`: This profile will install only TektonPipeline, TektonTrigger, TektonResult and TektonChain component
170
175
- `lite`: This profile will install only TektonPipeline component
171
176
172
177
On Kubernetes, `all` profile will install `TektonDashboard` and on OpenShift `TektonAddon` will be installed.
@@ -284,6 +289,39 @@ chain:
284
289
transparency.url: #value
285
290
```
286
291
292
+
### Result
293
+
294
+
Result section allows user to customize the Tekton Result component, Refer to [Result Spec](https://github.com/tektoncd/operator/blob/main/docs/TektonResult.md#spec) section in TektonResult for available options.
295
+
296
+
Example:
297
+
298
+
```yaml
299
+
result:
300
+
disabled: false # - `disabled` : if the value set as `true`, result component will be disabled (default: `false`)
301
+
targetNamespace: tekton-pipelines
302
+
is_external_db: false # If it's true use external database and Result gets it's database from kubernetes secret named `tekton-results-postgres`
303
+
db_host: localhost
304
+
db_port: 5342
305
+
db_sslmode: verify-full
306
+
db_sslrootcert: /etc/tls/db/ca.crt
307
+
db_enable_auto_migration: true
308
+
log_level: debug
309
+
logs_api: true
310
+
logs_type: File
311
+
logs_buffer_size: 90kb
312
+
logs_path: /logs
313
+
auth_disable: true
314
+
logging_pvc_name: tekton-logs
315
+
secret_name: # optional
316
+
gcs_creds_secret_name: <value>
317
+
gcc_creds_secret_key: <value>
318
+
gcs_bucket_name: <value>
319
+
loki_stack_name: #optional
320
+
loki_stack_namespace: #optional
321
+
prometheus_port: 9090
322
+
prometheus_histogram: false
323
+
```
324
+
287
325
### Pruner
288
326
Pruner provides auto clean up feature for the Tekton `pipelinerun` and `taskrun` resources. In the background pruner container runs `tkn` command.
Note: Feel free to use any cert management software to do this!
36
-
37
-
Tekton Results expects the cert/key pair to be stored in a [TLS Kubernetes Secret](https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets).
38
-
Update the namespace value in below export command if Tekton Pipelines is installed in a different namespace.
- Check the status of installation using following command
79
37
```sh
80
38
kubectl get tektonresults.operator.tekton.dev
81
39
```
82
40
83
41
## Spec
42
+
84
43
The TektonResult CR is like below:
44
+
85
45
```yaml
86
46
apiVersion: operator.tekton.dev/v1alpha1
87
47
kind: TektonResult
@@ -114,22 +74,23 @@ spec:
114
74
115
75
These properties are analogous to the one in configmap of tekton results api `tekton-results-api-config` documented at [api.md]:https://github.com/tektoncd/results/blob/4472848a0fb7c1473cfca8b647553170efac78a1/cmd/api/README.md
116
76
117
-
118
-
[result]:https://github.com/tektoncd/results
119
-
77
+
[result]: https://github.com/tektoncd/results
120
78
121
79
### Property "secret_name":
80
+
122
81
`secret_name` - name of your custom secret or leave it as empty. It an optional property. The secret should be created by the user on the `targetNamespace`. The secret can contain `S3_` prefixed keys from the [result API properties](https://github.com/tektoncd/results/blob/fded140081468e418aeb860d16aca3306c675d8b/cmd/api/README.md). Please note: the key of the secret should be in UPPER_CASE and values should be in `string` format.
123
82
The following keys are supported by this secret.
124
-
* `S3_BUCKET_NAME`
125
-
* `S3_ENDPOINT`
126
-
* `S3_HOSTNAME_IMMUTABLE`
127
-
* `S3_REGION`
128
-
* `S3_ACCESS_KEY_ID`
129
-
* `S3_SECRET_ACCESS_KEY`
130
-
* `S3_MULTI_PART_SIZE`
83
+
84
+
- `S3_BUCKET_NAME`
85
+
- `S3_ENDPOINT`
86
+
- `S3_HOSTNAME_IMMUTABLE`
87
+
- `S3_REGION`
88
+
- `S3_ACCESS_KEY_ID`
89
+
- `S3_SECRET_ACCESS_KEY`
90
+
- `S3_MULTI_PART_SIZE`
131
91
132
92
#### Sample Secret File
93
+
133
94
```yaml
134
95
apiVersion: v1
135
96
kind: Secret
@@ -147,9 +108,10 @@ stringData:
147
108
S3_MULTI_PART_SIZE: "5242880"
148
109
```
149
110
150
-
151
111
### GCS specific Property
112
+
152
113
The follow keys are needed for enabling GCS storage of logs:
114
+
153
115
```yaml
154
116
apiVersion: operator.tekton.dev/v1alpha1
155
117
kind: TektonResult
@@ -185,15 +147,18 @@ If you want to move from internal DB to external DB, please take backup of the D
185
147
delete previous TektonResult CR. and recreate the fresh one with following instructions:
186
148
187
149
- Generate a secret with user name and password for Postgres (subsitute ${password} with your password):
150
+
188
151
```sh
189
152
export NAMESPACE="tekton-pipelines" # Put the targetNamespace of TektonResult where it is going to be installed.
To secure the DB connection using self-segned certificate or using certificate signed by 3rd party CA (e.g AWS RDS), one can provide path to the DB SSL root certificate, mounted and available on the Results API pod. The configuration will look like:
214
178
215
-
216
179
```yaml
217
180
apiVersion: operator.tekton.dev/v1alpha1
218
181
kind: TektonResult
@@ -238,10 +201,11 @@ and bad for performance. It's better to use forwarders like Vector, Promtail, Fl
238
201
239
202
#### Loki
240
203
241
-
You can either use Grafana's [Helm Repo](https://grafana.com/docs/loki/latest/setup/install/helm/) or operator from [OperatorHub](https://operatorhub.io/operator/loki-operator) to install Loki.
204
+
You can either use Grafana's [Helm Repo](https://grafana.com/docs/loki/latest/setup/install/helm/) or operator from [OperatorHub](https://operatorhub.io/operator/loki-operator) to install Loki.
242
205
Installing via operator simplies certain operations for Tekton Operator. You just need to configure `lokistack_name` and `lokistack_namespace`.
243
206
244
207
In case of helm installation, you will need to configure options field to configure Results API configMap `tekton-results-api-config`:
208
+
245
209
```yaml
246
210
LOGS_API
247
211
LOGGING_PLUGIN_PROXY_PATH
@@ -260,6 +224,7 @@ Please consult the docs [here](https://github.com/tektoncd/results/blob/main/doc
260
224
These fields allow you to configure how Tekton Results interacts with your Loki backend.
261
225
262
226
You might need to configure following environment variable to Tekton Results API deployment if you are using some custom CA to generate TLS certificate:
227
+
263
228
```yaml
264
229
LOGGING_PLUGIN_CA_CERT
265
230
```
@@ -270,14 +235,12 @@ LOGGING_PLUGIN_CA_CERT
270
235
271
236
You need to configure forwarder systems to add labels for namespace, pass TaskRun UID/PipelineRun UID in pods and a common label <key:value> alongwith logs from nodes.
272
237
273
-
A sample configuration for vector: [values.yaml](https://github.com/tektoncd/results/blob/main/test/e2e/loki_vector/vector.yaml).
238
+
A sample configuration for vector: [values.yaml](https://github.com/tektoncd/results/blob/main/test/e2e/loki_vector/vector.yaml).
274
239
275
240
### OpenShift (LokiStack + OpenShift Logging)
276
241
277
-
278
242
To configure LokiStack with TektonResult, you can use the `lokistack_name` and `lokistack_namespace` properties in the TektonResult custom resource. Here's how to do it:
279
243
280
-
281
244
1. First, ensure that you have LokiStack installed in your cluster.
282
245
283
246
2. Then, create or update your TektonResult CR with the following properties:
@@ -293,16 +256,17 @@ spec:
293
256
lokistack_name: your-lokistack-name
294
257
lokistack_namespace: your-lokistack-namespace
295
258
```
259
+
296
260
Replace your-lokistack-name with the name of your LokiStack instance and your-lokistack-namespace with the namespace where LokiStack is installed.
297
261
298
262
By setting these properties, Operator will configure Tekton Result to use the specified LokiStack instance for log retrieval.
299
263
300
-
301
264
#### OpenShift Logging
302
265
303
266
Install the openshift logging operator by following this: [Deploying Cluster Logging](https://docs.openshift.com/container-platform/4.16/observability/logging/cluster-logging-deploying.html#logging-loki-gui-install_cluster-logging-deploying)
304
267
305
268
If you are installing OpenShift Logging Operator only for TaskRun Logs, then you also need to configure a ClusterLogForwarder:
0 commit comments