Traditionally, CI / CD pipelines have been built on top of physical servers and virtual machines. Container platforms like Kubernetes and OpenShift came to this scene much later. However, as more and more workloads are migrated to the OpenShift platform, so are the CI / CD pipelines, and pipeline jobs are increasingly executed inside containers running on the cluster.
This post is a translation of the blog of our friend Ales Nosik, the author of the self-named blog ("Helping you navigate the world of Kubernetes"). Ales motto: "Software developer and architect passionate about new technologies, open-source and the DevOps culture. Making the world a better place with software."
You can ask any question after reading Ales in the comments. Well, and where without it - Ales wants to present for the most tricky questions a set of backpacker with a route map from Red Hat. And a hat.
In the real world, companies are not limited to one single OpenShift cluster, but have several at once. Why? To run workloads both in various public clouds and on their own IT facilities. Or - if the organization remains loyal to a single platform provider - in order to operate effectively in different regions of the world. And sometimes it is necessary to have several clusters in one region, for example, if there are several security zones, each of which must have its own cluster.
, OpenShift. , CI/CD , , .
CI/CD- Jenkins
Jenkins β CI/CD. - Hudsonβ¦, , . , Jenkins, OpenShift? , , . , Jenkins ( -Jenkins), OpenShift. -Jenkins , -Jenkins, . OpenShift (Dev, Test Prod), :
Jenkins OpenShift Kubernetes-plugin, -Jenkins worker- . , , . :
stage ('Build') {
node ("dev") {
// running on dev cluster
}
}
stage ('Test') {
node ("test") {
// running on test cluster
}
}
stage ('Prod') {
node ("prod") {
// running on prod cluster
}
}
OpenShift Jenkins, openshift. -Jenkins, worker-podβ . , -Jenkins OpenShift, . Jenkins- worker-pod -Jenkins. , -Jenkins worker-, OpenShift.
, . -Jenkins worker- pod- OpenShift, worker- . OpenShift , Jenkins- worker. Jenkins, Jenkins- , .
Kubernetes- Tekton
, CI/CD Tekton. Jenkins, Tekton β Kubernetes- : Kubernetes Kubernetes. Tekton β . , OpenShift?
Tekton. , execute-remote-pipeline, Tekton-, OpenShift. . Tekton OpenShift . , , OpenShift (Dev, Test Prod):
Dev. Dev Test, , , Prod. :
$ tkn pipeline start dev --showlog
Pipelinerun started: dev-run-bd5fs
Waiting for logs to be available...
[execute-remote-pipeline : execute-remote-pipeline-step] Logged into "https://api.cluster-affc.sandbox1480.opentlc.com:6443" as "system:serviceaccount:test-pipeline:pipeline-starter" using the token provided.
[execute-remote-pipeline : execute-remote-pipeline-step]
[execute-remote-pipeline : execute-remote-pipeline-step] You have one project on this server: "test-pipeline"
[execute-remote-pipeline : execute-remote-pipeline-step]
[execute-remote-pipeline : execute-remote-pipeline-step] Using project "test-pipeline".
[execute-remote-pipeline : execute-remote-pipeline-step] Welcome! See 'oc help' to get started.
[execute-remote-pipeline : execute-remote-pipeline-step] [execute-remote-pipeline : execute-remote-pipeline-step] Logged into "https://api.cluster-affc.sandbox1480.opentlc.com:6443" as "system:serviceaccount:prod-pipeline:pipeline-starter" using the token provided.
[execute-remote-pipeline : execute-remote-pipeline-step] [execute-remote-pipeline : execute-remote-pipeline-step]
[execute-remote-pipeline : execute-remote-pipeline-step] [execute-remote-pipeline : execute-remote-pipeline-step] You have one project on this server: "prod-pipeline"
[execute-remote-pipeline : execute-remote-pipeline-step] [execute-remote-pipeline : execute-remote-pipeline-step]
[execute-remote-pipeline : execute-remote-pipeline-step] [execute-remote-pipeline : execute-remote-pipeline-step] Using project "prod-pipeline".
[execute-remote-pipeline : execute-remote-pipeline-step] [execute-remote-pipeline : execute-remote-pipeline-step] Welcome! See 'oc help' to get started.
[execute-remote-pipeline : execute-remote-pipeline-step] [execute-remote-pipeline : execute-remote-pipeline-step] [prod : prod-step] Running on prod cluster
[execute-remote-pipeline : execute-remote-pipeline-step] [execute-remote-pipeline : execute-remote-pipeline-step]
[execute-remote-pipeline : execute-remote-pipeline-step]
, Tekton. β .
, . Kubernetes- Tekton , RBAC. , , (, Test ), (Prod), , (Prod). , , (Prod), , (Test). , Prod Test- -, Test Prod.
, , Jenkins Tekton CI/CD, OpenShift, , .
, OpenShift, , -, .
: Ales Nosek
13 Apache Airflow OpenShift, , .
13 . OpenShift
, OpenShift' .
β .
20 . OpenShift Virtualization: , serverless ,
β OpenShift Virtualization.