Rahul Priyadars
Tera Sage
Tera Sage

Just thought of putting all necessary information on Kubernetes at One place for consumption. 

Kubernetes And Its Components:-Kubernetes is a cluster and container management tool. It lets you deploy containers to clusters, meaning a network of virtual machines. It works with different containers, not just Docker.

Below are the components / Resources used in in terms of K8 Deployment.

API Server, POD, Container, Service, Node , Cluster , Volume , Image , Control Plane Node , Docker , Docker Image .

I will not go into Details of all These Keywords here. Refer this URL for details-https://kubernetes.io/docs/reference/glossary/?fundamental=true

 

CMDB Data Model Class For Kubernetes Components:-

cmdb_ci_kubernetes_cluster

cmdb_ci_kubernetes_node

cmdb_ci_docker_image

cmdb_ci_kubernetes_service

cmdb_ci_kubernetes_pod

cmdb_ci_docker_container

cmdb_ci_kubernetes_volume

 

Pre- Requisite for Kubernetes Discovery -

You Must have Discovery and Service Mapping Patterns application. Once You have this then you will be able to See the Kubernetes Option In Discovery--> Credentials Application.

find_real_file.png

Creating a Kubernetes Credentials:- We can create using Above Kubernetes Credentials option. It uses basic Authentication or Bear Token.

find_real_file.png

Create a Credential ALIAS and Connect this Credential Record created previously.

find_real_file.png

Creating Discovery Schedule for Kubernetes:- It uses Server-less option in the discovery schedule. Configure Discovery Parameters for Kubernetes discovery into Server Less execution pattern Related List.

find_real_file.png

 

Configure SERVERLESS EXECUTION PATTERN for Kubernetes Discovery.

 find_real_file.png

 

 

From Discovery Schedule You can Run the discovery of Kubernetes Discovery. You Can check the Discovery Logs and if all is ok the Debug Logs will look green as below. It refers to all the steps used in the K8 Patterns which is used for Kubernetes Discovery. It will create CI entries in Corresponding K8 CI tables.

 

 

find_real_file.png

List of Kubernetes Patterns is at below URL.

https://<YourInstance>.service-now.com/nav_to.do?uri=%2Fsn_discovery_patterns_list.do

find_real_file.png

Hope This is helpful . 

 

Ref Used:- https://docs.servicenow.com/bundle/paris-it-operations-management/page/product/service-mapping/concept/kubernetes-discovery.html

Regards

RP

Comments
Juhi Batra1
Tera Contributor
Thanks for creating descriptive article on Kubernetes Components, it will help us learn early. Keep posting Articles!!
kumarsatyam
Tera Expert
Great information on Kubernetes And Its Components at single place. It helped me also.
Prateek11
Tera Contributor

Wondeful contents

Prateek11
Tera Contributor

Wonderful contents. Very helpful.

shwetanksingh
Kilo Guru

Very nicely written  understood in one go ......

Prachi10
Kilo Contributor
Very informative content on Kubernetes Components .
Manika
Mega Explorer
So grateful to find this informative content on Kubernetes Components Discovery. Keeping posting! This insight is really helpful.
Manika
Mega Explorer
So grateful to find this informative content on Kubernetes Components Discovery. Keeping posting! This insight is really helpful.
Suresh22
Tera Explorer

Very Good content  and help full for developers/Beginner who started working on Discovery 

 

Thank you for the Article!!!!!

 

Rahul Priyadars
Tera Sage
Tera Sage

Thanks

Community Alums
Not applicable

I was going through the docs to learn about Kubernetes and it's components discovery, and found this very informative and helpful article is already published here on community. For me, this article is so worthy. 

Thanks for posting the same !!

Prasad Chundi
ServiceNow Employee
ServiceNow Employee

Thanks for creating this KB article.. Could you please share configuration steps on Kubernetes side as well (screen shots). 

Rahul Priyadars
Tera Sage
Tera Sage

steps are there . also refer this for more details.

https://docs.servicenow.com/bundle/orlando-it-operations-management/page/product/service-mapping/concept/kubernetes-discovery.html

Regards

RP

Prasad Chundi
ServiceNow Employee
ServiceNow Employee

I am following above link.  I am getting error 401 error. Not sure why it doesnt like my credentials.  can you please review below and confirm where its going wrong.

 

401 errorfind_real_file.png

Kubectl config view output

find_real_file.png

kubectl describe secret

find_real_file.png

serverless pattern definition.

find_real_file.png

Rahul Priyadars
Tera Sage
Tera Sage

See if it helps you.

https://hi.service-now.com/kb_view.do?sysparm_article=KB0832864

Regards

RP

Prasad Chundi
ServiceNow Employee
ServiceNow Employee

nope already tried it... 

Nik Amy
Tera Contributor

@Rahul Priyadarshy  Can you please have a look at this and let me know if you have any inputs on that-https://community.servicenow.com/community?id=community_question&sys_id=b93dade3dbb920109e691ea668961962

Thanks!

Ansuman Giri
Kilo Contributor

