|
7 | 7 | = Installing {pac} on an {product-title}
|
8 | 8 |
|
9 | 9 | [role="_abstract"]
|
10 |
| -{pac} is installed by default when you install the {pipelines-title} Operator. If you are using {pipelines-shortname} 1.7 or later versions, skip the procedure for manual installation of {pac}. |
| 10 | +{pac} is installed in the `openshift-pipelines` namespace when you install the {pipelines-title} Operator. For more details, see _Installing OpenShift Pipelines_ in the _Additional resources_ section. |
11 | 11 |
|
12 |
| -However, if you want to disable the default installation of {pac} with the {pipelines-title} Operator, set the value of the `enablePipelinesAsCode` field as `false` in the `TektonConfig` custom resource. |
| 12 | +To enable the default installation of {pac} with the {pipelines-title} Operator, set the value of the `enable` parameter to `true` in the `TektonConfig` custom resource: |
13 | 13 |
|
14 | 14 | [source,yaml]
|
15 | 15 | ----
|
16 | 16 | ...
|
17 |
| -spec: |
18 |
| - addon: |
19 |
| - enablePipelinesAsCode: false |
| 17 | + spec: |
| 18 | + platforms: |
| 19 | + openshift: |
| 20 | + pipelinesAsCode: |
| 21 | + enable: true |
| 22 | + settings: |
| 23 | + application-name: Pipelines as Code CI |
| 24 | + auto-configure-new-github-repo: "false" |
| 25 | + bitbucket-cloud-check-source-ip: "true" |
| 26 | + hub-catalog-name: tekton |
| 27 | + hub-url: https://api.hub.tekton.dev/v1 |
| 28 | + remote-tasks: "true" |
| 29 | + secret-auto-create: "true" |
20 | 30 | ...
|
21 | 31 | ----
|
22 | 32 |
|
23 |
| -To install {pac} using the Operator, set the value of the `enablePipelinesAsCode` field to `true`. |
24 |
| - |
25 |
| -[discrete] |
26 |
| -.Procedure |
27 |
| - |
28 |
| -. To _manually_ install {pac} on a {product-title} cluster instead of the default installation with the {pipelines-title} Operator, run the following command: |
29 |
| -+ |
30 |
| -[source,terminal] |
31 |
| ----- |
32 |
| -$ VERSION=0.5.4 |
33 |
| -$ oc apply -f https://raw.githubusercontent.com/openshift-pipelines/pipelines-as-code/release-$VERSION/release-$VERSION.yaml |
34 |
| ----- |
35 |
| -+ |
36 |
| -[NOTE] |
37 |
| -==== |
38 |
| -For the latest stable version, check the link:https://github.com/openshift-pipelines/pipelines-as-code/releases[release page]. In addition, check the {pipelines-title} release notes to ensure that the {pac} version is compatible with the {pipelines-title} version. |
39 |
| -==== |
40 |
| -+ |
41 |
| -This command installs {pac} in the `pipelines-as-code` namespace and creates user roles and the route URL for the {pac} event listener. |
42 |
| - |
43 |
| -. Note the route URL for the {pac} controller created on the cluster: |
44 |
| -+ |
45 |
| -[source,terminal] |
46 |
| ----- |
47 |
| -$ echo https://$(oc get route -n pipelines-as-code el-pipelines-as-code-interceptor -o jsonpath='{.spec.host}') |
48 |
| ----- |
49 |
| -+ |
50 |
| -This URL will be needed later when you configure the Git repository hosting service provider. |
51 |
| - |
52 |
| -. (Optional) To allow non-administrative users to create repository custom resource definitions (CRDs) in their respective namespaces, create a `RoleBinding` object with the name `openshift-pipeline-as-code-clusterrole` in the namespace. For example, to allow a user to create a repository CRD in the `user-ci` namespace, run the following command: |
53 |
| -+ |
54 |
| -[source,terminal] |
55 |
| ----- |
56 |
| -$ oc adm policy add-role-to-user openshift-pipeline-as-code-clusterrole user -n user-ci |
57 |
| ----- |
58 |
| -+ |
59 |
| -Alternatively, apply the following YAML file using the `oc apply -f <RoleBinding.yaml>` command: |
60 |
| -+ |
61 |
| -[source,yaml] |
62 |
| ----- |
63 |
| -apiVersion: rbac.authorization.k8s.io/v1 |
64 |
| -kind: RoleBinding |
65 |
| -metadata: |
66 |
| - name: openshift-pipeline-as-code-clusterrole |
67 |
| - namespace: user-ci |
68 |
| -roleRef: |
69 |
| - apiGroup: rbac.authorization.k8s.io |
70 |
| - kind: ClusterRole |
71 |
| - name: openshift-pipeline-as-code-clusterrole |
72 |
| -subjects: |
73 |
| -- apiGroup: rbac.authorization.k8s.io |
74 |
| - kind: User |
75 |
| - name: user |
76 |
| ----- |
| 33 | +If you want to disable the default installation of {pac} with the Operator, set the value of the `enable` parameter to `false`. |
0 commit comments