Reader small image

You're reading from  Building CI/CD Systems Using Tekton

Product typeBook
Published inSep 2021
PublisherPackt
ISBN-139781801078214
Edition1st Edition
Right arrow
Author (1)
Joel Lord
Joel Lord
author image
Joel Lord

Joel Lord (joel__lord on Twitter) is passionate about the web and technology in general. He likes to learn new things, but most of all, he wants to share his discoveries. He does so by traveling to various conferences all across the globe. He graduated from college with a degree in computer programming in the last millennium. Apart from a little break to get his BSc in computational astrophysics, he has always worked in the industry. In his daily job, Joel is a developer advocate with MongoDB, where he connects with software engineers to help them make the web better by using best practices around JavaScript. In his free time, he can be found stargazing on a campground somewhere or brewing a fresh batch of beer in his garage.
Read more about Joel Lord

Right arrow

Chapter 3: Installation and Getting Started

Now that you have a better understanding of what cloud-native continuous integration/continuous deployment (CI/CD) pipelines are all about, it's time to get your hands dirty and start exploring Tekton. In order to use Tekton locally, there are some tools that you will need on your computer.

In this section of the book, you will learn how to set up everything you need to navigate the exercises in the book. The first step will be to configure your development environment. As a software developer, you probably have most of the required tooling already installed, but it's still a good idea to take a minute to ensure this is the case.

Next, you will need to install the appropriate container runtime to run some of the hands-on examples provided in this book.

Once you have everything locally installed, you will also need a Kubernetes cluster in which Tekton will live. There are many options available to you. In this section...

Technical requirements

Check out the following link to see the Code in Action video: https://bit.ly/3BIR5tO

Setting up a developer environment

While this book is not specifically about coding, there will still be code samples that are used from time to time. While it is not specifically necessary to understand and execute those code samples, it can be interesting to do so. The following tools will let you run those samples on your local machine.

All of the YAML Ain't Markup Language (YAML) files that are described in this book also appear in a shared Git repository (more details on this in the next section). In order to access these files, using Git and Visual Studio Code (VS Code) will make it easier for you.

Git

The first tool that you will need is Git. Git is a code versioning system that is free and open source. Developers use this tool to store source code in a common place and view the history of all code changes. It is used in most software engineering teams as a standard way to collaborate on a joint project.

To install Git, you can go to https://git-scm.com/downloads...

Installing a container runtime and setting up a registry

In some of the examples in this book, and to install minikube later, you will need to pick a runtime to run containers. There are many different options available to you. In this section, we will focus on the most popular choice, which is Docker.

The specific usage of containers is outside the scope of this book, but you can find more information about containers in a presentation by yours truly at http://ezurl.to/containers.

Docker

Docker, from the eponymous company, is the most popular option out there. This is especially true if you are using a Windows or macOS operating system. To run containers, you technically have to use a Linux operating system. Docker will take care of creating a virtual machine (VM) and will run the containers in there.

You can install Docker by visiting their Getting Started with Docker page at https://docker.com/get-started. From there, you can download the executable for your operating...

Picking a Kubernetes distribution (local, cloud, hosted)

Tekton runs inside a Kubernetes cluster, so to do any of the exercises in this book, you will need access to such a cluster. Many options can run locally on your machine or in the cloud, and range from free to thousands of US dollars (USD) per month.

If you already have a Kubernetes cluster available to you, feel free to skip this section and use your own.

If you do need access to your own Kubernetes cluster to experiment with the examples from this book, I recommend using a Kubernetes distribution that runs locally.

minikube

The easiest way to get started with Kubernetes is by running a micro distribution on your computer. There are many micro distributions available, such as MicroK8s by Canonical and K3s by Rancher. The one that will be used here is by the Cloud Native Computing Foundation (CNCF) and is called minikube.

You will find the download and installation instructions for minikube on any operating...

Connecting to your Kubernetes cluster

To interact with your Kubernetes cluster, you will need a CLI tool called kubectl. If you've already interacted with a Kubernetes cluster, you are most likely familiar with this tool. If you don't have it installed already, you can go to the Kubernetes official website and follow your operating system's installation instructions. You can find all the information needed for the kubectl installation at https://kubernetes.io/docs/tasks/tools/install-kubectl/.

Once the tool has been installed, you can test it out with the following command:

$ kubectl version 

This command should output the current version of kubectl.

You will also need to configure kubectl to use your existing cluster. If you are using minikube, you can restart your cluster. When using minikube start, it will automatically configure kubectl for you.

For minikube, type the following command:

$ minikube stop && minikube start 

If you are...

Preparing the Tekton tooling

Now that you have all the necessary tooling to run Tekton, it's time to get started with Tekton itself. The first step will be to install one final CLI tool to interact with Tekton. You can find this tool along with the installation instructions for your operating system at https://tekton.dev/docs/getting-started/#set-up-the-cli. If you prefer, you can also find the latest release directly on the GitHub repository at https://github.com/tektoncd/cli/releases/tag/v0.16.0.

Throughout this book, I will be using version 0.16.0 of the client.

You are now done with the installation of all the required tooling that will be needed for this book and to interact with any Tekton pipeline. The next step will be to install Tekton on your Kubernetes cluster. This command will install all the CRDs to be able to run Tekton Tasks and Pipelines. To install Tekton from your command line, use kubectl to fetch and install the latest release, as follows:

$ kubectl...

Summary

That's it! You are now ready to get started with Tekton. In this chapter, you've installed all the necessary tools that you will need to follow along with the hands-on examples provided in this book.

You've set up your development environment with tools to run the Node.js examples that will be presented. You can also clone the source code from this book's repository now that you have Git installed. Additionally, you now have a code editor equipped with powerful plugins that will make it easier for you to build your Tekton Pipelines.

You've also configured your Kubernetes cluster and the management CLI tool. In this book, I will be using minikube, but you can use just about any Kubernetes cluster that you have access to.

Finally, you've installed Tekton—the CLI and the dashboard. Those are the tools you will use in the next chapters to create your CI/CD pipelines.

You are now ready to get started with Tekton, and in the next...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Building CI/CD Systems Using Tekton
Published in: Sep 2021Publisher: PacktISBN-13: 9781801078214
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Joel Lord

Joel Lord (joel__lord on Twitter) is passionate about the web and technology in general. He likes to learn new things, but most of all, he wants to share his discoveries. He does so by traveling to various conferences all across the globe. He graduated from college with a degree in computer programming in the last millennium. Apart from a little break to get his BSc in computational astrophysics, he has always worked in the industry. In his daily job, Joel is a developer advocate with MongoDB, where he connects with software engineers to help them make the web better by using best practices around JavaScript. In his free time, he can be found stargazing on a campground somewhere or brewing a fresh batch of beer in his garage.
Read more about Joel Lord