diff --git a/tekton-pipeline/kustomization.yaml b/tekton-pipeline/kustomization.yaml index 9794033..cc6f7c7 100644 --- a/tekton-pipeline/kustomization.yaml +++ b/tekton-pipeline/kustomization.yaml @@ -15,4 +15,8 @@ resources: - tasks/build-task.yaml - tasks/argocd-task.yaml - pipelines/build-deploy-pipeline.yaml -- triggers/build-deploy-trigger.yaml +- triggers/trigger-template.yaml +- triggers/trigger-binding.yaml +- triggers/event-listener.yaml +- triggers/certificate.yaml +- triggers/ingress.yaml diff --git a/tekton-pipeline/triggers/certificate.yaml b/tekton-pipeline/triggers/certificate.yaml new file mode 100644 index 0000000..18f1e22 --- /dev/null +++ b/tekton-pipeline/triggers/certificate.yaml @@ -0,0 +1,13 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: argocd-app + namespace: argocd +spec: + dnsNames: + - k8s-argocd.tk + secretName: argocd-app-tls + issuerRef: + name: letsencrypt-cluster-issuer + kind: ClusterIssuer + diff --git a/tekton-pipeline/triggers/event-listener.yaml b/tekton-pipeline/triggers/event-listener.yaml new file mode 100644 index 0000000..1970226 --- /dev/null +++ b/tekton-pipeline/triggers/event-listener.yaml @@ -0,0 +1,12 @@ +apiVersion: triggers.tekton.dev/v1beta1 +kind: EventListener +metadata: + name: tekton-argocd-example-build-el +spec: + serviceAccountName: tekton-triggers-admin + triggers: + - bindings: + - ref: tekton-argocd-example-build-git-tb + template: + ref: tekton-argocd-example-build-tt + diff --git a/tekton-pipeline/triggers/ingress.yaml b/tekton-pipeline/triggers/ingress.yaml new file mode 100644 index 0000000..772ffb0 --- /dev/null +++ b/tekton-pipeline/triggers/ingress.yaml @@ -0,0 +1,26 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: tekton-argocd-example-build-el-ingress + annotations: + cert-manager.io/cluster-issuer: letsencrypt-cluster-issuer + kubernetes.io/ingress.class: nginx + kubernetes.io/tls-acme: "true" + nginx.ingress.kubernetes.io/rewrite-target: / +spec: + rules: + - host: k8s-argocd.tk + http: + paths: + - path: /tekton-argocd-example-build-webhook/ + pathType: Prefix + backend: + service: + name: el-tekton-argocd-example-build-el + port: + number: 8080 + tls: + - hosts: + - k8s-argocd.tk + secretName: argocd-app-tls + diff --git a/tekton-pipeline/triggers/trigger-binding.yaml b/tekton-pipeline/triggers/trigger-binding.yaml new file mode 100644 index 0000000..384556a --- /dev/null +++ b/tekton-pipeline/triggers/trigger-binding.yaml @@ -0,0 +1,11 @@ +apiVersion: triggers.tekton.dev/v1beta1 +kind: TriggerBinding +metadata: + name: tekton-argocd-example-build-git-tb +spec: + params: + - name: git-app-repo-url + value: $(body.repository.url) + - name: git-app-repo-revision + value: $(body.repository.default_branch) + diff --git a/tekton-pipeline/triggers/build-deploy-trigger.yaml b/tekton-pipeline/triggers/trigger-template.yaml similarity index 50% rename from tekton-pipeline/triggers/build-deploy-trigger.yaml rename to tekton-pipeline/triggers/trigger-template.yaml index 5215607..76e2428 100644 --- a/tekton-pipeline/triggers/build-deploy-trigger.yaml +++ b/tekton-pipeline/triggers/trigger-template.yaml @@ -59,72 +59,3 @@ spec: resourceRef: name: image-registry-$(uid) ---- - -apiVersion: triggers.tekton.dev/v1beta1 -kind: TriggerBinding -metadata: - name: tekton-argocd-example-build-git-tb -spec: - params: - - name: git-app-repo-url - # Replace with path to the JSON resource you want, based on the Git provider that you're using (e.g. for AzureDevOps: resource.repository.remoteUrl) - value: $(body.repository.url) - - name: git-app-repo-revision - value: $(body.repository.default_branch) - ---- - -apiVersion: triggers.tekton.dev/v1beta1 -kind: EventListener -metadata: - name: tekton-argocd-example-build-el -spec: - serviceAccountName: tekton-triggers-admin - triggers: - - bindings: - - ref: tekton-argocd-example-build-git-tb - template: - ref: tekton-argocd-example-build-tt - ---- -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: argocd-app - namespace: argocd -spec: - dnsNames: - - k8s-argocd.tk - secretName: argocd-app-tls - issuerRef: - name: letsencrypt-cluster-issuer - kind: ClusterIssuer - ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: tekton-argocd-example-build-el-ingress - annotations: - cert-manager.io/cluster-issuer: letsencrypt-cluster-issuer - kubernetes.io/ingress.class: nginx - kubernetes.io/tls-acme: "true" - nginx.ingress.kubernetes.io/rewrite-target: / -spec: - rules: - - host: k8s-argocd.tk - http: - paths: - - path: /tekton-argocd-example-build-webhook/ - pathType: Prefix - backend: - service: - name: el-tekton-argocd-example-build-el - port: - number: 8080 - tls: - - hosts: - - k8s-argocd.tk - secretName: argocd-app-tls -