Skip to content

Replace oc with kubectl for standard Kubernetes operations #200

@agullon

Description

@agullon

Summary

Replace oc CLI usage with kubectl for standard Kubernetes operations throughout the codebase. The oc CLI should be retained only where OpenShift-specific subcommands are required (e.g., oc adm release info, oc adm release new, oc adm policy add-scc-to-group).

Motivation

This is an upstream/OKD project designed to work without Red Hat subscriptions. Depending on oc for basic get nodes/pods operations introduces an unnecessary dependency on the OpenShift CLI when kubectl (already bundled with MicroShift) is fully sufficient.

The codebase already uses kubectl in some places (e.g., src/cncf/run_sonobuoy_tests.sh, src/deb/install.sh), creating inconsistency. The DEB install script even creates a symlink from kubectloc because oc isn't available on Debian, highlighting this friction.

Scope

Replace ockubectl in:

  • src/cluster_manager.shoc get nodes,pods -A -o wide
  • src/quickrpm.shoc get pods -A (in echo/usage text)
  • src/quickstart.shoc get pods -A (in echo/usage text)
  • docs/run-bootc.mdoc get nodes, oc get pods -A
  • docs/run.mdoc get pods -A
  • src/etcd/README.mdoc get nodes, oc get pods -A
  • .claude/agents/microshift-deployer.md — "Use kubectl and oc commands" reference

Keep oc as-is in (no kubectl equivalent):

  • src/image/prebuild.shoc adm release info (OKD release inspection)
  • src/okd/build_images.shoc adm release new, oc adm release info (OKD image building)
  • src/cncf/run_sonobuoy_tests.shoc adm policy add-scc-to-group (OpenShift SCC management)

Review and simplify:

  • src/deb/install.sh — Currently creates kubectl → oc symlink; after this change, the symlink may no longer be needed for runtime usage (but may still be needed for build-time scripts that use oc adm)

Acceptance Criteria

  • All standard Kubernetes CLI invocations use kubectl instead of oc
  • oc is only used for OpenShift-specific subcommands (oc adm release info/new, oc adm policy)
  • Documentation reflects the change
  • make check passes (linters)

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions