Skip to content

Commit

Permalink
Finish rudamentary helm update pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Zgabur <[email protected]>
  • Loading branch information
azgabur committed Oct 30, 2024
1 parent 3236cd7 commit 19dd30b
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 127 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Deployment
2. Create required pipelines and their resources
* Apply main pipeline `oc apply -k main/ -n ${PIPELINE_NAMESPACE}`
* Apply nightly pipeline `oc apply -k nightly/ -n ${PIPELINE_NAMESPACE}`
* Apply helm-deploy pipelines `oc apply -k deploy/ -n ${PIPELINE_NAMESPACE}`

Secrets
---
Expand All @@ -27,6 +28,11 @@ kubectl create secret generic rp-credentials --from-literal=RP_URL="https://repo
kubectl create cm rp-ca-bundle --from-file=tls-ca-bundle.pem=./tls-ca-bundle.pem -n ${PIPELINE_NAMESPACE}
```

- Opaque Secret named values-additional-manifests containing secrets for testsuite run. Example: https://github.com/azgabur/kuadrant-helm-install/blob/main/example-additionalManifests.yaml
```shell
kubectl create -n ${PIPELINE_NAMESPACE} secret generic values-additional-manifests --from-file=additionalManifests.yaml=${ADDITIONAL_MANIFESTS.yaml}
```

Pipeline execution
---
1. Through the OpenShift Web Console
Expand Down
9 changes: 9 additions & 0 deletions deploy/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

commonLabels:
deployment: kuadrant-helm-deploy

resources:
- ../tasks/
- pipeline.yaml
43 changes: 17 additions & 26 deletions deploy/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@ spec:
- description: API URL of the Openshift cluster
name: kube-api
type: string
default: https://kubernetes.default:443
- description: Index image to use for deployment; if omitted uses community-operators
name: kuadrant-index-image
type: string
default: ""
- description: OLM channel to use for deployment
name: kuadrant-channel
type: string
default: stable
default: https://kubernetes.default:443
tasks:
- name: clone
taskRef:
Expand All @@ -28,39 +20,38 @@ spec:
params:
- name: kube-api
value: $(params.kube-api)
runAfter:
- clone
taskRef:
kind: Task
name: kubectl-login-alt
workspaces:
- name: shared-workspace
workspace: shared-workspace
- name: helm
params:
- name: kuadrant-index-image
value: $(params.kuadrant-index-image)
- name: kuadrant-channel
value: $(params.kuadrant-channel)
- name: helm-uninstall
runAfter:
- clone
- kubectl-login
taskRef:
kind: Task
name: helm
name: helm-uninstall
workspaces:
- name: shared-workspace
workspace: shared-workspace
- name: helm-operands
params:
- name: kuadrant-index-image
value: $(params.kuadrant-index-image)
- name: kuadrant-channel
value: $(params.kuadrant-channel)
- name: additional-manifests-copy
taskRef:
kind: Task
name: additional-manifests-copy
runAfter:
- clone
workspaces:
- name: shared-workspace
workspace: shared-workspace
- name: helm-install
runAfter:
- helm
- additional-manifests-copy
- helm-uninstall
taskRef:
kind: Task
name: helm-operands
name: helm-install
workspaces:
- name: shared-workspace
workspace: shared-workspace
Expand Down
14 changes: 8 additions & 6 deletions tasks/01-clone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ metadata:
name: clone
spec:
steps:
- args:
- name: clone
args:
- clone
- -b
- operators-operands-olm
- https://github.com/ficap/kuadrant-env-installation.git
- $(workspaces.shared-workspace.path)/kuadrant-env-installation
- main
- --depth
- '1'
- https://github.com/azgabur/kuadrant-helm-install
- $(workspaces.shared-workspace.path)/kuadrant-helm-install
command:
- git
computeResources:
limits:
cpu: 250m
memory: 128Mi
image: quay.io/rh_integration/ci-toolbox:latest
image: quay.io/rhn_support_azgabur/alpine/k8s:1.28.15
imagePullPolicy: IfNotPresent
name: clone
workspaces:
- name: shared-workspace
47 changes: 0 additions & 47 deletions tasks/02-helm.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions tasks/02-uninstall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: helm-uninstall
spec:
steps:
- name: helm-uninstall
args:
- $(workspaces.shared-workspace.path)/kuadrant-helm-install/uninstall.sh
command:
- /bin/bash
computeResources:
limits:
cpu: 250m
memory: 128Mi
env:
- name: KUBECONFIG
value: $(workspaces.shared-workspace.path)/kubeconfig
image: quay.io/rhn_support_azgabur/alpine/k8s:1.28.15
imagePullPolicy: IfNotPresent
workspaces:
- name: shared-workspace
27 changes: 27 additions & 0 deletions tasks/03-additional-manifests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: additional-manifests-copy
spec:
steps:
- name: additional-manifests-copy
args:
- /mount/values-additional-manifests/additionalManifests.yaml
- $(workspaces.shared-workspace.path)/kuadrant-helm-install/additionalManifests.yaml
command:
- /bin/cp
computeResources:
limits:
cpu: 250m
memory: 128Mi
image: quay.io/rhn_support_azgabur/alpine/k8s:1.28.15
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: /mount/values-additional-manifests
name: values-additional-manifests
volumes:
- secret:
secretName: values-additional-manifests
name: values-additional-manifests
workspaces:
- name: shared-workspace
47 changes: 0 additions & 47 deletions tasks/03-helm-operands.yaml

This file was deleted.

23 changes: 23 additions & 0 deletions tasks/04-helm-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: helm-install
spec:
steps:
- name: helm-install
args:
- $(workspaces.shared-workspace.path)/kuadrant-helm-install/install.sh
- -t
command:
- /bin/bash
computeResources:
limits:
cpu: 250m
memory: 128Mi
env:
- name: KUBECONFIG
value: $(workspaces.shared-workspace.path)/kubeconfig
image: quay.io/rhn_support_azgabur/alpine/k8s:1.28.15
imagePullPolicy: IfNotPresent
workspaces:
- name: shared-workspace
2 changes: 1 addition & 1 deletion tasks/kubectl-login-task-alt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
secretKeyRef:
key: KUBE_PASSWORD
name: openshift-pipelines-credentials
image: quay.io/rh_integration/ci-toolbox:latest
image: quay.io/rhn_support_azgabur/alpine/k8s:1.28.15
imagePullPolicy: IfNotPresent
name: kubectl-login
workspaces:
Expand Down
5 changes: 5 additions & 0 deletions tasks/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ resources:
- kubectl-login-task.yaml
- run-tests-task.yaml
- upload-results-task.yaml
- 01-clone.yaml
- 02-uninstall.yaml
- 03-additional-manifests.yaml
- 04-helm-install.yaml
- kubectl-login-task-alt.yaml

0 comments on commit 19dd30b

Please sign in to comment.