Kubernetes
Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.
A Kubernetes cluster adds a new automation layer to Jenkins. Kubernetes makes sure that resources are used effectively and that your servers and underlying infrastructure are not overloaded. Kubernetes' ability to orchestrate container deployment ensures that Jenkins always has the right amount of resources available. This section will describe different options to install/run Jenkins on Kubernetes.
Note: the documented approach with Minikube is a Quickstart guide only suited for development and testing purposes. It should not be used for production instances. Configure production instances based on the Kubernetes guidelines.
Prerequisites
- Docker
-
Refer to the Docker Engine installation instructions for your platform.
- Kubernetes
-
If you don’t have a running Kubernetes cluster, see the Create a minikube cluster section.
Create a minikube cluster
Minikube is a tool that creates a single-node Kubernetes cluster on your computer. Follow these steps if you don’t have a running Kubernetes cluster:
-
Install minikube by following the steps from the Install minikube site.
-
Install kubectl. See the instructions from the Install and Set Up kubectl page.
-
You can now create a minikube cluster by entering the following command:
$ minikube start
-
Once the cluster has been created, you can verify its status by entering:
$ minikube status
Create a namespace
A distinct namespace provides an additional layer of isolation and more control over the continuous integration environment. Create a namespace for the Jenkins deployment by typing the following command in your terminal:
$ kubectl create namespace jenkins
Use the following command to list existing namespaces:
$ kubectl get namespaces
The output confirms that the jenkins namespace was created successfully.
$ kubectl get namespaces
NAME STATUS AGE
default Active 50m
jenkins Active 30s
kube-node-lease Active 50m
kube-public Active 50m
kube-system Active 50m
If an error occurs, please refer to articles tagged with the minikube tag in the community forum. The community forum is a good place for questions and answers.
Unresolved include directive in modules/installing/pages/kubernetes.adoc - include::doc/book/installing/_kubernetes.adoc[]
Unresolved include directive in modules/installing/pages/kubernetes.adoc - include::doc/book/installing/_setup-wizard.adoc[]