public static List < String > getAllNameSpaces ( ) throws ApiException { V1NamespaceList listNamespace = COREV1_API . listNamespace ( null , "true" , null , null , null , 0 , null , Integer . MAX_VALUE , Boolean . FALSE ) ; List < String > list = listNamespace . getItems ( ) . stream ( ) . map ( v1Namespace -> v1Namespace . getMetadata ( ) . getName ( ) ) . collect ( Collectors . toList ( ) ) ; return list ; }
Get all namespaces in k8s cluster