CONFIDENTIAL designator
V0000000
How to craft modern CI/CD workflows
Serverless, Tekton, and Argo CD:
David Sancho Ruiz
Senior AppDev Architect
@s4ncheski
1
CONFIDENTIAL designator
V0000000
2
CI/CD workflow main technologies
CONFIDENTIAL designator
V0000000
3
The serverless part
CONFIDENTIAL designator
V0000000
4
The (demo) workflow
CONFIDENTIAL designator
V0000000
5
Kustomize files: zoom in
├── base
│ ├── global-ops-configmap.yaml
│ ├── kservice.yaml
│ └── kustomization.yaml
├── development
│ ├── env-ops-configmap.yaml
│ ├── kustomization.yaml
│ ├── r9ce9024
│ │ ├── configmap.yaml
│ │ ├── revision-patch.yaml
│ │ └── routing-patch.yaml
│ └── traffic-routing.yaml
├── production
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
…………
└── staging
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
…………
CONFIDENTIAL designator
V0000000
6
Kustomize files: zoom in
├── base
│ ├── global-ops-configmap.yaml
│ ├── kservice.yaml
│ └── kustomization.yaml
├── development
│ ├── env-ops-configmap.yaml
│ ├── kustomization.yaml
│ ├── r9ce9024
│ │ ├── configmap.yaml
│ │ ├── revision-patch.yaml
│ │ └── routing-patch.yaml
│ └── traffic-routing.yaml
├── production
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
…………
└── staging
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
…………
CONFIDENTIAL designator
V0000000
Fun part!!!
Demo time
7
CONFIDENTIAL designator
V0000000
Corporate slide templates
8
Output
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: quarkus-hello-world
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/minScale: "0"
name: quarkus-hello-world-r9ce9024
spec:
containers:
- image: <registry>/quarkus-hello-world:9ce90240
livenessProbe:
httpGet:
path: /health/live
readinessProbe:
httpGet:
path: /health/ready
traffic:
- percent: 100
revisionName: quarkus-hello-world-r9ce9024
- revisionName: quarkus-hello-world-r9ce9024
tag: r9ce9024
Kustomize files
├── base
│ ├── global-ops-configmap.yaml
│ ├── kservice.yaml
│ └── kustomization.yaml
├── development
│ ├── env-ops-configmap.yaml
│ ├── kustomization.yaml
│ ├── r9ce9024
│ │ ├── configmap.yaml
│ │ ├── revision-patch.yaml
│ │ └── routing-patch.yaml
│ └── traffic-routing.yaml
├── production
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
…………
└── staging
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
…………
CONFIDENTIAL designator
V0000000
Corporate slide templates
9
Output
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: quarkus-hello-world
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/minScale: "0"
name: quarkus-hello-world-r9ce9024
spec:
containers:
- image: <registry>/quarkus-hello-world:9ce90240
livenessProbe:
httpGet:
path: /health/live
readinessProbe:
httpGet:
path: /health/ready
traffic:
- percent: 100
revisionName: quarkus-hello-world-r9ce9024
- revisionName: quarkus-hello-world-r9ce9024
tag: r9ce9024
Kustomize files
├── base
│ ├── global-ops-configmap.yaml
│ ├── kservice.yaml
│ └── kustomization.yaml
├── development
│ ├── env-ops-configmap.yaml
│ ├── kustomization.yaml
│ ├── r9ce9024
│ │ ├── configmap.yaml
│ │ ├── revision-patch.yaml
│ │ └── routing-patch.yaml
│ └── traffic-routing.yaml
├── production
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
…………
└── staging
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
CONFIDENTIAL designator
V0000000
Corporate slide templates
10
Output
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: quarkus-hello-world
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/minScale: "0"
name: quarkus-hello-world-r9ce9024
spec:
containers:
- image: <registry>/quarkus-hello-world:9ce90240
livenessProbe:
httpGet:
path: /health/live
readinessProbe:
httpGet:
path: /health/ready
traffic:
- percent: 100
revisionName: quarkus-hello-world-r9ce9024
- revisionName: quarkus-hello-world-r9ce9024
tag: r9ce9024
Kustomize files
├── base
│ ├── global-ops-configmap.yaml
│ ├── kservice.yaml
│ └── kustomization.yaml
├── development
│ ├── env-ops-configmap.yaml
│ ├── kustomization.yaml
│ ├── r9ce9024
│ │ ├── configmap.yaml
│ │ ├── revision-patch.yaml
│ │ └── routing-patch.yaml
│ └── traffic-routing.yaml
├── production
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
…………
└── staging
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
CONFIDENTIAL designator
V0000000
Corporate slide templates
11
Output
apiVersion: v1
kind: ConfigMap
metadata:
name: global-ops-quarkus-hello-world
---
apiVersion: v1
kind: ConfigMap
metadata:
name: env-ops-quarkus-hello-world
---
apiVersion: v1
kind: ConfigMap
metadata:
name: quarkus-hello-world
data:
application.yaml: |-
message: hola
environment:
name: dev
Kustomize files
├── base
│ ├── global-ops-configmap.yaml
│ ├── kservice.yaml
│ └── kustomization.yaml
├── development
│ ├── env-ops-configmap.yaml
│ ├── kustomization.yaml
│ ├── r9ce9024
│ │ ├── configmap.yaml
│ │ ├── revision-patch.yaml
│ │ └── routing-patch.yaml
│ └── traffic-routing.yaml
├── production
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
…………
└── staging
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
CONFIDENTIAL designator
V0000000
Corporate slide templates
12
Output
apiVersion: v1
kind: ConfigMap
metadata:
name: global-ops-quarkus-hello-world
---
apiVersion: v1
kind: ConfigMap
metadata:
name: env-ops-quarkus-hello-world
---
apiVersion: v1
kind: ConfigMap
metadata:
name: quarkus-hello-world
data:
application.yaml: |-
message: hola
environment:
name: dev
Kustomize files
├── base
│ ├── global-ops-configmap.yaml
│ ├── kservice.yaml
│ └── kustomization.yaml
├── development
│ ├── env-ops-configmap.yaml
│ ├── kustomization.yaml
│ ├── r9ce9024
│ │ ├── configmap.yaml
│ │ ├── revision-patch.yaml
│ │ └── routing-patch.yaml
│ └── traffic-routing.yaml
├── production
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
…………
└── staging
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
CONFIDENTIAL designator
V0000000
Corporate slide templates
13
Output
apiVersion: v1
kind: ConfigMap
metadata:
name: global-ops-quarkus-hello-world
---
apiVersion: v1
kind: ConfigMap
metadata:
name: env-ops-quarkus-hello-world
---
apiVersion: v1
kind: ConfigMap
Metadata:
name: quarkus-hello-world
data:
application.yaml: |-
message: hola
environment:
name: dev
Kustomize files
├── base
│ ├── global-ops-configmap.yaml
│ ├── kservice.yaml
│ └── kustomization.yaml
├── development
│ ├── env-ops-configmap.yaml
│ ├── kustomization.yaml
│ ├── r9ce9024
│ │ ├── configmap.yaml
│ │ ├── revision-patch.yaml
│ │ └── routing-patch.yaml
│ └── traffic-routing.yaml
├── production
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
…………
└── staging
…………
│ ├── kustomization.yaml
│ ├── r9ce9024
CONFIDENTIAL designator
V0000000
Did the pipeline run finish?
14
CONFIDENTIAL designator
V0000000
Corporate slide templates
15
Output
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: quarkus-hello-world
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/minScale: "0"
name: quarkus-hello-world- rc076ee9
spec:
containers:
- image: <registry>/quarkus-hello-world: c076ee9
livenessProbe:
httpGet:
path: /health/live
readinessProbe:
httpGet:
path: /health/ready
traffic:
- percent: 100
revisionName: quarkus-hello-world-r9ce9024
- revisionName: quarkus-hello-world- rc076ee9
tag: rc076ee9
Kustomize files
├── base
│ ├── global-ops-configmap.yaml
│ ├── kservice.yaml
│ └── kustomization.yaml
├── development
│ ├── env-ops-configmap.yaml
│ ├── kustomization.yaml
│ ├── rc076ee9
│ │ ├── configmap.yaml
│ │ ├── revision-patch.yaml
│ │ └── routing-patch.yaml
│ └── traffic-routing.yaml
├── staging
…………
│ ├── kustomization.yaml
│ ├── rc076ee9
…………
├── production
…………
│ ├── kustomization.yaml
│ ├── rc076ee9
CONFIDENTIAL designator
V0000000
Corporate slide templates
16
Output
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: quarkus-hello-world
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/minScale: "0"
name: quarkus-hello-world-rc076ee9
spec:
containers:
- image: <registry>/quarkus-hello-world:c076ee9
livenessProbe:
httpGet:
path: /health/live
readinessProbe:
httpGet:
path: /health/ready
traffic:
- percent: 100
revisionName: quarkus-hello-world- r9ce9024
- revisionName: quarkus-hello-world-rc076ee9
tag: rc076ee9
Kustomize files
├── base
│ ├── global-ops-configmap.yaml
│ ├── kservice.yaml
│ └── kustomization.yaml
├── development
│ ├── env-ops-configmap.yaml
│ ├── kustomization.yaml
│ ├── rc076ee9
│ │ ├── configmap.yaml
│ │ ├── revision-patch.yaml
│ │ └── routing-patch.yaml
│ └── traffic-routing.yaml
├── staging
…………
│ ├── kustomization.yaml
│ ├── rc076ee9
…………
├── production
…………
│ ├── kustomization.yaml
│ ├── rc076ee9
CONFIDENTIAL designator
V0000000
Let’s see if we have the
new service revision...
17
CONFIDENTIAL designator
V0000000
18
Resources
Blog post:
https://developers.redhat.com/blog/2020/10/01/building-modern-ci-cd-workflows-for-serverless-applications-with-red-hat-openshift-pipelines-and-argo-cd-part-1/
https://developers.redhat.com/blog/2020/10/14/building-modern-ci-cd-workflows-for-serverless-applications-with-red-hat-openshift-pipelines-and-argo-cd-part-2/
Github repositories:
Session: https://github.com/dsanchor/rh-developers-cicd/tree/ocp-4.6-cd
Blog post: https://github.com/dsanchor/rh-developers-cicd/tree/ocp-4.6
Application source code: https://github.com/dsanchor/quarkus-hello-world
GitOps: https://github.com/dsanchor/quarkus-hello-world-deployment
CONFIDENTIAL designator
V0000000
linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHat
Red Hat is the world’s leading provider of enterprise
open source software solutions. Award-winning
support, training, and consulting services make
Red Hat a trusted adviser to the Fortune 500.
Thank you
19

