

Note: If you are on a cloud, you can expose the service using a load balancer using the service type Loadbalancer. Step 4: Create a service.yaml file with the following contents to expose the nexus endpoint using NodePort.

kubectl create -f deployment.yamlĬheck the deployment pod status kubectl get po -n devops-tools Step 3: Create the deployment using kubectl command. It also has the host data volume for nexus data. apiVersion: apps/v1ĭeployment YAML for Nexus 3.x: Following deployment is for Sonatype nexus 3. As explained before, the nexus data directory will be added as a volume in the host server. Note: The images used in this deployment are from the public official Sonatype docker repo.( Nexus2 image & Dockerfile ) ( nexus 3 image & Dockerfile)ĭeployment YAML for Nexus 2.x: If you want to deploy nexus 2, you can use the following deployment file. Create the YAML based on the Nexus version you need. Step 1: Create a namespace called devops-tools kubectl create namespace devops-tools Let’s get started with the setting up nexus on Kubernetes. Clone the repository to you local workstation to directly execute it. Kubernetes Tutorials For Beginners: 43 Comprehensive GuidesĪll the Kubernetes manifests used in this guide is hosted on an Github repository. Please check the official system requirements for more details.

The intention of this guide is for POC or testing purposes. In this guide, we are using the host volume mount for nexus data.Also, we have different deployment files for Nexus 2 & Nexus 3 versions. Make sure you have the namespace created, or you can edit the YAML to deploy in a different namespace. Nexus deployment and service are created in the devops-tools namespace.Important Notesįollowing are the key things to be noted about the nexus setup. This guide will walk you through the step-by-step process of deploying Sonatype Nexus OSS on a Kubernetes cluster.

I have covered Nexus setup on Linux VM in another article. As a devops engineer, it is essential to know about artifact management tools. It is a widely used tool and can be seen in most CI/CD workflows. Nexus is open-source artifact storage and management system.
