Sohail Khilji
Kilo Patron

Guide on How to ServiceNow Kubernetes / OpenShift Discovery

 

Simple Steps for the Kubernetes discovery 

 

Step 1 : On MidServer capabilities add the following capability "Kubernetes".  To the one which will be used for discovery.

SohailKhilji_0-1756291603848.png

 

 

 Step 2:  Create a credentials either using username and password or only Bearer token do not use both. 

SohailKhilji_1-1756291603851.png

 

 

 Step 3 :  Make sure the bearer token has below mentioned API permissions. 

 

  1. Ensure that the user configured on the Kubernetes platform has GET 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 

    2. To discover the OpenShift components of the Kubernetes deployment, ensure that the user configured on the Kubernetes platform has GET 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 

    3. To discover service mesh information: 
  • Deploy Istio on your K8s cluster. 
  • Provide the Prometheus URL. 
  • Configure Prometheus to scrape metrics from Istio. 

    Step 4 :
      
    Create credentials alias connecting to the Kubernetes credentials. 

SohailKhilji_2-1756291603853.png

 

 

 Step 5:  Make Sure the MIDServer has the valid SSL certificate from the Kubernetes if its not available fetch the certificate from the Kubernetes host to the api using the below mentioned command. 

 

openssl s_client -connect https://api.kplustest.arabbanking.local:6443 -showcerts 

 

Step 6 :  Once you receive the certificate create the certificate with.cer extension in the midserver host. 

SohailKhilji_3-1756291603855.png

Step 7 : Once the certificate has been created in the MidServer host import the certificate using the keytool command. 

 

https://www.servicenow.com/docs/bundle/zurich-servicenow-platform/page/product/mid-server/task/add-s... 

SohailKhilji_4-1756291603856.png

 

 

 Step 8 :  Once the Certificate has been imported to the ca-cert path restart the midserver. 

Sync the mid-server from the ServiceNow instance. 

Create a discovery schedule job for serverless execution. 

SohailKhilji_5-1756291603857.png

2. In the discovery schedule add all the parameters required along with the midserver. 

3. Create a Serverless execution pattern with the details mentioned from the Kubernetes end. 

 

SohailKhilji_6-1756291603858.png

 

 

SohailKhilji_7-1756291603859.png

 

 

 Step 9 : These information will be provided by the Kubernetes team using the commands mentioned the documentation. 

kubectl cluster-info 

kubectl get namespaces 

kube-system. 

 

  1. Once these details been added into Serverless execution pattern save the discovery schedule job. 
  1. This is give us the Kubernetes details in the discovery schedule. 

SohailKhilji_8-1756291603861.png

 

 

If you find the article to be useful or effective for your knowledge Kindly Consider Marking the article HELPFUL and BOOKMARK if for your future use...

 

 

< Previous Post                                                            Next Post > 

 

           <<<  Top Articles  >>>

  1. ServiceNow Integration with Splunk
  2. LDAP Integration with ServiceNow
  3. ServiceNow Integration with Veeam
  4. Handling ServiceNow flow errors with a flow
  5. Show parent child incident relationships - display in field message
  6. ServiceNow SSO Logout Error (redirects to logout page) – Reason, Fixes and Cause.
  7. Multi Row Variable set ServiceNow MRVS - Creating - Scripting - Example - Limits
  8. ServiceNow Integration with MAC vendor - Get Mac vendor for the given MAC Address.
  9. How to find Log4j vulnerable severs in ServiceNow Using CMDB Query Builder (SecOps) 
  10. How to Cancel a Long-Running Transaction ServiceNow
  11. Hidden Features for System Administrators
  12. Servicenow RPA - Understanding Attended / Unattended / Skilled Automation Bots
  13. Servicenow vCenter Discovery | Step by step Discovering VMware using vCenter Discovery. 
  14. Set Discovery Schedule name to CMDB Record (via Discovery) 
  15. Step by Step - How to discover Linux Servers in ServiceNow 
  16. How to Generate PDF from UI action. 
  17. Servicenow Discovery Implementaion Requirement Gathering & Pre-requisites.
  18. 4 Step ServiceNow Discovery for Axis IP Cameras Using SNMP 
  19. Steps to ServiceNow Azure Cloud Discovery Configuration: From Credentials to CI Detection 

 

SohailKhilji_0-1781511085805.jpeg

 

 

MF Sohail Khilji | ServiceNow Developer /  Consultant.

Connect On LinkedIn >   https://www.linkedin.com/in/mf-sohail-khilji/

 

 

Version history
Last update:
2 hours ago
Updated by:
Contributors