Patterns describing how to use specific switches (--<query_name> , ns_list and pod_list
) and general switch (resource_list
)
--<query_name> <NetworkPolicy set> --ns_list <namespaces path> --pod_list <pods path>
see example here--<query_name> <NetworkPolicy set> --resource_list <namespaces and pods path>
see example here--<query_name> --resource_list <networkPolicies, namespaces and pods paths>
see example here
Patterns describing how to combine specific switches (global: --<query_name> , ns_list and pod_list
, base:base_np_list, base_ns_list and base_pod_list
), and general switches (global: resource_list
, base: base_resource_list
)
--<query_name> <NetworkPolicy set> --base_np_list <NetworkPolicy set> --ns_list <namespaces path> --base_ns_list <namespaces path> --pod_list <pods path> --base_pod_list <pods path>
see example here- Using general base switch to specify base topology paths, may be used with any combination of the global switches above
--<query_name> --resource_list <networkPolicies, namespaces and pods paths> --base_np_list <NetworkPolicy set> --base_resource_list <namespaces and pods path>
see example here - Using general base switch to specify all base resources, may be used with any combination of the global switches above
--<query_name> --resource_list <networkPolicies, namespaces and pods paths> --base_resource_list <networkpolicies, namespaces and pods path>
see example here
- When running without any switch (i.e.
--<query_name>
), nca checks if a communication with k8s live cluster is available, if yes - resources will be loaded from k8s live cluster, otherwise, the query runs on empty resources (empty query result)
Running with switches:
- When running with specific topology switches only (using only
pod_list
andns_list
) without providing networkPolicy path, policies will be loaded from k8s live cluster - When running with specific policies switches only (i.e.
--<query_name> <NetworkPolicy set> [--base_np_list <NetworkPolicy set>]
), topology objects will be loaded from k8s live cluster - For global and base configs, if networkPolicies paths are missing (i.e. the specific switch is not used and general switch does not refer to any policy), nca considers no policies in place.
- If global pods paths are missing (i.e. the specific switch is not used and general switch does not refer to any pod), an empty peer set is created.
- If base pods are missing, global pods will be used
- If namespaces paths are missing:
- if there are pods, the namespaces set will contain the pods' namespaces
- else global namespaces will be used if existed, otherwise, empty namespaces container is used.
- If any of the specific switches is specified, it overrides the relevant resources from paths in the argument of the general switch.
namespaceList: [list of namespaces paths]
podList: [list of pods paths]
see example hereresourceList: [list of namespaces and pods paths]
see example here
networkConfigList:
- name: <config_name>
networkPolicyList: [list of networkPolicies paths]
namespaceList: [list of namespaces paths]
podList: [list of pods paths]
see example herenetworkConfigList:
- name: <config_name>
networkPolicyList: [list of networkPolicies paths]
resourceList: [list of namespaces and pods paths]
see example herenetworkConfigList:
- name: <config_name>
resourceList: [list of networkPolicies, namespaces and pods paths]
see example here
- If global scope does not exist, nca checks if a communication with k8s live cluster is available, if yes - topology resources will be loaded from k8s live cluster, otherwise, an empty peer container is created
- If
networkPolicyList
is not used andresourceList
does not refer to any policy, a query reading this considers empty network-policies list. - If global pods are missing (i.e.
podList
is not used andresourceList
does not refer to any pod), global cluster will have 0 endpoints. - If config's pods are missing, global pods will be used
- If namespaces are missing,
- if there are pods, namespaces set will contain the pods' namespaces
- otherwise, global namespaces will be used if existed else cluster has empty namespaces container
- If any specific key is specified it will override the relevant contents in resourceList