{"id":15747735,"url":"https://github.com/developer-guy/manage-your-functions-based-on-cloud-native-ci-cd-using-tekton","last_synced_at":"2025-05-07T05:23:54.923Z","repository":{"id":104879703,"uuid":"364517355","full_name":"developer-guy/manage-your-functions-based-on-cloud-native-ci-cd-using-tekton","owner":"developer-guy","description":"Experimenting to manage your OpenFaaS functions based on Cloud Native CICD by using Tekton Pipeline, Tekton Triggers, and Inlets","archived":false,"fork":false,"pushed_at":"2021-05-15T13:12:41.000Z","size":2539,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T06:41:36.927Z","etag":null,"topics":["inlets","openfaas","openfaas-function","openfaas-templates","tekton","tekton-dashboard","tekton-pipelines","tekton-triggers","tekton-tutorial","tektoncd"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developer-guy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-05T08:58:52.000Z","updated_at":"2022-11-12T13:25:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"f81e7a76-c8b9-4518-a977-32f1e9d022b7","html_url":"https://github.com/developer-guy/manage-your-functions-based-on-cloud-native-ci-cd-using-tekton","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-guy%2Fmanage-your-functions-based-on-cloud-native-ci-cd-using-tekton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-guy%2Fmanage-your-functions-based-on-cloud-native-ci-cd-using-tekton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-guy%2Fmanage-your-functions-based-on-cloud-native-ci-cd-using-tekton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-guy%2Fmanage-your-functions-based-on-cloud-native-ci-cd-using-tekton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developer-guy","download_url":"https://codeload.github.com/developer-guy/manage-your-functions-based-on-cloud-native-ci-cd-using-tekton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252819396,"owners_count":21809019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["inlets","openfaas","openfaas-function","openfaas-templates","tekton","tekton-dashboard","tekton-pipelines","tekton-triggers","tekton-tutorial","tektoncd"],"created_at":"2024-10-04T05:21:37.918Z","updated_at":"2025-05-07T05:23:54.903Z","avatar_url":"https://github.com/developer-guy.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Manage your OpenFaaS functions based on Cloud Native CICD by using Tekton, Tekton Triggers, and Inlets\n\nRecently, we had to talk about how we can bring GitOps principles to management of OpenFaaS functions. If you didn't read about yet, please consider to visit this [link](https://www.openfaas.com/blog/bring-gitops-to-your-openfaas-functions-with-argocd/) to get more details about that. Because, today, we won't do only CD (Continious Delivery), we'll add CI (Continious Integration) part to our demo by using [Tekton](https://tekton.dev). Also, we won't use [Argo CD](https://argoproj.github.io/argo-cd/) this time for implementing CD (Continious Delivery) instead we'll use _Tekton_ for that either. If you are curios about why we need [Tekton Triggers](https://tekton.dev/docs/triggers/) and [Inlets](https://docs.inlets.dev/#/get-started/quickstart-k8s-pod), let me explain this a little bit. We'll achieve this demo on our local Kubernetes environment which is [KinD](https://kind.sigs.k8s.io) in this case, and we also need to subscribe to repository events that send by Github to trigger our _Tekton Pipeline_. So we need to find a way to susbcribe those events, and this is where _Tekton Triggers_ comes into the picture. So, we said that everyhing is in local, so, we should open our local services to the internet, Github in this case, to be able Github send events to our event listener, and this is where _Inlets_, a Cloud Native Tunnel, comes in to the picture. At the end of, we will set up a chain like the following:\n\nGithub W/webhook --\u003e Send Events --\u003e Tekton Trigger (installed on KinD)'s Event Listener --\u003e Triggers Tekton Pipeline (installed on KinD)\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**\n\n- [Prerequisites](#prerequisites)\n- [Demo](#demo)\n  - [Set up KinD cluster](#set-up-kind-cluster)\n  - [Instal OpenFaaS Operator](#instal-openfaas-operator)\n  - [Install Tekton and Tekton Trigger](#install-tekton-and-tekton-trigger)\n  - [Give Access to Local Services](#give-access-to-local-services)\n  - [Install Tekton Dashboard](#install-tekton-dashboard)\n  - [Test](#test)\n- [Furtermore](#furtermore)\n- [References](#references)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Prerequisites\n\n* kind v0.10.0\n* arkade v0.7.13\n* kubectl v1.21.0\n* helm v3.5.4+g1b5edb6\n* tkn v0.18.0\n\n## Demo\nLet's start with explaining a little bit what we want to achieve in this demo. We have a git repository that includes our function code and manifest files for the function. This repository is basically our [Source of the truth](https://en.wikipedia.org/wiki/Single_source_of_truth). We can monitor this repository for changes by    using some kind of listener that _Tekton Triggers_ provides us. Whenever we do some changes in our  git repository, _Tekton Triggers_ will kick in and create _Tekton_  pipeline for us. This pipeline will run some sequential tasks such as cloning repository, building image etc. And the result, our new function will get deployed on our cluster. There is an important detail here. To get notified by the Github for the changes about the repository, we should provide a some kind of endpoint we expose from our local environment because we will do this demo on our local machine, so, somehow, Github should be able to send events to our listener. To do so, we'll use _inlets_, a cloud native tunnel. \n\n### Set up KinD cluster\nLet's start with creating a local Kubernetes cluster first.\n```bash\n$ kind create cluster --name tekton --config kind-config.yaml\nCreating cluster \"tekton\" ...\n ✓ Ensuring node image (kindest/node:v1.20.2) 🖼\n ✓ Preparing nodes 📦 📦 📦\n ✓ Writing configuration 📜\n ✓ Starting control-plane 🕹️\n ✓ Installing CNI 🔌\n ✓ Installing StorageClass 💾\n ✓ Joining worker nodes 🚜\nSet kubectl context to \"kind-tekton\"\nYou can now use your cluster with:\n\nkubectl cluster-info --context kind-tekton\n\nThanks for using kind! 😊\n```\n\n### Instal OpenFaaS Operator\n\nFirst thing we need to do is installing [OpenFaaS Operator](https://github.com/openfaas/faas-netes/blob/master/README-OPERATOR.md) in order to define functions as [Custom Resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/).\n\n```bash\n$  helm repo add openfaas https://openfaas.github.io/faas-netes/\n\"openfaas\" already exists with the same configuration, skipping\n\n$ arkade install openfaas --operator=true --clusterrole=true\nUsing Kubeconfig: /Users/batuhan.apaydin/.kube/config\nClient: x86_64, Darwin\n2021/05/07 00:39:49 User dir established as: /Users/batuhan.apaydin/.arkade/\n\"openfaas\" already exists with the same configuration, skipping\n\nHang tight while we grab the latest from your chart repositories...\n...Successfully got an update from the \"openfaas\" chart repository\nUpdate Complete. ⎈Happy Helming!⎈\n\nVALUES values.yaml\nCommand: /Users/batuhan.apaydin/.arkade/bin/helm [upgrade --install openfaas openfaas/openfaas --namespace openfaas --values /var/folders/pf/6h9t0mnd4d342ncgpjq_3zl80000gp/T/charts/openfaas/values.yaml --set queueWorker.replicas=1 --set operator.create=true --set openfaasImagePullPolicy=IfNotPresent --set gateway.replicas=1 --set basicAuthPlugin.replicas=1 --set ingressOperator.create=false --set queueWorker.maxInflight=1 --set basic_auth=true --set serviceType=NodePort --set clusterRole=true --set gateway.directFunctions=false --set faasnetes.imagePullPolicy=Always]\nRelease \"openfaas\" does not exist. Installing it now.\nW0507 00:39:56.575987   29938 warnings.go:70] rbac.authorization.k8s.io/v1beta1 ClusterRole is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 ClusterRole\nW0507 00:39:56.670971   29938 warnings.go:70] rbac.authorization.k8s.io/v1beta1 ClusterRole is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 ClusterRole\nNAME: openfaas\nLAST DEPLOYED: Fri May  7 00:39:56 2021\nNAMESPACE: openfaas\nSTATUS: deployed\nREVISION: 1\nTEST SUITE: None\nNOTES:\nTo verify that openfaas has started, run:\n\n  kubectl -n openfaas get deployments -l \"release=openfaas, app=openfaas\"\n2021/05/07 00:39:56 stderr: W0507 00:39:56.575987   29938 warnings.go:70] rbac.authorization.k8s.io/v1beta1 ClusterRole is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 ClusterRole\nW0507 00:39:56.670971   29938 warnings.go:70] rbac.authorization.k8s.io/v1beta1 ClusterRole is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 ClusterRole\n\n=======================================================================\n= OpenFaaS has been installed.                                        =\n=======================================================================\n\n# Get the faas-cli\ncurl -SLsf https://cli.openfaas.com | sudo sh\n\n# Forward the gateway to your machine\nkubectl rollout status -n openfaas deploy/gateway\nkubectl port-forward -n openfaas svc/gateway 8080:8080 \u0026\n\n# If basic auth is enabled, you can now log into your gateway:\nPASSWORD=$(kubectl get secret -n openfaas basic-auth -o jsonpath=\"{.data.basic-auth-password}\" | base64 --decode; echo)\necho -n $PASSWORD | faas-cli login --username admin --password-stdin\n\nfaas-cli store deploy figlet\nfaas-cli list\n\n# For Raspberry Pi\nfaas-cli store list \\\n --platform armhf\n\nfaas-cli store deploy figlet \\\n --platform armhf\n\n# Find out more at:\n# https://github.com/openfaas/faas\n\nThanks for using arkade!\n```\n\nVerify if everything is working before move on the the next step.\n```bash\n$ kubectl get pods --namespace openfaas\nNAME                                 READY   STATUS    RESTARTS   AGE\nalertmanager-57949bdf6c-g8pzh        1/1     Running   0          2m58s\nbasic-auth-plugin-54bbd886f5-sxglp   1/1     Running   0          2m58s\ngateway-665cb9c8b4-zwz87             2/2     Running   0          2m58s\nnats-695bf7587-qdsmn                 1/1     Running   0          2m58s\nprometheus-76fb66cd4c-pkpvr          1/1     Running   0          2m58s\nqueue-worker-658f8b5df7-mhdwd        1/1     Running   2          2m58s\n\n$ kubectl get customresourcedefinitions.apiextensions.k8s.io\nNAME                     CREATED AT\nfunctions.openfaas.com   2021-05-06T21:39:56Z\nprofiles.openfaas.com    2021-05-06T21:39:56Z\n```\n\n### Install Tekton and Tekton Trigger\n\nFollowing that, we should install _Tekton_ and _Tekton Trigger_ components.\n```bash\n# Tekton installation\n$ kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml\nnamespace/tekton-pipelines created\npodsecuritypolicy.policy/tekton-pipelines created\nclusterrole.rbac.authorization.k8s.io/tekton-pipelines-controller-cluster-access created\nclusterrole.rbac.authorization.k8s.io/tekton-pipelines-controller-tenant-access created\nclusterrole.rbac.authorization.k8s.io/tekton-pipelines-webhook-cluster-access created\nrole.rbac.authorization.k8s.io/tekton-pipelines-controller created\nrole.rbac.authorization.k8s.io/tekton-pipelines-webhook created\nrole.rbac.authorization.k8s.io/tekton-pipelines-leader-election created\nserviceaccount/tekton-pipelines-controller created\nserviceaccount/tekton-pipelines-webhook created\nclusterrolebinding.rbac.authorization.k8s.io/tekton-pipelines-controller-cluster-access created\nclusterrolebinding.rbac.authorization.k8s.io/tekton-pipelines-controller-tenant-access created\nclusterrolebinding.rbac.authorization.k8s.io/tekton-pipelines-webhook-cluster-access created\nWarning: rbac.authorization.k8s.io/v1beta1 RoleBinding is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 RoleBinding\nrolebinding.rbac.authorization.k8s.io/tekton-pipelines-controller created\nrolebinding.rbac.authorization.k8s.io/tekton-pipelines-webhook created\nrolebinding.rbac.authorization.k8s.io/tekton-pipelines-controller-leaderelection created\nrolebinding.rbac.authorization.k8s.io/tekton-pipelines-webhook-leaderelection created\ncustomresourcedefinition.apiextensions.k8s.io/clustertasks.tekton.dev created\ncustomresourcedefinition.apiextensions.k8s.io/conditions.tekton.dev created\ncustomresourcedefinition.apiextensions.k8s.io/pipelines.tekton.dev created\ncustomresourcedefinition.apiextensions.k8s.io/pipelineruns.tekton.dev created\ncustomresourcedefinition.apiextensions.k8s.io/pipelineresources.tekton.dev created\ncustomresourcedefinition.apiextensions.k8s.io/runs.tekton.dev created\ncustomresourcedefinition.apiextensions.k8s.io/tasks.tekton.dev created\ncustomresourcedefinition.apiextensions.k8s.io/taskruns.tekton.dev created\nsecret/webhook-certs created\nvalidatingwebhookconfiguration.admissionregistration.k8s.io/validation.webhook.pipeline.tekton.dev created\nmutatingwebhookconfiguration.admissionregistration.k8s.io/webhook.pipeline.tekton.dev created\nvalidatingwebhookconfiguration.admissionregistration.k8s.io/config.webhook.pipeline.tekton.dev created\nclusterrole.rbac.authorization.k8s.io/tekton-aggregate-edit created\nclusterrole.rbac.authorization.k8s.io/tekton-aggregate-view created\nconfigmap/config-artifact-bucket created\nconfigmap/config-artifact-pvc created\nconfigmap/config-defaults created\nconfigmap/feature-flags created\nconfigmap/config-leader-election created\nconfigmap/config-logging created\nconfigmap/config-observability created\nconfigmap/config-registry-cert created\ndeployment.apps/tekton-pipelines-controller created\nservice/tekton-pipelines-controller created\nhorizontalpodautoscaler.autoscaling/tekton-pipelines-webhook created\ndeployment.apps/tekton-pipelines-webhook created\nservice/tekton-pipelines-webhook created\n\n\n# Tekton Trigger installation\n$ kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml\npodsecuritypolicy.policy/tekton-triggers created\nclusterrole.rbac.authorization.k8s.io/tekton-triggers-admin created\nclusterrole.rbac.authorization.k8s.io/tekton-triggers-core-interceptors created\nrole.rbac.authorization.k8s.io/tekton-triggers-admin created\nrole.rbac.authorization.k8s.io/tekton-triggers-admin-webhook created\nrole.rbac.authorization.k8s.io/tekton-triggers-core-interceptors created\nserviceaccount/tekton-triggers-controller created\nserviceaccount/tekton-triggers-webhook created\nserviceaccount/tekton-triggers-core-interceptors created\nclusterrolebinding.rbac.authorization.k8s.io/tekton-triggers-controller-admin created\nclusterrolebinding.rbac.authorization.k8s.io/tekton-triggers-webhook-admin created\nclusterrolebinding.rbac.authorization.k8s.io/tekton-triggers-core-interceptors created\nrolebinding.rbac.authorization.k8s.io/tekton-triggers-controller-admin created\nrolebinding.rbac.authorization.k8s.io/tekton-triggers-webhook-admin created\nrolebinding.rbac.authorization.k8s.io/tekton-triggers-core-interceptors created\ncustomresourcedefinition.apiextensions.k8s.io/clusterinterceptors.triggers.tekton.dev created\ncustomresourcedefinition.apiextensions.k8s.io/clustertriggerbindings.triggers.tekton.dev created\ncustomresourcedefinition.apiextensions.k8s.io/eventlisteners.triggers.tekton.dev created\ncustomresourcedefinition.apiextensions.k8s.io/triggers.triggers.tekton.dev created\ncustomresourcedefinition.apiextensions.k8s.io/triggerbindings.triggers.tekton.dev created\ncustomresourcedefinition.apiextensions.k8s.io/triggertemplates.triggers.tekton.dev created\nsecret/triggers-webhook-certs created\nvalidatingwebhookconfiguration.admissionregistration.k8s.io/validation.webhook.triggers.tekton.dev created\nmutatingwebhookconfiguration.admissionregistration.k8s.io/webhook.triggers.tekton.dev created\nvalidatingwebhookconfiguration.admissionregistration.k8s.io/config.webhook.triggers.tekton.dev created\nclusterrole.rbac.authorization.k8s.io/tekton-triggers-aggregate-edit created\nclusterrole.rbac.authorization.k8s.io/tekton-triggers-aggregate-view created\nconfigmap/config-logging-triggers created\nconfigmap/config-observability-triggers created\nservice/tekton-triggers-controller created\ndeployment.apps/tekton-triggers-controller created\nservice/tekton-triggers-webhook created\ndeployment.apps/tekton-triggers-webhook created\n\n$ kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/latest/interceptors.yaml\ndeployment.apps/tekton-triggers-core-interceptors created\nservice/tekton-triggers-core-interceptors created\nclusterinterceptor.triggers.tekton.dev/cel created\nclusterinterceptor.triggers.tekton.dev/bitbucket created\nclusterinterceptor.triggers.tekton.dev/github created\nclusterinterceptor.triggers.tekton.dev/gitlab created\n```\n\nVerify if everything is working before move on to the next step.\n```bash\n$ kubectl get pods --namespace tekton-pipelines\nNAME                                                 READY   STATUS    RESTARTS   AGE\ntekton-pipelines-controller-6b94f5f96-wnlv6          1/1     Running   0          3m37s\ntekton-pipelines-webhook-5bfbbd6475-c5lz7            1/1     Running   0          3m37s\ntekton-triggers-controller-7cbd49fbb8-xl9fs          1/1     Running   0          2m21s\ntekton-triggers-core-interceptors-5d7f674ccc-sq7sn   1/1     Running   0          94s\ntekton-triggers-webhook-748fb7778c-26x87             1/1     Running   0          2m21s\n```\nBefore creating the tasks, pipelines and triggers, we should create a bunch of resources.\n```bash\n$ kubectl apply -f git-source-pvc.yaml\npersistentvolumeclaim/myclaim created\n\n$ kubectl apply -f serviceaccount.yaml\nserviceaccount/pipeline-account created\nsecret/kube-api-secret created\nrole.rbac.authorization.k8s.io/pipeline-role created\nrolebinding.rbac.authorization.k8s.io/pipeline-role-binding created\n\n$ kubectl create secret docker-registry regcred \\\n  --docker-username=$USERNAME \\\n  --docker-password=$PASSWORD \\\n  --docker-email=$EMAIL\nsecret/regcred created\n```\n\nNow, it is time to create tasks, pipelines and triggers.\n```bash\n$ kubectl apply -f tasks\ntask.tekton.dev/deploy-using-kubectl created\ntask.tekton.dev/faas-cli-build created\ntask.tekton.dev/git-clone created\ntask.tekton.dev/kaniko created\n\n$ tkn task list\nNAME                   DESCRIPTION              AGE\ndeploy-using-kubectl                            5 seconds ago\nfaas-cli-build         This task create a ...   5 seconds ago\ngit-clone              These Tasks are Git...   5 seconds ago\nkaniko                 This Task builds so...   5 seconds ago\n\n$ kubectl apply -f pipeline/build-and-deploy-pipeline.yaml\npipeline.tekton.dev/build-and-deploy created\n\n$ tkn pipeline list\nNAME               AGE             LAST RUN   STARTED   DURATION   STATUS\nbuild-and-deploy   6 seconds ago   ---        ---       ---        ---\n\n$ kubectl apply -f triggers\neventlistener.triggers.tekton.dev/github-listener-interceptor created\ntriggerbinding.triggers.tekton.dev/github-pr-binding created\ntriggertemplate.triggers.tekton.dev/github-template created\nserviceaccount/tekton-triggers-example-sa created\nrole.rbac.authorization.k8s.io/tekton-triggers-example-minimal created\nrolebinding.rbac.authorization.k8s.io/tekton-triggers-example-binding created\nclusterrole.rbac.authorization.k8s.io/tekton-triggers-example-clusterrole created\nclusterrolebinding.rbac.authorization.k8s.io/tekton-triggers-example-clusterbinding created\n```\n\nVerify if everyting is working before move on to the next step.\n```bash\n$ kubectl get pods\nNAME                                              READY   STATUS    RESTARTS   AGE\nel-github-listener-interceptor-7bc945b898-cqd9b   1/1     Running   0          2m20s\n```\n\n### Give Access to Local Services\n\nThis is our listener Pod that I mentioned earlier, we should expose it to the internet using _inlets_. Let's do this.\n```bash\n$ kubectl port-forward svc/el-github-listener-interceptor 8080\nForwarding from 127.0.0.1:8080 -\u003e 8000\nForwarding from [::1]:8080 -\u003e 8000\n\n$ inlets-pro http client --token=$TOKEN --url=$WSS --upstream http://127.0.0.1:8080 --license-file $HOME/.inlets/LICENSE --auto-tls=false\n2021/05/07 01:07:51 Starting HTTP client. Version 0.8.0-dirty - 7d2137f283e67490d64ea68903f7d49b9c9463c3\n2021/05/07 01:07:51 Licensed to: Batuhan Apaydın \u003cblbla.com\u003e, expires: 60 day(s)\n2021/05/07 01:07:51 Upstream:  =\u003e http://127.0.0.1:8080\n2021/05/07 01:07:51 Token: \"$TOKEN\nINFO[2021/05/07 01:07:51] Connecting to proxy  url=\"$WSS\"\n```\n\nNow, we are ready to create a webhook in Github and give this address to it, but before doing that, we should a create secret for the webhook.\n```bash\n# create github secret\n$ export TEKTON_TUTORIAL_SECRET_TOKEN=${TEKTON_TUTORIAL_SECRET_TOKEN-$(head -c 24 /dev/random | base64)}\nkubectl create secret generic github-secret --from-literal=secretToken=$TEKTON_TUTORIAL_SECRET_TOKEN\necho \"TEKTON_TUTORIAL_SECRET_TOKEN: $TEKTON_TUTORIAL_SECRET_TOKEN\"\n```\nWe defined [hello-function](https://github.com/developer-guy/hello-function/) repository as our _Source of the Truth_. So, the next step, we will define webhook for it.\n\n![webhook](./assets/webhook.png)\n\nNow, as soon as we change the code in the repository, we should be able to see the pipeline kick in and create the function for us.\n\n![demo](./assets/hello_function_demo.png)\n\n### Install Tekton Dashboard\n\n_Tekton_ has another great project called [Tekton Dashboard](https://github.com/tektoncd/dashboard). _Tekton Dashboard_ is a general purpose, web-based UI for Tekton Pipelines and Tekton triggers resources. We can easily install this to our cluster and see what's goin' on our cluster. Run the following command to install Tekton Dashboard and its dependencies:\n```bash\n$ kubectl apply --filename https://storage.googleapis.com/tekton-releases/dashboard/latest/tekton-dashboard-release.yaml\ncustomresourcedefinition.apiextensions.k8s.io/extensions.dashboard.tekton.dev created\nserviceaccount/tekton-dashboard created\nclusterrole.rbac.authorization.k8s.io/tekton-dashboard-backend created\nclusterrole.rbac.authorization.k8s.io/tekton-dashboard-dashboard created\nclusterrole.rbac.authorization.k8s.io/tekton-dashboard-extensions created\nclusterrole.rbac.authorization.k8s.io/tekton-dashboard-pipelines created\nclusterrole.rbac.authorization.k8s.io/tekton-dashboard-tenant created\nclusterrole.rbac.authorization.k8s.io/tekton-dashboard-triggers created\nclusterrolebinding.rbac.authorization.k8s.io/tekton-dashboard-backend created\nservice/tekton-dashboard created\ndeployment.apps/tekton-dashboard created\nrolebinding.rbac.authorization.k8s.io/tekton-dashboard-pipelines created\nrolebinding.rbac.authorization.k8s.io/tekton-dashboard-dashboard created\nrolebinding.rbac.authorization.k8s.io/tekton-dashboard-triggers created\nclusterrolebinding.rbac.authorization.k8s.io/tekton-dashboard-tenant created\nclusterrolebinding.rbac.authorization.k8s.io/tekton-dashboard-extensions created\n```\n\u003e To get more details about the installation of Tekton Dashboard, you can follow the [link](https://github.com/tektoncd/dashboard/blob/main/docs/install.md).\n\nYou can simple access to your dashboard with running the following command:\n```bash\n$ kubectl --namespace tekton-pipelines port-forward svc/tekton-dashboard 9097:9097\nForwarding from 127.0.0.1:9097 -\u003e 9097\nForwarding from [::1]:9097 -\u003e 9097\n\n$ open http://localhost:9097\n```\n\nYou should see a screen like the following:\n\n![dashboard](./assets/dashboard.png)\n\n### Test\n\nFinally, let's test our function, to do so, we should access the _OpenFaaS Gateway_ component.\n```bash\n$ kubectl port-forward svc/gateway -n openfaas 8081:8080\nForwarding from 127.0.0.1:8081 -\u003e 8080\nForwarding from [::1]:8081 -\u003e 8080\n\n$ httpie POST http://localhost:8081/function/hellofunction.default message=\"Hello World\"\nHTTP/1.1 200 OK\nContent-Length: 35\nContent-Type: text/plain; charset=utf-8\nDate: Fri, 07 May 2021 08:35:44 GMT\nX-Call-Id: 0ee19dd7-2c09-4093-9b6e-0755836afb9c\nX-Duration-Seconds: 0.004628\nX-Start-Time: 1620376544209429100\n\nBody v6: {\"message\": \"Hello World\"}\n```\n\nTadaaaa 🎉😋✅\n\n## Furtermore\n\nAs I mentioned earlier, we can use _Tekton_ and _Tekton Trigger_ for CI Part, and we can use Argo CD for CD part. We can set up Argo CD for monitoring changes againts our git repository, so, we don't have to use deploy Task in our pipeline anymore, the only thing we have to do is updating the manifest file, and Argo CD will take care of the rest.\n\n## References\n\n* [Exploring Tekton](https://www.jetstack.io/blog/exploring-tekton/)\n* [Cloud Native CI/CD with Tekton - Laying The Foundation](https://martinheinz.dev/blog/45)\n* [The Seven Steps to build a Cloud Native CI/CD for GitHub repos using Tekton](https://blog.harbur.io/the-seven-steps-to-build-a-cloud-native-ci-cd-for-github-repos-using-tekton-31a445a3bde7)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper-guy%2Fmanage-your-functions-based-on-cloud-native-ci-cd-using-tekton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloper-guy%2Fmanage-your-functions-based-on-cloud-native-ci-cd-using-tekton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper-guy%2Fmanage-your-functions-based-on-cloud-native-ci-cd-using-tekton/lists"}