Skip to content

Instantly share code, notes, and snippets.

@tosin2013
Last active February 20, 2026 15:07
Show Gist options
  • Select an option

  • Save tosin2013/c377e93263296bb415c640985283aa86 to your computer and use it in GitHub Desktop.

Select an option

Save tosin2013/c377e93263296bb415c640985283aa86 to your computer and use it in GitHub Desktop.
utilities-pod.md

Deploying a Simple Utility Service in OpenShift

This document outlines the steps for deploying a basic utility service in OpenShift using the oc command-line tool and Docker images.

What it does

This script creates a deployment for a service named utilities with the following functionalities:

  • Runs the fedora:latest Docker image.
  • Installs essential utilities like nc, wget, curl, bind-utils, iputils, net-tools, and telnet.
  • Runs openldap-clients to enable LDAP server access.
  • Keeps the container running indefinitely by executing sleep 10000 as the command.

This is a basic example and can be customized with different tools and functionalities.

How it runs

  1. Building the Docker Image:

oc new-build --strategy docker --docker-image fedora:latest --name utilities -l app=utilities -D $'FROM fedora:latest\nRUN yum install -y nc wget curl bind-utils iputils net-tools telnet openldap-clients iproute nfs-utils\nCMD ["sleep", "10000"]'

  • oc new-build: Creates a new build configuration.
  • --strategy docker: Specifies Docker as the build strategy.
  • --image fedora:latest: Defines the base image for the build.
  • --name utilities: Names the build configuration.
  • -l app=utilities: Adds a label to the build for identification.
  • -D: Injects the Dockerfile content directly.
  • FROM fedora:latest: Starts the Dockerfile with the fedora:latest image.
  • RUN yum install -y ...: Installs the specified utilities within the container.
  • CMD ["sleep", "10000"]: Runs sleep 10000 to keep the container alive.
  1. Deploying the Service:
oc new-app utilities:latest
  • oc new-app: Creates a new deployment from the built image.
  • utilities:latest: Specifies the image name and tag (latest) for deployment.

This command will deploy the utilities service in OpenShift. You can access the service logs, view container details, and manage its lifecycle using the oc command or the OpenShift web console.

Notes

  • This example uses a publicly available Docker image (fedora:latest) for simplicity. You can replace it with a private image repository if needed.
  • The sleep 10000 command keeps the container running. You can replace it with the actual service command or application to run.
  • This documentation serves as a basic guide. Consider exploring additional OpenShift features and configurations for more advanced deployments.

Feel free to customize and expand this script to fulfill your specific needs for utility services in OpenShift.

Quick Deploy

oc new-project utli
oc new-build --strategy docker --image fedora:latest --name utilities -l app=utilities -D $'FROM fedora:latest\nRUN yum install -y nc wget curl bind-utils iputils net-tools telnet openldap-clients iproute nfs-utils\nCMD ["sleep", "10000"]'
oc new-app utilities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment