Skip to content

Deploy Your First Application

This guide shows you how to deploy your first application to your OpenShift cluster.

Choose Your Path

New to Kubernetes/OpenShift? Follow this guide to learn the basics with manual deployment.

Already experienced? Install Argo CD for your cluster if not already installed, then skip to Deploy with GitOps.

Prerequisites

Install OpenShift CLI

Option 1: Homebrew

brew install openshift-cli

Option 2: Manual download

  1. Download from your OpenShift console at: https://console.apps.<cluster-name>.intilitycloud.com/command-line-tools
  2. Extract the tar.gz file
  3. Move to PATH:
    sudo mv oc /usr/local/bin/
    
  1. Download from your OpenShift console at: https://console.apps.<cluster-name>.intilitycloud.com/command-line-tools
  2. Extract the zip file
  3. Add the oc.exe location to your PATH environment variable

Option 1: Homebrew

brew install openshift-cli

Option 2: Manual download

  1. Navigate to your OpenShift console: https://console.apps.<cluster-name>.intilitycloud.com/command-line-tools
  2. Download the Linux oc binary
  3. Extract and install:
    tar xzf openshift-client-linux.tar.gz
    sudo mv oc /usr/local/bin/
    

Connect to Your Cluster

You can find the exact login command for your cluster on your cluster page at developers.intility.com/clusters.

OC Command

Copy the command from your cluster page and run it in your terminal. The command will follow this format:

# Login with SSO
oc login -w https://api-<cluster-name>.apps.intilitycloud.com

# Example:
# oc login -w https://api-mycluster-fgtko5.apps.intilitycloud.com

# Verify connection (should output your email address)
oc whoami

Deploy a Simple Application

Create a Project

In OpenShift, applications are deployed to Projects (Kubernetes namespaces). Projects provide:

  • Isolation between different applications and teams
  • Resource quotas and limits
  • Access control through RBAC
# Create a new project
oc new-project my-app

# Verify current project
oc project my-app

Implicit Namespace Context

Once you create and switch to a project, all subsequent oc commands will operate within that project namespace unless you explicitly specify another project. This means the deployment, service, and route you create next will automatically be placed in the my-app project.

Deploy the Application

We'll deploy a simple nginx web server using three resources:

  1. Create deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-app
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx-app
  template:
    metadata:
      labels:
        app: nginx-app
    spec:
      containers:
      - name: nginx
        image: nginxinc/nginx-unprivileged:alpine
        ports:
        - containerPort: 8080
        resources:
          requests:
            memory: "64Mi"
            cpu: "50m"
          limits:
            memory: "128Mi"
  1. Create service.yaml:
apiVersion: v1
kind: Service
metadata:
  name: nginx-app
spec:
  selector:
    app: nginx-app
  ports:
  - port: 80
    targetPort: 8080
  1. Create route.yaml:
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: nginx-app
spec:
  to:
    kind: Service
    name: nginx-app
  tls:
    termination: edge

Apply and Verify

# Apply all resources
oc apply -f deployment.yaml
oc apply -f service.yaml
oc apply -f route.yaml

# Check your application is running
oc get pods
oc get route nginx-app

Your application is now accessible at the URL shown by the route command!

Understanding What We Deployed

  • Deployment - Manages your application pods, ensures replicas are running. Learn more
  • Service - Provides stable network access to your pods. Learn more
  • Route - Creates a public URL for external access. Learn more

Useful Commands

# View logs
oc logs deployment/nginx-app

# Scale your deployment
oc scale deployment/nginx-app --replicas=5

# Update image
oc set image deployment/nginx-app nginx=nginxinc/nginx-unprivileged:1.27

# Delete everything
oc delete deployment nginx-app
oc delete service nginx-app
oc delete route nginx-app

Next Steps