Skip to main content

Managing a Kubernetes context

Within Kubernetes, a context is useful to:

  • Manage multiple development, testing, and production environments.
  • Simplify your interaction when working with multiple clusters, users, and namespaces.

You can use the UI to edit or duplicate a context, or import a Kubernetes configuration file that contains multiple contexts. These tasks help in defining contexts with different configurations, enabling easy switching between environments during development.

Prerequisites

Procedure: Edit a context

  1. Go to the Settings > Kubernetes page.
  2. Click the Edit Context icon. The Edit Context popup window opens. edit context icon
  3. Edit any of the following context details:
    • Name
    • Cluster
    • User
    • Namespace edit context window
  4. Click Save.

Procedure: Duplicate a context

  1. Go to the Settings > Kubernetes page.
  2. Click the Duplicate Context icon.

Procedure: Import contexts

  1. Go to Settings > Kubernetes, and click the Import button. Import button on the Kubernetes settings page
  2. Perform one of the following steps:
    • Drag and drop a Kubernetes configuration file.
    • Click Choose file:
      1. select a Kubernetes configuration file from your machine.
      2. Edit the display name if needed.
      3. Click Import Config. import configurations button
  3. Review the contexts to import, and click Import contexts. import contexts button

Verification

  • Edit a context: View the updated context details on the same page. updated context details
  • Duplicate a context: View the duplicated context on the same page.
  • Import contexts: View the added Kubernetes contexts on the same page.

Additional resources