FreeKB - OpenShift List projects using the oc get netnamespaces command
OpenShift - List projects using the oc get netnamespaces command

If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.

Before you can use the projects command, you must first login using the oc login command.

The oc get netnamespaces command can be used to return each project / namespace, the ID of each namespace, and the egress IP addresses associated with the namespace.

~]# oc get netnamespaces
NAME        NETID     EGRESS IPS
project001  6509873  ["10.6.11.14"]
project002  1520201  ["10.56.1.231"]
project003  3967913  ["10.9.18.2"]

Ingress means a request coming in, whereas Egress means a request going out.

 

Or a specific netnamespace can be returned.

~]# oc get netnamespace project001
NAME        NETID     EGRESS IPS
project001  6509873  ["10.6.11.14"]

 

The -o option can be used to return additional output in YAML or JSON format.

~]# oc get netnamespace project001 -o yaml
apiVersion: network.openshift.io/v1
egressIPs:
- 10.6.11.14
kind: NetNamespace
metadata:
  creationTimestamp: "2021-07-22T13:21:13Z"
  generation: 2
  managedFields:
  - apiVersion: network.openshift.io/v1
    fieldsType: FieldsV1
    fieldsV1:
      f:netid: {}
      f:netname: {}
    manager: openshift-sdn-controller
    operation: Update
    time: "2021-07-22T13:21:13Z"
  - apiVersion: network.openshift.io/v1
    fieldsType: FieldsV1
    fieldsV1:
      f:egressIPs: {}
    manager: kubectl-patch
    operation: Update
    time: "2021-07-22T13:39:29Z"
  name: project001
  resourceVersion: "4030889"
  selfLink: /apis/network.openshift.io/v1/netnamespaces/project001
  uid: 2756a33b-77d6-489f-a6fa-10f66bd5d707
netid: 5512933
netname: project001

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter b978a in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |