Deploy NGINX over Kubernetes
Get started with the Minimus Nginx image in minikube
This guide walks you through the steps to deploy NGINX over Kubernetes in a minikube environment. Minikube is a local Kubernetes setup that requires only Docker or a Virtual Machine environment and is ideal for testing.
Use this guide as a reference for deploying any Minimus image over Kubernetes.
Set up minikube
If you already have a Kubernetes cluster available, you can skip ahead to the next step. If not, you can install a single node cluster using minikube to set up a testing environment. Follow the minikube get started guide to deploy a cluster, install kubectl, and test that everything is working.
The instructions are platform-specific and provided for Windows, MacOS, and Linux.
Fetch the example Kubernetes YAML configuration files
The configurations are based on the changes described in our general NGINX guide. To simplify the process we provide example configuration files in our GitHub repo.
Save the example yaml files to your project folder:
Generate the Image Pull Secret
To avoid using a Minimus token in plaintext, we will create a Kubernetes Secret containing the credentials needed to pull images from the Minimus registry.
-
Copy a token from your console.
-
Create a Docker auth JSON by executing the following command. Use the token from step 1 as the password when prompted:
-
Base64 encode the auth JSON, by running:
-
Edit the
pullsecret.yaml
file, to include your base64 encoded auth JSON.Under the
data
section, update thedockerconfigjson
with the base64 encoded auth JSON and save your changes.pullsecret.yaml
Deploy to your cluster
Run the following command from the project directory to deploy your NGINX container. The command applies all YAML files in the current directory (.
).
Verify the pods
To check that all pods are ready and running, run:
You should receive a pod status check (also known as, pod readiness verification) such as hello-nginx-55bd9b99f4-bgxpd
verifying the status of the pod is up and running.
If you’re new to Kubernetes, you can learn more about the ReplicaSet hash and random suffix in the official Kubernetes guide.
Visit the NGINX site
To look up which external IP address was set for NGINX web access, run:
The response should print the address along with the port, for example, http://192.168.49.2:30001
. Open this address in your browser to see the NGINX welcome page.
For other Kubernetes clusters, run this command to proxy access from your local machine to the service running in your cluster:
Connect to http://localhost:30001
to see the NGINX welcome page. Hit CTRL-C in your terminal window to end the port forwarding.