Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Modernizing CI/CD with Openshift Pipelines

Bruno Andrade
November 28, 2019

Modernizing CI/CD with Openshift Pipelines

There are a lot of technologies addressing the needs of CI/CD solutions. However, traditional solutions tend to be rigid and resource hungry. Tekton is a flexible Kubernetes-native open-source CI/CD framework that enables automating deployments across multiple platforms (Kubernetes, serverless, VMs, etc). Tekton aspires to be the common denominator in CI/CD, modeling what Kubernetes has become in Cloud-Native Application development. In this talk, we’ll discuss how it works in practice and why it’s becoming the default CI/CD tool at Openshift Container Platform

Bruno Andrade

November 28, 2019
Tweet

More Decks by Bruno Andrade

Other Decks in Technology

Transcript

  1. pen4education Bruno Andrade Quality Engineer @ Red Hat Mauricio Magnani

    Software Engineer @ Red Hat Modernizing CI/CD with Openshift Pipelines
  2. pen4education Cloud-Native CI/CD Designed with microservices and distributed teams in

    mind Built for container apps and runs on Kubernetes Runs serverless with no CI/CD engine to manage and maintain DevOps Containers Serverless
  3. pen4education Concept (Custom Resources) PipelineResource Pipeline Task Task Pipeline Definition

    Pipeline Execution Pipeline Controllers (Tekton, ext, ...) pipeline-pod-a pipeline-pod-b PipelineRun TaskRun TaskRun pipeline-pod-c
  4. pen4education Openshift Pipelines Operator OpenShift Dev Console Tekton CLI Kubernetes

    CI/CD Core Developer Tools CodeReady Workspaces (Eclipse Che) Tekton Core Integrations Extensions Operator Visual Studio Code Tasks
  5. pen4education Pre Reqs 1. Have Tekton or Openshift Pipelines Operator

    installed 2. What is the platform of your application? Tekton has an Image Builders Catalog- https://cloud.google.com/cloud-build/docs/cloud-builders 3. Tekton CLI: https://github.com/tektoncd/cli
  6. pen4education First Step: Secrets Define how to access resources: Source

    Code and Container registry. apiVersion: v1 kind: Secret metadata: name: basic-user-registry annotations: tekton.dev/docker-0: index.docker.io type: kubernetes.io/basic-auth stringData: username: myuser password: mypassword apiVersion: v1 kind: Secret metadata: name: basic-user-git annotations: tekton.dev/git-0: https://github.com type: kubernetes.io/basic-auth stringData: username: myuser password: mypassword
  7. pen4education Second Step: Service Account Define a service account to

    link previously created secrets. apiVersion: v1 kind: ServiceAccount metadata: name: pipeline namespace: tekton-pipelines secrets: - name: basic-user-registry - name: basic-user-git
  8. pen4education Third Step: Pipeline Resource Define resource locations: Source Code

    and Container registry. apiVersion: tekton.dev/v1alpha1 kind: PipelineResource metadata: name: git-source spec: type: git params: - name: revision value: master - name: url value: https://github.com/myuser/awesome-java-app.git
  9. pen4education Third Step: Pipeline Resource apiVersion: tekton.dev/v1alpha1 kind: PipelineResource metadata:

    name: java-image spec: type: image params: - name: url value: registry.hub.docker.com/myuser/awesome-java-app:1.0
  10. pen4education Fourth Step: Tasks Define the parameters, steps and how

    the pipeline will be executed. apiVersion: tekton.dev/v1alpha1 kind: Task spec: inputs: params: [...] input parameters [...] outputs: [...] output parameters [...] steps: - name: build-and-push image: gcr.io/cloud-builders/mvn command: - mvn - compile
  11. pen4education Fifth Step: Pipeline Set of tasks that will be

    performed in Pipeline apiVersion: tekton.dev/v1alpha1 kind: Pipeline metadata: name: tdc-pipeline spec: resources: [... PipelineResources ...] tasks:[... PipelineResources ...] resources: inputs: [...] input parameters [...] outputs: [...] output parameters [...]
  12. pen4education Sixth Step: Pipeline Run apiVersion: tekton.dev/v1alpha1 kind: PipelineRun metadata:

    name: tdc-pipeline-run spec: pipelineRef: name: tdc-pipeline serviceAccount: pipeline resources: - name: src resourceRef: name: git-source - name: java-image resourceRef: name: java-image-res