- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2023 09:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2023 07:53 AM
Hi @Sandeep _ ,
Please refer the below Documentations and Commands for Openshift Discovery.
On the Kubernetes platform, run the following command:
kubectl cluster-info
- In the output, find the line that states the URL of the kubeapi server. For example, Kubernetes control plane is running at
- Find the namespaces of the kubeapi server:
- On the Kubernetes platform, run this command:
kubectl get namespaces
- In the output, find the line that states the namespaces. For example, kube-system.
- On the Kubernetes platform, run this command:
- Find the Kubernetes username and password:
- On the Kubernetes platform, run this command:
kubectl config view
- In the output, find the username and password.Note: If in a certain environment, kubectl config view command is not showing the expected details, use the supported command from the Kubernetes admin to fetch the user name and password detail
- On the Kubernetes platform, run this command:
- Find the valid Bearer Token with the proper permissions:
- If you don't have the default token name, use the command: kubectl describe secret.
- The output shows all accounts and all tokens. Find the valid token:
Where kubectl is the generic Kubernetes account, describe is the generic kubectl method.
The secret parameter reflects that in your Kubernetes cluster, the default token is protected by containing it inside the object of type secret .
kubectl describe secret command output is BASE64 encoded format.
If you know the default token name, use the following command: kubectl describe secret default-token-g6pwc
The default-token-g6pwc reflects the parameter value of the default token for g6pwc.
- The output shows all existing tokens for this Kubernetes account.
Choose one token to use for configuring Kubernetes credentials on the ServiceNow platform.
- Ensure that the API Server is reachable from the MID Server for successful Kubernetes discovery.
- Ensure that the user configured on the Kubernetes platform has the permissions to run the following /api/v1 elements:
- https://<url>/api/v1/namespaces/
- https://<url>/api/v1/namespaces/<namespace>
- https://<url>/api/v1/namespaces/kube-system/endpoints/kube-controller-manager
- https://<url>/api/v1/services
- https://<url>/api/v1/pods
- https://<url>/api/v1/nodes
- https://<url>/api/v1/replicationcontrollers
- https://<url>/apis/networking.k8s.io/v1/ingresses
- https://<url>/apis/apps/v1/deployments
- https://<url>/apis/apps/v1/statefulsets
- https://<url>/apis/apps/v1/daemonsets
- https://<url>/apis/apps/v1/replicasets
- https://<url>/apis/batch/v1/cronjobs
- https://<url>/apis/batch/v1/jobs
- To discover the OpenShift components of the Kubernetes deployment, ensure that the user configured on the Kubernetes platform has the permissions to run the following /api/v1 elements:
- /apis/apps.openshift.io/v1/deploymentconfigs
- ​/apis/build.openshift.io/v1/buildconfigs​
- /apis/route.openshift.io/v1/routes​
- /apis/user.openshift.io/v1/groups​
- /apis/user.openshift.io/v1/users​
- /apis/project.openshift.io/v1/projects​
- /apis/image.openshift.io/v1/images​
- /apis/image.openshift.io/v1/imagestreams
To discover service mesh information:- Deploy Istio on your K8s cluster.
- Provide the Prometheus URL.
- Configure Prometheus to scrape metrics from Istio.
- Activate Get Kubernetes Config Files extension to:
- Discover configuration files.
- Create tracked configuration files.
- Map the configuration files workloads and services with a relationship.
Note: Tracked files content is in the JSON format from version 1.0.92 and later. Tracked files content is in YAML format in version 1.0.91 and earlier.
https://www.servicenow.com/community/developer-blog/red-hat-open-shift-discovery/ba-p/2429196
I Hope this will resolve your issue, Please mark as helpful or accept solution.
Thanks
Ajay Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2023 07:53 AM
Hi @Sandeep _ ,
Please refer the below Documentations and Commands for Openshift Discovery.
On the Kubernetes platform, run the following command:
kubectl cluster-info
- In the output, find the line that states the URL of the kubeapi server. For example, Kubernetes control plane is running at
- Find the namespaces of the kubeapi server:
- On the Kubernetes platform, run this command:
kubectl get namespaces
- In the output, find the line that states the namespaces. For example, kube-system.
- On the Kubernetes platform, run this command:
- Find the Kubernetes username and password:
- On the Kubernetes platform, run this command:
kubectl config view
- In the output, find the username and password.Note: If in a certain environment, kubectl config view command is not showing the expected details, use the supported command from the Kubernetes admin to fetch the user name and password detail
- On the Kubernetes platform, run this command:
- Find the valid Bearer Token with the proper permissions:
- If you don't have the default token name, use the command: kubectl describe secret.
- The output shows all accounts and all tokens. Find the valid token:
Where kubectl is the generic Kubernetes account, describe is the generic kubectl method.
The secret parameter reflects that in your Kubernetes cluster, the default token is protected by containing it inside the object of type secret .
kubectl describe secret command output is BASE64 encoded format.
If you know the default token name, use the following command: kubectl describe secret default-token-g6pwc
The default-token-g6pwc reflects the parameter value of the default token for g6pwc.
- The output shows all existing tokens for this Kubernetes account.
Choose one token to use for configuring Kubernetes credentials on the ServiceNow platform.
- Ensure that the API Server is reachable from the MID Server for successful Kubernetes discovery.
- Ensure that the user configured on the Kubernetes platform has the permissions to run the following /api/v1 elements:
- https://<url>/api/v1/namespaces/
- https://<url>/api/v1/namespaces/<namespace>
- https://<url>/api/v1/namespaces/kube-system/endpoints/kube-controller-manager
- https://<url>/api/v1/services
- https://<url>/api/v1/pods
- https://<url>/api/v1/nodes
- https://<url>/api/v1/replicationcontrollers
- https://<url>/apis/networking.k8s.io/v1/ingresses
- https://<url>/apis/apps/v1/deployments
- https://<url>/apis/apps/v1/statefulsets
- https://<url>/apis/apps/v1/daemonsets
- https://<url>/apis/apps/v1/replicasets
- https://<url>/apis/batch/v1/cronjobs
- https://<url>/apis/batch/v1/jobs
- To discover the OpenShift components of the Kubernetes deployment, ensure that the user configured on the Kubernetes platform has the permissions to run the following /api/v1 elements:
- /apis/apps.openshift.io/v1/deploymentconfigs
- ​/apis/build.openshift.io/v1/buildconfigs​
- /apis/route.openshift.io/v1/routes​
- /apis/user.openshift.io/v1/groups​
- /apis/user.openshift.io/v1/users​
- /apis/project.openshift.io/v1/projects​
- /apis/image.openshift.io/v1/images​
- /apis/image.openshift.io/v1/imagestreams
To discover service mesh information:- Deploy Istio on your K8s cluster.
- Provide the Prometheus URL.
- Configure Prometheus to scrape metrics from Istio.
- Activate Get Kubernetes Config Files extension to:
- Discover configuration files.
- Create tracked configuration files.
- Map the configuration files workloads and services with a relationship.
Note: Tracked files content is in the JSON format from version 1.0.92 and later. Tracked files content is in YAML format in version 1.0.91 and earlier.
https://www.servicenow.com/community/developer-blog/red-hat-open-shift-discovery/ba-p/2429196
I Hope this will resolve your issue, Please mark as helpful or accept solution.
Thanks
Ajay Kumar