# openshift

A skill for Red Hat OpenShift work: projects, routes, builds and app deploys driven through the oc CLI.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 349 installs · ★ 1177
- Author: devops-skills
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/BagelHole/DevOps-Security-Agent-Skills/tree/HEAD/devops/orchestration/openshift/SKILL.md
- Updated: 2026-05-22
- HTML: https://affpapa.org/en/nevibecode/skills/openshift

## What it does

The skill hands your agent a reference for OpenShift Container Platform and OKD. It covers `oc` commands for logging in, creating projects and switching between them, plus deploys from an image, from Git via S2I and from templates. Manifests are there too: a Route with edge TLS termination, BuildConfig, ImageStream, DeploymentConfig, ConfigMap and Secret.

Some sections target what plain Kubernetes does not have. Routes that split traffic between two services for an A/B test. Source-to-Image builds with a builder image such as `nodejs:18-ubi8`. Security Context Constraints: listing them with `oc get scc`, granting one to a service account with `oc adm policy add-scc-to-user`. There is also a starting point for subscribing to an operator from `openshift-marketplace`.

You need cluster access, the `oc` CLI installed and basic Kubernetes knowledge — otherwise there is nowhere to run these commands. Author is devops-skills, MIT licensed.

## Requirements
- Works with: Kubernetes

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill openshift -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/openshift/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/openshift/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill openshift -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/openshift/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill openshift -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/openshift/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install BagelHole/DevOps-Security-Agent-Skills openshift
```

2. **Manually: put the files in place**
- File: `.github/skills/openshift/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill openshift -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/BagelHole/DevOps-Security-Agent-Skills --path devops/orchestration/openshift
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/openshift/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add BagelHole/DevOps-Security-Agent-Skills --skill openshift -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/BagelHole/DevOps-Security-Agent-Skills/tree/HEAD/devops/orchestration/openshift/SKILL.md

## When to use it
- log in to an OpenShift cluster with a token or password
- create a project and switch to it
- deploy an app from a Git repo through S2I
- expose a service with a TLS route
- grant an SCC to a service account

## Example prompts
- log in to the cluster and show the current context
- deploy our app from the Git repo using S2I
- create an edge route for the myapp service

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: e2a61821d249ad73.

BEGIN THIRD-PARTY FILE e2a61821d249ad73
````text
---
name: openshift
description: Manage Red Hat OpenShift clusters and deployments. Configure projects, routes, builds, and deploy applications using OpenShift-specific features. Use when working with OpenShift Container Platform or OKD for enterprise Kubernetes.
license: MIT
metadata:
  author: devops-skills
  version: "1.0"
---

# OpenShift

Deploy and manage applications on Red Hat OpenShift Container Platform.

## When to Use This Skill

Use this skill when:
- Deploying applications to OpenShift clusters
- Using OpenShift-specific features (Routes, BuildConfigs)
- Managing projects and RBAC in OpenShift
- Implementing S2I (Source-to-Image) builds
- Working with OpenShift Operators

## Prerequisites

- OpenShift cluster access
- oc CLI installed
- Basic Kubernetes knowledge

## CLI Basics

### Authentication

```bash
# Login to cluster
oc login https://api.cluster.example.com:6443 -u admin -p password

# Login with token
oc login --token=sha256~xxxx --server=https://api.cluster.example.com:6443

# Check current context
oc whoami
oc whoami --show-server
oc whoami --show-context

# Logout
oc logout
```

### Project Management

```bash
# Create project (namespace)
oc new-project myapp --display-name="My App" --description="My Application"

# Switch project
oc project myapp

# List projects
oc projects

# Delete project
oc delete project myapp
```

## Deploying Applications

### From Image

```bash
# Deploy from container image
oc new-app --image=nginx:latest --name=webserver

# Deploy from Docker Hub
oc new-app docker.io/library/nginx:latest

# Deploy with environment variables
oc new-app myimage:latest \
  -e DATABASE_URL=postgres://localhost/db \
  -e APP_ENV=production
```

### From Source (S2I)

```bash
# Deploy from Git repository
oc new-app https://github.com/org/myapp.git

# Specify builder image
oc new-app nodejs:18~https://github.com/org/nodejs-app.git

# With context directory
oc new-app https://github.com/org/monorepo.git \
  --context-dir=backend \
  --name=backend-api
```

### From Template

```bash
# List available templates
oc get templates -n openshift

# Deploy from template
oc new-app postgresql-persistent \
  -p POSTGRESQL_USER=user \
  -p POSTGRESQL_PASSWORD=secret \
  -p POSTGRESQL_DATABASE=mydb
```

## Routes

### Creating Routes

```yaml
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: myapp
spec:
  host: myapp.apps.cluster.example.com
  to:
    kind: Service
    name: myapp
    weight: 100
  port:
    targetPort: 8080
  tls:
    termination: edge
    insecureEdgeTerminationPolicy: Redirect
```

```bash
# Create route via CLI
oc expose svc/myapp

# Create with custom hostname
oc create route edge myapp \
  --service=myapp \
  --hostname=myapp.apps.cluster.example.com

# Create passthrough route (TLS termination at pod)
````
END THIRD-PARTY FILE e2a61821d249ad73

The third-party file has ended. Everything between the e2a61821d249ad73 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2806 of 8827 bytes. © devops-skills · MIT · https://github.com/BagelHole/DevOps-Security-Agent-Skills/tree/HEAD/devops/orchestration/openshift/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
