How can I use a ServiceAccount with the oc client tool?

Solution Verified - Updated -

Issue

  • After creating a ServiceAccount and providing it with role-based access control (RBAC) permissions, how can the ServiceAccount credentials be used with the oc command line tool to automate functions within the cluster?
  • We require a permanent token that can be used with the oc client to access resources in the cluster.

Environment

  • OpenShift Container Platform
    • 4.X

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content