Serverless, Tekton, and Argo CD: How to craft modern CI/CD workflows | DevNation Tech Talk

  • 1.
    CONFIDENTIAL designator V0000000 How tocraft modern CI/CD workflows Serverless, Tekton, and Argo CD: David Sancho Ruiz Senior AppDev Architect @s4ncheski 1
  • 2.
  • 3.
  • 4.
  • 5.
    CONFIDENTIAL designator V0000000 5 Kustomize files:zoom in ├── base │ ├── global-ops-configmap.yaml │ ├── kservice.yaml │ └── kustomization.yaml ├── development │ ├── env-ops-configmap.yaml │ ├── kustomization.yaml │ ├── r9ce9024 │ │ ├── configmap.yaml │ │ ├── revision-patch.yaml │ │ └── routing-patch.yaml │ └── traffic-routing.yaml ├── production ………… │ ├── kustomization.yaml │ ├── r9ce9024 ………… └── staging ………… │ ├── kustomization.yaml │ ├── r9ce9024 …………
  • 6.
    CONFIDENTIAL designator V0000000 6 Kustomize files:zoom in ├── base │ ├── global-ops-configmap.yaml │ ├── kservice.yaml │ └── kustomization.yaml ├── development │ ├── env-ops-configmap.yaml │ ├── kustomization.yaml │ ├── r9ce9024 │ │ ├── configmap.yaml │ │ ├── revision-patch.yaml │ │ └── routing-patch.yaml │ └── traffic-routing.yaml ├── production ………… │ ├── kustomization.yaml │ ├── r9ce9024 ………… └── staging ………… │ ├── kustomization.yaml │ ├── r9ce9024 …………
  • 7.
  • 8.
    CONFIDENTIAL designator V0000000 Corporate slidetemplates 8 Output apiVersion: serving.knative.dev/v1 kind: Service metadata: name: quarkus-hello-world spec: template: metadata: annotations: autoscaling.knative.dev/minScale: "0" name: quarkus-hello-world-r9ce9024 spec: containers: - image: <registry>/quarkus-hello-world:9ce90240 livenessProbe: httpGet: path: /health/live readinessProbe: httpGet: path: /health/ready traffic: - percent: 100 revisionName: quarkus-hello-world-r9ce9024 - revisionName: quarkus-hello-world-r9ce9024 tag: r9ce9024 Kustomize files ├── base │ ├── global-ops-configmap.yaml │ ├── kservice.yaml │ └── kustomization.yaml ├── development │ ├── env-ops-configmap.yaml │ ├── kustomization.yaml │ ├── r9ce9024 │ │ ├── configmap.yaml │ │ ├── revision-patch.yaml │ │ └── routing-patch.yaml │ └── traffic-routing.yaml ├── production ………… │ ├── kustomization.yaml │ ├── r9ce9024 ………… └── staging ………… │ ├── kustomization.yaml │ ├── r9ce9024 …………
  • 9.
    CONFIDENTIAL designator V0000000 Corporate slidetemplates 9 Output apiVersion: serving.knative.dev/v1 kind: Service metadata: name: quarkus-hello-world spec: template: metadata: annotations: autoscaling.knative.dev/minScale: "0" name: quarkus-hello-world-r9ce9024 spec: containers: - image: <registry>/quarkus-hello-world:9ce90240 livenessProbe: httpGet: path: /health/live readinessProbe: httpGet: path: /health/ready traffic: - percent: 100 revisionName: quarkus-hello-world-r9ce9024 - revisionName: quarkus-hello-world-r9ce9024 tag: r9ce9024 Kustomize files ├── base │ ├── global-ops-configmap.yaml │ ├── kservice.yaml │ └── kustomization.yaml ├── development │ ├── env-ops-configmap.yaml │ ├── kustomization.yaml │ ├── r9ce9024 │ │ ├── configmap.yaml │ │ ├── revision-patch.yaml │ │ └── routing-patch.yaml │ └── traffic-routing.yaml ├── production ………… │ ├── kustomization.yaml │ ├── r9ce9024 ………… └── staging ………… │ ├── kustomization.yaml │ ├── r9ce9024
  • 10.
    CONFIDENTIAL designator V0000000 Corporate slidetemplates 10 Output apiVersion: serving.knative.dev/v1 kind: Service metadata: name: quarkus-hello-world spec: template: metadata: annotations: autoscaling.knative.dev/minScale: "0" name: quarkus-hello-world-r9ce9024 spec: containers: - image: <registry>/quarkus-hello-world:9ce90240 livenessProbe: httpGet: path: /health/live readinessProbe: httpGet: path: /health/ready traffic: - percent: 100 revisionName: quarkus-hello-world-r9ce9024 - revisionName: quarkus-hello-world-r9ce9024 tag: r9ce9024 Kustomize files ├── base │ ├── global-ops-configmap.yaml │ ├── kservice.yaml │ └── kustomization.yaml ├── development │ ├── env-ops-configmap.yaml │ ├── kustomization.yaml │ ├── r9ce9024 │ │ ├── configmap.yaml │ │ ├── revision-patch.yaml │ │ └── routing-patch.yaml │ └── traffic-routing.yaml ├── production ………… │ ├── kustomization.yaml │ ├── r9ce9024 ………… └── staging ………… │ ├── kustomization.yaml │ ├── r9ce9024
  • 11.
    CONFIDENTIAL designator V0000000 Corporate slidetemplates 11 Output apiVersion: v1 kind: ConfigMap metadata: name: global-ops-quarkus-hello-world --- apiVersion: v1 kind: ConfigMap metadata: name: env-ops-quarkus-hello-world --- apiVersion: v1 kind: ConfigMap metadata: name: quarkus-hello-world data: application.yaml: |- message: hola environment: name: dev Kustomize files ├── base │ ├── global-ops-configmap.yaml │ ├── kservice.yaml │ └── kustomization.yaml ├── development │ ├── env-ops-configmap.yaml │ ├── kustomization.yaml │ ├── r9ce9024 │ │ ├── configmap.yaml │ │ ├── revision-patch.yaml │ │ └── routing-patch.yaml │ └── traffic-routing.yaml ├── production ………… │ ├── kustomization.yaml │ ├── r9ce9024 ………… └── staging ………… │ ├── kustomization.yaml │ ├── r9ce9024
  • 12.
    CONFIDENTIAL designator V0000000 Corporate slidetemplates 12 Output apiVersion: v1 kind: ConfigMap metadata: name: global-ops-quarkus-hello-world --- apiVersion: v1 kind: ConfigMap metadata: name: env-ops-quarkus-hello-world --- apiVersion: v1 kind: ConfigMap metadata: name: quarkus-hello-world data: application.yaml: |- message: hola environment: name: dev Kustomize files ├── base │ ├── global-ops-configmap.yaml │ ├── kservice.yaml │ └── kustomization.yaml ├── development │ ├── env-ops-configmap.yaml │ ├── kustomization.yaml │ ├── r9ce9024 │ │ ├── configmap.yaml │ │ ├── revision-patch.yaml │ │ └── routing-patch.yaml │ └── traffic-routing.yaml ├── production ………… │ ├── kustomization.yaml │ ├── r9ce9024 ………… └── staging ………… │ ├── kustomization.yaml │ ├── r9ce9024
  • 13.
    CONFIDENTIAL designator V0000000 Corporate slidetemplates 13 Output apiVersion: v1 kind: ConfigMap metadata: name: global-ops-quarkus-hello-world --- apiVersion: v1 kind: ConfigMap metadata: name: env-ops-quarkus-hello-world --- apiVersion: v1 kind: ConfigMap Metadata: name: quarkus-hello-world data: application.yaml: |- message: hola environment: name: dev Kustomize files ├── base │ ├── global-ops-configmap.yaml │ ├── kservice.yaml │ └── kustomization.yaml ├── development │ ├── env-ops-configmap.yaml │ ├── kustomization.yaml │ ├── r9ce9024 │ │ ├── configmap.yaml │ │ ├── revision-patch.yaml │ │ └── routing-patch.yaml │ └── traffic-routing.yaml ├── production ………… │ ├── kustomization.yaml │ ├── r9ce9024 ………… └── staging ………… │ ├── kustomization.yaml │ ├── r9ce9024
  • 14.
  • 15.
    CONFIDENTIAL designator V0000000 Corporate slidetemplates 15 Output apiVersion: serving.knative.dev/v1 kind: Service metadata: name: quarkus-hello-world spec: template: metadata: annotations: autoscaling.knative.dev/minScale: "0" name: quarkus-hello-world- rc076ee9 spec: containers: - image: <registry>/quarkus-hello-world: c076ee9 livenessProbe: httpGet: path: /health/live readinessProbe: httpGet: path: /health/ready traffic: - percent: 100 revisionName: quarkus-hello-world-r9ce9024 - revisionName: quarkus-hello-world- rc076ee9 tag: rc076ee9 Kustomize files ├── base │ ├── global-ops-configmap.yaml │ ├── kservice.yaml │ └── kustomization.yaml ├── development │ ├── env-ops-configmap.yaml │ ├── kustomization.yaml │ ├── rc076ee9 │ │ ├── configmap.yaml │ │ ├── revision-patch.yaml │ │ └── routing-patch.yaml │ └── traffic-routing.yaml ├── staging ………… │ ├── kustomization.yaml │ ├── rc076ee9 ………… ├── production ………… │ ├── kustomization.yaml │ ├── rc076ee9
  • 16.
    CONFIDENTIAL designator V0000000 Corporate slidetemplates 16 Output apiVersion: serving.knative.dev/v1 kind: Service metadata: name: quarkus-hello-world spec: template: metadata: annotations: autoscaling.knative.dev/minScale: "0" name: quarkus-hello-world-rc076ee9 spec: containers: - image: <registry>/quarkus-hello-world:c076ee9 livenessProbe: httpGet: path: /health/live readinessProbe: httpGet: path: /health/ready traffic: - percent: 100 revisionName: quarkus-hello-world- r9ce9024 - revisionName: quarkus-hello-world-rc076ee9 tag: rc076ee9 Kustomize files ├── base │ ├── global-ops-configmap.yaml │ ├── kservice.yaml │ └── kustomization.yaml ├── development │ ├── env-ops-configmap.yaml │ ├── kustomization.yaml │ ├── rc076ee9 │ │ ├── configmap.yaml │ │ ├── revision-patch.yaml │ │ └── routing-patch.yaml │ └── traffic-routing.yaml ├── staging ………… │ ├── kustomization.yaml │ ├── rc076ee9 ………… ├── production ………… │ ├── kustomization.yaml │ ├── rc076ee9
  • 17.
    CONFIDENTIAL designator V0000000 Let’s seeif we have the new service revision... 17
  • 18.
    CONFIDENTIAL designator V0000000 18 Resources Blog post: https://developers.redhat.com/blog/2020/10/01/building-modern-ci-cd-workflows-for-serverless-applications-with-red-hat-openshift-pipelines-and-argo-cd-part-1/ https://developers.redhat.com/blog/2020/10/14/building-modern-ci-cd-workflows-for-serverless-applications-with-red-hat-openshift-pipelines-and-argo-cd-part-2/ Githubrepositories: Session: https://github.com/dsanchor/rh-developers-cicd/tree/ocp-4.6-cd Blog post: https://github.com/dsanchor/rh-developers-cicd/tree/ocp-4.6 Application source code: https://github.com/dsanchor/quarkus-hello-world GitOps: https://github.com/dsanchor/quarkus-hello-world-deployment
  • 19.
    CONFIDENTIAL designator V0000000 linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat Red Hatis the world’s leading provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you 19