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
{{ message }}
This repository was archived by the owner on Mar 21, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: docs/installation.adoc
+24-55Lines changed: 24 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,50 +5,42 @@ This guide will show how to install ODS Pipeline in an existing ODS project. It
5
5
6
6
An ODS Pipeline installation consists of the following resources:
7
7
8
-
* `Task` resources
9
-
* `ConfigMap` and `Secret` resources, e.g. holding credentials of centrally installed tools such as Nexus and SonarQube
10
8
* A pipeline manager, which is creating pipeline runs in response to Bitbucket webhook requests
9
+
* A start and finish task which will get injected into every pipeline run
10
+
* `ConfigMap` and `Secret` resources, e.g. holding credentials of centrally installed tools such as Nexus and Bitbucket
11
+
11
12
12
13
== Prerequisites
13
14
14
15
You'll need:
15
16
16
-
* A namespace in an OpenShift cluster (such as `foo-cd` from an existing ODS project) and a project in Bitbucket (such as `FOO`).
17
+
* A namespace in an OpenShift/Kubernetes cluster (such as `foo-cd` from an existing ODS project) and a project in Bitbucket (such as `FOO`).
17
18
* `git`, link:https://docs.openshift.com/container-platform/latest/cli_reference/openshift_cli/getting-started-cli.html[`oc`] (or link:https://kubernetes.io/docs/reference/kubectl/[`kubectl`]) and link:https://helm.sh[`helm`] installed locally. The plugin link:https://github.com/databus23/helm-diff[`helm-diff`] is optional but recommended.
18
19
19
20
== Installation Instructions
20
21
21
-
The installation procedure consists of two steps:
22
-
23
-
1. Creating a Git repository defining the configuration of the ODS Pipeline installation
24
-
2. Using Helm to install from this Git repository
22
+
ODS Pipeline is packaged as a Helm chart. The installation procedure consists of three quick steps:
25
23
26
-
=== Creating a Git repository
24
+
1. Configuring the chart values
25
+
2. Running the install script (which will deploy the Helm chart)
26
+
3. Exposing a route to the pipeline manager
27
27
28
-
Create a new repository in Bitbucket, e.g. `foo-cd`. The name can be anything, but since the repository will define the K8s resources of namespace `foo-cd` in code, it makes sense to mirror the namespace name. Clone the repository locally and make an initial commit, e.g. by adding a readme file.
28
+
=== Step 1: Configuring the chart values
29
29
30
-
IMPORTANT: The following commands will fail in an empty Git repository, so make sure you have made at least one commit in this repository.
31
-
32
-
Now use `git subtree` to get the required source files. The following commands may look a bit complicated, but in a nutshell, they are simply adding one folder (`deploy/`) from the `opendevstack/ods-pipeline` repository at the given revision (e.g. `master`) into your new local repository at the path `deploy`. The benefit of this approach is that it'll make updating ODS Pipeline simple.
30
+
Download the template and fill in the values according to the comments in that file.
33
31
34
32
[source]
35
33
----
36
-
pipelineGitRef=v0.13.2 # Pick the version you want to install
Once this is done, change to the new folder `deploy` to configure the values of the Helm Chart. Run `cp values.yaml.tmpl values.yaml`, then edit `values.yaml` as described in the comments in that file. Commit and push before proceeding to the next step.
37
+
TIP: It is recommended to keep this file around after the installation so that it can be reused when updating ODS Pipeline to future versions.
46
38
47
-
=== Using Helm to install from the Git repository
39
+
=== Step 2: Running the install script
48
40
49
41
==== Option 1: With external API access
50
42
51
-
If you have access to the OpenShift API from your local machine, you can simply login to the OpenShift cluster, then install ODS Pipeline by running:
43
+
If you have access to the OpenShift API from your local machine, simply login to the OpenShift cluster and install ODS Pipeline by running:
52
44
53
45
[source]
54
46
----
@@ -61,8 +53,6 @@ IMPORTANT: If tasks need to trust a private certificate, pass `--private-cert <h
61
53
62
54
TIP: You may pass `--dry-run` to review what `install.sh` will do before actually running the script.
63
55
64
-
After you ran the install script, continue with the <<finishing-the-installation,Finishing the installation>> section.
65
-
66
56
==== Option 2: Without external API access
67
57
68
58
If you do not have access to the OpenShift API from your local machine, you can use the https://docs.openshift.com/container-platform/latest/web_console/odc-about-web-terminal.html[OpenShift Web Terminal] to install ODS Pipeline. Open a web terminal in your `*-cd` namespace, then run:
@@ -72,48 +62,33 @@ If you do not have access to the OpenShift API from your local machine, you can
This will install all prerequisites automatically. Then you can clone the repository and run `./install.sh -n <your_cd_namespace>` in the terminal.
65
+
This will install all prerequisites automatically. Then you can clone the repository and run `./install.sh -n <your_cd_namespace>`.
76
66
77
67
`./install.sh` will interactively ask for credentials (such as Bitbucket access token) and will create corresponding K8s secrets. If you prefer to pass these secrets via flags, see `./install.sh --help` for all options.
78
68
79
-
After you ran the install script, continue with the <<finishing-the-installation,Finishing the installation>> section.
80
-
81
-
==== Finishing the installation
69
+
=== Step 3: Exposing a route to the pipeline manager
82
70
83
71
Create an HTTPS route to expose the `ods-pipeline` service. You'll need the exposed URL (together with the webhook secret that is stored in the `ods-bitbucket-webhook` K8s secret) when you create webhooks in Bitbucket repositories later.
84
72
73
+
Done, now you are ready to link:add-to-repository.adoc[enable your repositories to use ODS pipeline]!
74
+
85
75
IMPORTANT: The `pipeline` serviceaccount needs `admin` permissions in the Kubernetes namespaces it deploys to (e.g. `foo-dev` and `foo-test`). You must create rolebindings for this manually.
86
76
87
77
CAUTION: An important feature of ODS Pipeline is to retain pipeline run artifacts in Nexus and re-use them future pipeline runs (e.g. to promote built container images to another environment). For this purpose, you should create a few `raw` repositories in Nexus. These repositories should not allow re-deployment of artifacts. For example, you might want to have `ods-pipeline-dev`, `ods-pipeline-qa` and `ods-pipeline-prod` repositories, each with a different cleanup policy as fitting your needs. You can then use these repositories from your pipeline to store artifacts and enforce a progression of artifacts from DEV > QA > PROD.
88
78
89
-
Now you are ready to link:add-to-repository.adoc[enable your repositories to use ODS pipeline]!
90
79
91
80
== Update Instructions
92
81
93
-
The update procedure consists of two steps:
82
+
The update procedure consists of two quick steps:
94
83
95
-
1. Updating the Git repository defining the configuration of the ODS Pipeline installation
96
-
2. Using Helm to install from the Git repository
84
+
1. Updating the chart values if required
85
+
2. Running the install script (which will deploy the Helm chart)
97
86
98
-
=== Updating the Git repository
87
+
=== Step 1: Updating the chart values
99
88
100
-
You may fetch updates (e.g. new versions) of `ods-pipeline` like this:
89
+
Check if any new values have been introduced in `values.yaml.tmpl` and update your `values.yaml` (which you hopefully retained from the installation) accordingly.
101
90
102
-
[source]
103
-
----
104
-
pipelineGitRef=v0.13.2 # Pick the version you want to update to
Afterwards, check if any new values have been introduced in `values.yaml.tmpl` and update `values.yaml` accordingly. Commit and push the result.
115
-
116
-
=== Using Helm to install from the Git repository
91
+
=== Step 2: Running the install script
117
92
118
93
==== Option 1: With external API access
119
94
@@ -126,8 +101,6 @@ If you have access to the OpenShift API from your local machine, you can simply
126
101
127
102
TIP: You may also use `--dry-run` to see the changes first.
128
103
129
-
After you ran the script, continue with the <<finishing-the-update,Finishing the update>> section.
130
-
131
104
TIP: By default, the credentials stored in the K8s secrets will not be updated. If you want to make a change, pass any new values as flags to `install.sh` (see `./install.sh --help` for all options) or update the secrets manually.
This will install all prerequisites automatically and update your ODS Pipeline installation to the latest state of your Git repository.
143
116
144
117
TIP: The credentials stored in the K8s secrets will not be updated. If you need to change those, update them manually.
145
-
146
-
==== Finishing the update
147
-
148
-
Once the resources in your namespace are updated, you likely have to update the `ods.yaml` files in your repository to point to the new tasks, e.g. changing `ods-build-go-v0-12-0` to `ods-build-go-v0-13-2`.
0 commit comments