@Rahul Priyadarshy I did all the steps as per the docs and your post, but when I run the discovery it's showing the following error 
"Kubernetes Namespace API call failed or there are no Namespaces in the query. Please verify the configuration data and/or user permissions., Pattern name: Kubernetes, To Check Pattern Log Navigate to:..."

you can take a look at my post- https://community.servicenow.com/community?id=community_question&sys_id=e48357af1b5c4d10ada243f6fe4b...

Thank You

Rahul Priyadars
Tera Sage
Tera Sage

In Name space can you try using - actual namespace you found on the Kubernetes platform.

Remove * and Try with above Namespace Please.

Regards

RP

Madhav97
Tera Explorer

Supporting and informative article to learn about components discovery using kubernetes Platform for servicenow in one go

NarayanaParella
Tera Contributor

Thank you Rahul. I have situation that, we are discovering docker Images by Image ID. Every deployment docker image is updated with new number but same name. by the way all our docker images we are discovering from GCP. Is there any way we can bring additional information like GCP project name as Docker Image attribute? so that we can reduce duplicates and assign changes to right Ci's?

Rahul Priyadars
Tera Sage
Tera Sage

Hi @NarayanaParella 

 

As per CMDB Structure 

[cmdb_ci_docker_image]-  Stores information on the globally unique representation of Docker images.

 

[cmdb_ci_docker_local_image]- Stores local instances of Docker images.

 

This is connected using relationship-  Instantiates::Instantiated By

 

Now Let me Know what are you looking for more as both entities are connected . is Your requirement is from Report Perspective>

Regards

RP

FLP1
Tera Contributor

hello @Rahul Priyadars, thank you for sharing all this good information!, i have one question perhaps you can help me to know. there is a pattern called Kubernetes Event, is this only updating relationship information from the clusters? i see in the documentation what it does and it seems to be only working to update some relationships that may be used if you have implemented ACC for kubernetes events. Am i correct? or what should i expect from this patter?

 

thank you!

mgallagher
Tera Explorer

@FLP1 Kubernetes Event is intended to be run more frequently than the standard pattern in order to poll the Kubernetes event queue and update the CMDB with the most recent changes since the last time it was run.  Generally those are only relationships and net new components.  It doesn't do a full cluster scan.  

 

However, if you're looking for more frequently updating your CMDB with Kubernetes components, I actually recommend using the newer ACC-V for Kubernetes.  It's lovingly called CNO 2.0 after the older Cloud Native Operations set for real time updating of Kubernetes components into your CMDB. 

 

Will Hallam and I did a session on it during Beers with Engineers in November: https://www.youtube.com/watch?v=O-aExiA9TvY&list=PLkGSnjw5y2U5s0r-QCb5xDN3pdRq_4UWs&index=19

FLP1
Tera Contributor

Thank you for your help @mgallagher , in the same line for kubernetes discovery, i have an issue with the discovery schedules where i can see the ECCQ with all the messages processed, the CI's updated but it does not finishes, the scan remains active... has anybody run into something like that?

 

Thank you!

Jefferson
Kilo Sage

Hi everyone, 

I understand this post I somewhat old, however, I have a query about the Kubernetes Discovery in ServiceNow as we have multiple ways to authenticate, and I still cannot get my head around how to set it up correctly.

I'm trying to follow instructions provided in these 3 links:

TOI: Automatic serverless schedule creator for kubernetes discovery - Support and Troubleshooting (s...

AKS Cluster Discovery Configuration Details - Support and Troubleshooting (servicenow.com)

and the product documentation: Kubernetes discovery (servicenow.com)

Following the first KB I was able to get the pattern to automatically create serverless schedules for each cluster we have. Then, following the second link, I've installed Azure CLI on mid server, and this is where I've stopped as I couldn't understand how to setup Azure CLI.

Jefferson_0-1720587085723.png

 

So, the log says I need to run 'az login', which I did on mid server, but apparently it doesn't remember, and it asks every time.

Jefferson_1-1720587451427.png


And what makes this even more confusing to me, is that in the documentation they mention we don't need create credentials if running the automatic serverless schedules.

Jefferson_0-1720587914896.png


Has anyone configured this before, could you please share any insights?

Cheers!



wzhengw
Tera Explorer

Hello @Rahul Priyadars  Thanks for your detail steps. I have a question about 'No Source in Discovery Log' after I configure all information refer to your steps above and click 'Discovery Now'. Could you please check the detail screenshot below and provide same suggestion for me. Thanks in advance.

1. Kubernetes Credentials

Kubenetes Credential.jpg

2. Discovery Schedule

Discovery Schedule.jpg

3. Serverless Execution Pattern

Serverless Execution Pattern.jpg

4. Discovery Status as below after I click Discovery Now

Discovery Status.jpg

5. There is no Source in Discovery pattern Log

No Source in Discovery Log.jpg

Karan Mehta
Tera Contributor

Hi, 

 

Which username and Password to enter in credentials? Is it the Kubernetes cluster credentials?

Version history
Last update:
‎10-10-2020 08:31 PM
Updated by: