Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bring-gitops-to-your-functions-with-argocd-part-2-the-missing-piece-tekton #230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

developer-guy
Copy link
Contributor

Signed-off-by: Batuhan Apaydın [email protected]

Description

I added the CI part with the Tekton to manage the OpenFaaS functions

Motivation and Context

I added the CI part with the Tekton to manage the OpenFaaS functions

Have you applied the editorial and style guide to your post?

See the README.md

How have you tested the instructions for any tutorial steps?

Types of changes

  • New blog post
  • Updating an existing blog post
  • Updating part of the page page
  • Adding a new web-page

Checklist:

  • I have given attribution for any images I have used and have permission to use them under Copyright law
  • My code follows the writing-style of the publication and I have checked this
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s

@developer-guy developer-guy force-pushed the feature/manage-your-functions-through-tekton branch 3 times, most recently from 12f62ff to 1aea44c Compare May 15, 2021 16:34
@alexellis
Copy link
Member

images/bring-gitops-to-your-functions-with-argocd-part-2-the-missing-piece-tekton/argo_cd_tekton.png

This file is 1.1MB so it will take a long time to download on a slow connection.

Try resizing smaller, or do as I do and convert to JPEG with 70+/-% compression.

@@ -0,0 +1,612 @@
---
title: "Bring GitOps to your OpenFaaS functions with Argo CD - The missing piece of the pipeline: Tekton"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This title has a lot going on, and I'm not sure that people will click on it if they saw it in a newsletter.

Can we take a more practical approach of problem/benefit? Isn't this blog post about CI?

I'd prefer something like:

Learn how to build your OpenFaaS Functions with Tekton.


### Setup

### 1. Provision a local Kubernetes Cluster with KinD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove everything between 1 and point 3, since it's all duplicated from the previous blog post.

Instead of repeating all the content, can you link to the previous blog post and then focus on the new parts?


There are various ways to install _Tekton_ and _Tekton Trigger_ Trigger, one of them is _Tekton Operator_, and the other one is just with plain YAML manifest. We are going to deploy Tekton and Tekton Trigger with plain YAML manifest in this section.

To get more detail about _Tekton Operator_, pleae refer to this [link](https://github.com/tektoncd/operator).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pleae -> please

I use a spell checker when I write blog posts in VSCode, or copy and paste to a Google Doc to look for typos.


### 3. Deploy Tekton and Tekton Trigger

There are various ways to install _Tekton_ and _Tekton Trigger_ Trigger, one of them is _Tekton Operator_, and the other one is just with plain YAML manifest. We are going to deploy Tekton and Tekton Trigger with plain YAML manifest in this section.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line isn't adding anything because you don't compare or explain the various parts or ways.

In which case you could remove it completely and just say which away you are going to install Tekton, and link to their docs.


Let's install _Tekton_.

```bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why aren't we using arkade for this? Does the app need changing / updating?

Let's install _Tekton Trigger_.

```bash
$ kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the output is unnecessary.

You haven't defined anywhere what "Tekton Trigger" is and what the differences are. Please do that.

$ cd manage-your-functions-based-on-cloud-native-ci-cd-using-tekton
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
# save as tekton / tekton.pub
# add tekton.pub contents to GitHub
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add tekton.pub contents to GitHub

Are you talking about a Deploy key in the repo? If so, then show a screenshot and explain to them how to do this.

Resolving deltas: 100% (47/47), done.
```

Before installing them we do some kind of initial set up for the pipelines such as granting necessary permissions by creating RBAC, creating ssh-key to be able commit&push to the repository, creating git source as PersistentVolumeClaim, creating a secrets which contains dockerhub credentials, and ssh-key information etc.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather see you split up each of these sections and explain each one before giving the command. There's a lot going on here, so give the reader a chance to absorb it.

dockerhub => Docker Hub
commit&push => commit and push

build-and-deploy 17 seconds ago --- --- --- ---

$ kubectl apply -f triggers/
eventlistener.triggers.tekton.dev/github-listener-interceptor created
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this output showing created objects. It doesn't add anything.

xxxxx
```

Let's make it reachable our EventListener.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our event Listener needs to receive HTTP messages from X. Therefore create an inlets tunnel so that Y.

Forwarding from 127.0.0.1:8080 -> 8000
Forwarding from [::1]:8080 -> 8000

$ inlets-pro http client --token=$TOKEN --url=$WSS --upstream http://127.0.0.1:8080 --license-file $HOME/.inlets/LICENSE --auto-tls=false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how you created the inlets server? Have you skipped over all that part?


```bash
$ kubectl apply --filename https://storage.googleapis.com/tekton-releases/dashboard/latest/tekton-dashboard-release.yaml
customresourcedefinition.apiextensions.k8s.io/extensions.dashboard.tekton.dev created
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the output.


I recommend you to divide screen into two part, one for Argo CD UI and one for Tekton UI to follow the process before making any changes on your repository.

![follow_process](/images/bring-gitops-to-your-functions-with-argocd-part-2-the-missing-piece-tekton/follow_process.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the folder bring-gitops-to-your-functions-with-argocd-part-2-the-missing-piece-tekton to 2021-06-tekton

Body v6: {"message": "Hello World"}
```

Tadaaaa 🎉😋✅
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a really long blog post and we did so much, so please summarise it all here instead of finishing with just Tada 🙂


## Introduction

We talked about _How we can bring GitOps principles to management of OpenFaaS functions_ in the previous blog post. If you haven't read it yet, you can follow this [link](https://www.openfaas.com/blog/bring-gitops-to-your-openfaas-functions-with-argocd/), because it might help you to understand the all of the pieces of CI/CD pipeline we want to build here. In this guide, we'll add CI (Continious Integration) part to our pipeline by using _Tekton_. After that, to be able to trigger this pipeline based on _Github_ events, we'll use an another component of [Tekton](https://tekton.dev) called [Tekton Trigger](https://tekton.dev/docs/triggers/). We will do this demo using KinD on a kubernetes running locally. Because of we are in a private network, we have to listen 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 this tutorial, we'll have a pipeline like the following:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to break this up into two smaller paragraphs so that it's more likely people will read it.

Add a link for inlets. Add a link for GitHub and write it as "GitHub" (not Github)


---

In this post you'll learn how to combine these two technologies ArgoCD and Tekton to build fully automated CI/CD pipeline which can be triggerred by Github to manage OpenFaaS functions based on GitOps principles in your local environment using a Cloud Native Tunnel called Inlets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too much jargon.

Learn how to trigger builds of your functions from GitHub using Tekton. Then connect them to Argo CD so that you can deploy as new versions are created.

Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent technical article, we just need to make it more digestible for people who are not Argo and Tekton experts now.

Looking forward to the next version.

@developer-guy developer-guy force-pushed the feature/manage-your-functions-through-tekton branch from 1aea44c to f3d440d Compare June 4, 2021 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants