The DevOps 2.4 Toolkit
Viktor Farcic
- 398 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
The DevOps 2.4 Toolkit
Viktor Farcic
About This Book
An exploration of continuous deployment to a Kubernetes cluster, using a wide range of Kubernetes platforms with instructions on how to develop a pipeline on a few of the most commonly used CI/CD platforms.Key Features⢠The fifth book of DevOps expert Viktor Farcic's bestselling DevOps Toolkit series, with a discussion of the difference between continuous delivery vs. continuous deployment, and which is best for the user⢠Guides readers through the continuous deployment process using Jenkins in a Kubernetes cluster⢠Provides an overview of the best practices for building, testing, and deploying applications through fully automated pipelines.Book DescriptionBuilding on The DevOps 2.3 Toolkit: Kubernetes, Viktor Farcic brings his latest exploration of the Docker technology as he records his journey to continuously deploying applications with Jenkins into a Kubernetes cluster.The DevOps 2.4 Toolkit: Continuously Deploying Applications with Jenkins to a Kubernetes Cluster is the latest book in Viktor Farcic's series that helps you build a full DevOps Toolkit. This book guides readers through the process of building, testing, and deploying applications through fully automated pipelines.Within this book, Viktor will cover a wide-range of emerging topics, including an exploration of continuous delivery and deployment in Kubernetes using Jenkins. It also shows readers how to perform continuous integration inside these clusters, and discusses the distribution of Kubernetes applications, as well as installing and setting up Jenkins.Work with Viktor and dive into the creation of self-adaptive and self-healing systems within Docker.What you will learn⢠Gain an understanding of continuous deployment⢠Learn how to build, test, and deploy applications into Kubernetes⢠Execute continuous integration inside containersWho this book is forReaders with an intermediate level understanding of Kubernetes and hands-on experience.
Frequently asked questions
Information
Installing and Setting Up Jenkins
Creating a Cluster and retrieving its IP
1 cd k8s-specs
2 3 git pull
- docker4mac-ip.sh: Docker for Mac with 3 CPUs, 3 GB RAM, with nginx Ingress, with tiller, and with LB_IP variable set to 127.0.0.1 (https://gist.github.com/vfarcic/66842a54ef167219dc18b03991c26edb).
- minikube-ip.sh: minikube with 3 CPUs, 3 GB RAM, with ingress, storage-provisioner, and default-storageclass addons enabled, with tiller, and with LB_IP variable set to the VM created by minikube (https://gist.github.com/vfarcic/df5518b24bc39a8b8cca95cc37617221).
- kops-ip.sh: kops in AWS with 3 t2.small masters and 2 t2.medium nodes spread in three availability zones, with nginx Ingress, with tiller, and with LB_IP variable set to the IP retrieved by pinging ELB's hostname. The Gist assumes that the prerequisites are set through Appendix B (https://gist.github.com/vfarcic/7ee11f4dd8a130b51407582505c817cb).
- minishift-ip.sh: minishift with 3 CPUs, 3 GB RAM, with version 1.16+, with tiller, and with LB_IP variable set to the VM created by minishift (https://gist.github.com/vfarcic/fa902cc2e2f43dcbe88a60138dd20932).
- gke-ip.sh: Google Kubernetes Engine (GKE) with 3 n1-highcpu-2 (2 CPUs, 1.8 GB RAM) nodes (one in each zone), and with nginx Ingress controller running on top of the "standard" one that comes with GKE, with tiller, and with LB_IP variable set to the IP of the external load balancer created when installing nginx Ingress. We'll use nginx Ingress for compatibility with other platforms. Feel free to modify the YAML files and Helm Charts if you prefer NOT to install nginx Ingress (https://gist.github.com/vfarcic/3e53def041591f3c0f61569d49ffd879).
- eks-ip.sh: Elastic Kubernetes Service (EKS) with 2 t2.medium nodes, with nginx Ingress controller, with a default StorageClass, with tiller, and with LB_IP variable set to the IP retrieved by pinging ELB's hostname (https://gist.github.com/vfarcic/f7f3956cd39c3bc55638529cfeb2ff12).
Running Jenkins
1 JENKINS_ADDR="jenkins.$LB_IP.nip.io"
2 3 echo $JENKINS_ADDR
Helm will try to install Jenkins Chart with the process in a container running as user 0. By default, that is not allowed in OpenShift. We'll skip discussing the best approach to correct the issue, and I'll assume you already know how to set the permissions on the per-Pod basis. Instead, we'll do the most straightforward fix. Please execute the command that follows to allow the creation of restricted Pods to run as any user.
oc patch scc restricted -p '{"runAsUser":{"type": "RunAsAny"}}'
1 helm install stable/jenkins \ 2 --name jenkins \ 3 --namespace jenkins \ 4 --values helm/jenkins-values.yml \ 5 --set master.hostName=$JENKINS_ADDR
1 kubectl -n jenkins \ 2 rollout status deployment jenkins
Waiting for rollout to finish: 0 of 1 updated replicas are available... deployment "jenkins" successfully rolled out
OpenShift requires Routes to make services accessible outside the cluster. To make things more complicat...