Skip to content

Commit

Permalink
Add HA doc for OSP 1.12 onwards
Browse files Browse the repository at this point in the history
  • Loading branch information
piyush-garg authored and concaf committed Dec 7, 2023
1 parent 914806d commit e73ec6a
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ engineers working on the project.

== The Operator xref:operator:index.adoc[➡]

- xref:operator:troubleshooting.adoc[Troubleshooting]
- xref:modules/operator/pages/troubleshooting.adoc[Troubleshooting]
- xref:modules/operator/pages/install-result.adoc[Installing Result]
- xref:modules/operator/pages/high-availability.adoc[High Availability for Tekton Pipelines Controller on OpenShift Pipelines 1.10 and 1.11]
- xref:modules/operator/pages/high-availability-1.12.adoc[High Availability for Tekton Pipelines Controller from OpenShift Pipelines 1.12]

== Pipeline xref:pipeline:index.adoc[➡]

Expand Down
3 changes: 2 additions & 1 deletion modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
** xref:pipeline:cache-in-tekton.adoc[Caches "support" in tekton pipelines]
* Operator
** xref:operator:troubleshooting.adoc[Troubleshooting]
** xref:operator:high-availability.adoc[High Availability for Tekton Pipelines Controller]
** xref:operator:install-result.adoc[Installing Result]
** xref:operator:high-availability.adoc[High Availability for Tekton Pipelines Controller on OpenShift Pipelines 1.10 and 1.11]
** xref:operator:high-availability-1.12.adoc[High Availability for Tekton Pipelines Controller from OpenShift Pipelines 1.12]
* Results
** xref:results:query-using-opc.adoc[Query Results Using OPC CLI]
* Chains
Expand Down
108 changes: 108 additions & 0 deletions modules/operator/pages/high-availability-1.12.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
= High Availability for Tekton Pipelines Controller from OpenShift Pipelines 1.12
:toc: left
:toclevels: 5
:source-highlighter: rouge
:docinfo: shared
:docinfodir: ../common


== High Availability for Tekton Pipelines Controller

If you want to run Tekton Pipelines to support high concurrent workload
scenarios, you need to follow following steps to enable high
availability for `tekton-pipelines-controller`. With this approach, you
divide the workqueue in buckets, and each replica owns a subset of those
buckets and process the load if that replica is the leader of that
bucket.

[width="100%",cols="100%",]
|===
|*NOTE*: This doc has been valid for `OpenShift Pipelines` from `v1.12.0` onwards.
|===

=== Enable High Availability With Operator on OpenShift:

[arabic]
. First, specify the number of buckets across which you want to
distribute workqueue. The maximum supported value for bucket is `10`.
Also specify the number of replicas of tekton-pipelines-controller
you need to share the workloads process by the controller.
You need to update the `config` CR with the required number of buckets and replicas.

[source,shell]
----
oc edit tektonconfig config
----

[source,yaml]
----
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonConfig
metadata:
name: config
spec:
<<--->>
pipeline:
<<--->>
performance:
disable-ha: false
buckets: < buckets required >
replicas: < replicas required >
<<--->>
----


[arabic, start=2]
. Now delete the existing leases so that old replica removes hold and
new leases gets created which get acquired by different replicas.

[source,shell]
----
oc delete -n openshift-pipelines $(oc get leases -n openshift-pipelines -o name | grep tekton-pipelines-controller)
----

Note:

* If by chance the leases are not properly divided over multiple
pods, you can try recreating them.
* Configmap config-leader-election is
by default getting used in knative controllers. So the change in data of
this gets read by all other components too. It is fixed for
pipelines-controller in
https://issues.redhat.com/browse/SRVKP-3336[1.11.1] and for others in
https://issues.redhat.com/browse/SRVKP-3377[1.13.0]

=== Disable High Availability With Operator on OpenShift:

[arabic]
. Remove the bucket and replicas field on the TektonConfig CR to remove the
workqueue distribution or set them both to 1

[source,shell]
----
oc edit tektonconfig config
----

[source,yaml]
----
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonConfig
metadata:
name: config
spec:
<<--->>
pipeline:
<<--->>
performance:
disable-ha: false
<<--->>
----

[arabic, start=2]
. Next is to delete the dangling leases which were acquired previously
by the replicas

[source,shell]
----
oc delete -n openshift-pipelines $(oc get leases -n openshift-pipelines -o name | grep tekton-pipelines-controller)
----
2 changes: 1 addition & 1 deletion modules/operator/pages/high-availability.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= High Availability for Tekton Pipelines Controller
= High Availability for Tekton Pipelines Controller on OpenShift Pipeline 1.10 and 1.11
:toc: left
:toclevels: 5
:source-highlighter: rouge
Expand Down
3 changes: 2 additions & 1 deletion operator/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ List of content around the https://github.com/tektoncd/operator[`tektoncd/operat

- xref:troubleshooting.adoc[Troubleshooting]
- xref:install-result.adoc[Installing Results]
- xref:high-availability.adoc[High Availability for Tekton Pipelines Controller]
- xref:high-availability.adoc[High Availability for Tekton Pipelines Controller on OpenShift Pipelines 1.10 and 1.11]
- xref:high-availability-1.12.adoc[High Availability for Tekton Pipelines Controller from OpenShift Pipelines 1.12]

0 comments on commit e73ec6a

Please sign in to comment.