How do i display the openshift configuration?



  • This is the config of your kubernetes config, stored under the .kube directory, this is because openshift uses kubernetes to manage containers. it gets created when you first run "oc login" and is updated when you make changes. The oc config has subcommands to manage the config file.

    Display all the oc configuration.

    oc config view
    apiVersion: v1
    clusters:
    - cluster:
        server: https://console.starter-us-east-1.openshift.com:443
      name: console-starter-us-east-1-openshift-com:443
    contexts:
    - context:
        cluster: console-starter-us-east-1-openshift-com:443
        namespace: prodfront
        user: demosession/console-starter-us-east-1-openshift-com:443
      name: prodfront/console-starter-us-east-1-openshift-com:443/demosession
    current-context: prodfront/console-starter-us-east-1-openshift-com:443/demosession
    kind: Config
    preferences: {}
    users:
    - name: demosession/console-starter-us-east-1-openshift-com:443
      user:
        token: J3eG95GYiGF0Bgmwcxcxcxcxc4i16SWfL-8jK9vPs
    

    An example subcommand to display where you are currently pointing to.

    $ oc config current-context
    prodfront/console-starter-us-east-1-openshift-com:443/demosession
    

    Available subcommands are:

    Available Commands:
      current-context Displays the current-context
      delete-cluster  Delete the specified cluster from the kubeconfig
      delete-context  Delete the specified context from the kubeconfig
      get-clusters    Display clusters defined in the kubeconfig
      get-contexts    Describe one or many contexts
      rename-context  Renames a context from the kubeconfig file.
      set             Sets an individual value in a kubeconfig file
      set-cluster     Sets a cluster entry in kubeconfig
      set-context     Sets a context entry in kubeconfig
      set-credentials Sets a user entry in kubeconfig
      unset           Unsets an individual value in a kubeconfig file
      use-context     Sets the current-context in a kubeconfig file
      view            Display merged kubeconfig settings or a specified kubeconfig
    file
    

Log in to reply
 

© Lightnetics 2024